diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a05118b..e94e69bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -196,22 +196,22 @@ jobs: echo "Initial free space" df -h / echo "Removing all pre-loaded docker images" - docker rmi $(docker image ls -aq) # Removes ~6GB + docker image ls -aq | xargs -r docker rmi # Removes ~3GB df -h / echo "Listing 100 largest packages" dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -rn | head -n 100 echo "Removing unneeded large packages" sudo apt update - sudo apt remove -y '^ghc-.*' '^dotnet-.*' azure-cli powershell google-chrome-stable firefox microsoft-edge-stable 'mongodb-*' 'mysql-*' 'mariadb-*' 'temurin-*' 'openjdk-*' default-jre-headless # Removes ~7GB # Adding 'google-cloud-*' removes another 750MB but takes about a minute; not worth it + sudo apt remove -y '^ghc-.*' '^dotnet-.*' azure-cli powershell google-chrome-stable firefox microsoft-edge-stable 'mongodb-*' 'mysql-*' 'mariadb-*' 'temurin-*' 'openjdk-*' default-jre-headless mono-devel libgl1-mesa-dri # Removes ~6GB sudo apt autoremove -y sudo apt clean df -h / - echo "Listing 100 largest remaining packages" - dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -rn | head -n 100 - echo "Removing remaining large directories" + echo "Removing Android" + sudo rm -rf /usr/local/lib/android # Removes ~9GB df -h / + echo "Removing remaining large directories" rm -rf /usr/share/dotnet/ # Removes ~1GB - rm -rf "$AGENT_TOOLSDIRECTORY" # Removes ~6GB + rm -rf "$AGENT_TOOLSDIRECTORY" # Removes ~7GB echo "Disk space after cleanup" df -h /