Skip to content

Commit

Permalink
Merge pull request #3575 from k0sproject/backport-3572-to-release-1.28
Browse files Browse the repository at this point in the history
[Backport release-1.28] Reclaim GitHub Runner disk space
  • Loading branch information
twz123 authored Oct 12, 2023
2 parents d71cc2f + a8bc052 commit 806cb56
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 806cb56

Please sign in to comment.