Skip to content

Commit

Permalink
added more commands to free up disk space as suggested in https://git…
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemccabe committed Apr 23, 2024
1 parent 55e31f5 commit d2ac4cd
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/jobs/free_disk_space.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,41 @@ sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"

###
# more cleanup taken from https://github.com/apache/flink/blob/master/tools/azure-pipelines/free_disk_space.sh
###

echo "=============================================================================="
echo "Freeing up disk space on CI system"
echo "=============================================================================="

echo "Listing 100 largest packages"
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 100
df -h
echo "Removing large packages"
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 apt-get remove -y azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri
sudo apt-get autoremove -y
sudo apt-get clean
df -h
echo "Removing large directories"

sudo rm -rf /usr/share/dotnet/
sudo rm -rf /usr/local/graalvm/
sudo rm -rf /usr/local/.ghcup/
sudo rm -rf /usr/local/share/powershell
sudo rm -rf /usr/local/share/chromium
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/local/lib/node_modules

###
# end cleanup from azure script
###

printf "\nChecking disk usage after cleanup"

df -h
2 changes: 2 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Free disk space
run: .github/jobs/free_disk_space.sh
- name: Get METplus Image
run: .github/jobs/docker_setup.sh
env:
Expand Down

0 comments on commit d2ac4cd

Please sign in to comment.