diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index fc8f460d936d..b6e102c8ebf4 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -195,6 +195,9 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v3 + - name: Reclaim runner disk space + run: .github/workflows/reclaim-runner-disk-space.bash + - name: Prepare build environment run: .github/workflows/prepare-build-env.sh @@ -290,6 +293,9 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v3 + - name: Reclaim runner disk space + run: .github/workflows/reclaim-runner-disk-space.bash + - name: Prepare build environment run: .github/workflows/prepare-build-env.sh diff --git a/.github/workflows/reclaim-runner-disk-space.bash b/.github/workflows/reclaim-runner-disk-space.bash new file mode 100755 index 000000000000..16bd8bd2f6a4 --- /dev/null +++ b/.github/workflows/reclaim-runner-disk-space.bash @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set +eux + +if [ -z "$GITHUB_RUN_ID" ]; then + echo "Cowardly refusing to destroy a machine that doesn't look like a GitHub runner." >&2 + exit 0 +fi + +df -h / + +docker system prune --all --force & +sudo rm -rf /imagegeneration/installers & +sudo rm -rf -- "${ANDROID_SDK_ROOT-/opt/nevermind}" & + +wait + +df -h /