From f2cb3295dc5a424cdd5c1431e8f6697b822bc188 Mon Sep 17 00:00:00 2001 From: Malte Poll Date: Mon, 9 Oct 2023 10:21:24 +0200 Subject: [PATCH] ci: free up disk space on GitHub hosted runners --- .github/actions/setup_bazel/action.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/actions/setup_bazel/action.yml b/.github/actions/setup_bazel/action.yml index 9b6ee424d8..97b31aa68b 100644 --- a/.github/actions/setup_bazel/action.yml +++ b/.github/actions/setup_bazel/action.yml @@ -27,6 +27,31 @@ runs: fi echo "::endgroup::" + - name: Free up space (Ubuntu) + shell: bash + if: startsWith(runner.name, 'GitHub Actions') && runner.os == 'Linux' + run: | + echo "::group::Free up space (Ubuntu)" + echo "Available storage (before):" + df -h + + sudo apt-get remove -y '^dotnet-.*' + sudo apt-get remove -y '^llvm-.*' + sudo apt-get remove -y 'php.*' + sudo apt-get remove -y '^mongodb-.*' + sudo apt-get remove -y '^mysql-.*' + sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/local/lib/android + sudo rm -rf /opt/ghc + sudo rm -rf /opt/hostedtoolcache/CodeQL + sudo docker image prune --all --force + sudo apt-get autoremove -y + sudo apt-get clean + + echo "Available storage (after):" + df -h + echo "::endgroup::" + - name: Configure Bazel (general) shell: bash env: