Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: free up disk space on GitHub hosted runners #2419

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/actions/setup_bazel/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down