diff --git a/.github/guid-index.json b/.github/guid-index.json index 3d243b44..15577912 100644 --- a/.github/guid-index.json +++ b/.github/guid-index.json @@ -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 }, diff --git a/.github/workflows/reusable-ci.yml b/.github/workflows/reusable-ci.yml index e5b03f54..07e0f955 100644 --- a/.github/workflows/reusable-ci.yml +++ b/.github/workflows/reusable-ci.yml @@ -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 @@ -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 @@ -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: diff --git a/changelog.d/20261104_free_runner_disk.md b/changelog.d/20261104_free_runner_disk.md new file mode 100644 index 00000000..8bc8eb3d --- /dev/null +++ b/changelog.d/20261104_free_runner_disk.md @@ -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.