diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 101ea138..e7969434 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -12,6 +12,9 @@ inputs: runs: using: 'composite' steps: + - name: Free up disk space + shell: bash + run: ${{ github.action_path }}/free_disk_space.sh - shell: bash run: | echo $HOME diff --git a/.github/actions/setup/free_disk_space.sh b/.github/actions/setup/free_disk_space.sh new file mode 100755 index 00000000..15524194 --- /dev/null +++ b/.github/actions/setup/free_disk_space.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Script to free up disk space on CI systems +# Source: https://github.com/apache/flink/blob/02d30ace69dc18555a5085eccf70ee884e73a16e/tools/azure-pipelines/free_disk_space.sh + +echo "Freeing up disk space on CI system" + +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 '^ghc-8.*' +sudo apt-get remove -y '^dotnet-.*' +sudo apt-get remove -y '^llvm-.*' +sudo apt-get remove -y 'php.*' +sudo apt-get remove -y azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel +sudo apt-get autoremove -y +sudo apt-get clean +df -h + +echo "Removing large directories" +rm -rf /usr/share/dotnet/ +df -h \ No newline at end of file