Skip to content

Commit

Permalink
Merge pull request #3572 from twz123/reclaim-gh-runner-disk-space
Browse files Browse the repository at this point in the history
Reclaim GitHub Runner disk space
  • Loading branch information
twz123 authored Oct 11, 2023
2 parents f9de64b + 5660cff commit 0d1bad0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,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

Expand Down Expand Up @@ -286,6 +289,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

Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/reclaim-runner-disk-space.bash
Original file line number Diff line number Diff line change
@@ -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 /
7 changes: 0 additions & 7 deletions inttest/network-conformance/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,4 @@ const k0sConfig = `
spec:
network:
provider: %s
workerProfiles:
- name: default
values:
# GitHub runners may get low on disk space
evictionHard:
nodefs.available: 200Mi
imagefs.available: 200Mi
`

0 comments on commit 0d1bad0

Please sign in to comment.