Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/guid-index.json
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@
"path": ".github/workflows/reusable-ci.yml",
"guid": "reusable-ci-2025-09-24-core-workflow",
"title": "Reusable CI Workflow",
"version": "1.19.4",
"version": "1.20.0",
"header_path": ".github/workflows/reusable-ci.yml",
"path_mismatch": false
},
Expand Down
24 changes: 22 additions & 2 deletions .github/workflows/reusable-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# file: .github/workflows/reusable-ci.yml
# version: 1.19.4
# version: 1.20.0
# guid: reusable-ci-2025-09-24-core-workflow
# last-edited: 2026-10-27
# last-edited: 2026-11-04

name: Reusable CI Workflow

Expand Down Expand Up @@ -83,6 +83,17 @@ on:
required: false
type: string
default: ''
free-runner-disk:
description: >-
Before Go CI restores its cache, remove the preinstalled .NET, Android,
GHC and CodeQL toolchains from Linux runners. This frees about 25 GB.
A hosted ubuntu runner leaves about 14 GB free, and a large Go cache
plus -race test binaries can fill it ("final link failed: No space
left on device"). Off by default, because a caller may need one of
those toolchains.
required: false
type: boolean
default: false
force-all:
description: >-
Run every CI job whose language the repository contains, instead of only
Expand Down Expand Up @@ -640,6 +651,15 @@ jobs:
run: |
echo "GHCOMMON_SCRIPTS_DIR=$PWD/ghcommon-workflow-scripts/.github/workflows/scripts" >> "$GITHUB_ENV"

# Must run before setup-go restores the cache: a runner that fills up
# mid-restore cannot even write its own diagnostic log.
- name: Free runner disk
if: inputs.free-runner-disk && runner.os == 'Linux'
run: |
df -h /
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
df -h /

- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
Expand Down
10 changes: 10 additions & 0 deletions changelog.d/20261104_free_runner_disk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### Added

#### `reusable-ci.yml`: opt-in `free-runner-disk` input for Go CI

A new boolean input, `free-runner-disk` (default `false`). When it is true on
a Linux runner, the Go CI job removes the preinstalled .NET, Android, GHC and
CodeQL toolchains (about 25 GB) before `setup-go` restores its cache. A
caller with a large Go cache and `-race` test binaries was running the
hosted runner out of disk (`final link failed: No space left on device`).
Existing callers are unaffected.
Loading