From 270dd60d5644dea47211e8a254c72105caacf062 Mon Sep 17 00:00:00 2001 From: Hubert Date: Tue, 6 Aug 2024 10:54:39 +0200 Subject: [PATCH] fix(ci): remove unnecessary software in RPC build to reduce disk usage (#4619) --- .github/workflows/forest.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/forest.yml b/.github/workflows/forest.yml index a4d47aacb1a8..1415713d4f6b 100644 --- a/.github/workflows/forest.yml +++ b/.github/workflows/forest.yml @@ -402,6 +402,24 @@ jobs: # We use a custom Dockerfile for CI to speed up the build process. FOREST_DOCKERFILE_OVERRIDE: scripts/devnet/forest_ci.dockerfile steps: + # Remove some unnecessary software to free up space. This should free up around 15-20 GB. + # This is required because of the limited space on the runner, + # and disk space-hungry snapshots used in the setup. + # This is taken from: + # https://github.com/easimon/maximize-build-space/blob/fc881a613ad2a34aca9c9624518214ebc21dfc0c/action.yml#L121-L136 + # Using the action directly is not feasible as it does some more modifications that break the setup in our case. + - name: Remove unnecessary software + run: | + echo "Disk space before cleanup" + df -h + sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/local/lib/android + sudo rm -rf /opt/ghc + sudo rm -rf /opt/hostedtoolcache/CodeQL + + echo "Disk space after cleanup" + df -h + - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 with: @@ -412,6 +430,12 @@ jobs: - name: Dump docker logs if: always() uses: jwalton/gh-docker-logs@v2 + - name: Dump Docker usage + if: always() + run: | + docker system df + docker system df --verbose + df -h bootstrap-checks-forest: needs: - build-ubuntu