diff --git a/.github/actions/maximize-build-space/action.yml b/.github/actions/maximize-build-space/action.yml new file mode 100644 index 0000000..21d4ad2 --- /dev/null +++ b/.github/actions/maximize-build-space/action.yml @@ -0,0 +1,30 @@ +name: "Maximize Build Space" +description: "Remove large artifacts to maximize available build space on GitHub Actions runners." +runs: + using: "composite" + steps: + - name: Clean + shell: bash + run: | + echo "Available storage before:" + sudo df -h + echo + + echo "Removing Removes .NET runtime and libraries..." + sudo rm -rf /usr/share/dotnet + + echo "Removing Android SDKs and Tools..." + sudo rm -rf /usr/local/lib/android + + echo "Removing GHC (Haskell) artifacts..." + sudo rm -rf /opt/ghc + + echo "Removing CodeQL Action Bundles..." + sudo rm -rf /opt/hostedtoolcache/CodeQL + + echo "Removing cached Docker images..." + sudo docker image prune --all --force + + echo "Available storage after:" + sudo df -h + echo diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c42e5d6..0ac9211 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,37 +31,12 @@ jobs: architecture: aarch64 steps: - - name: Clean - # Reserve some space on the / partition to install the needed org.gnome runtimes and their Debug extensions. - # This probably needs around 10-12GB, the rest of the free space on / then gets assigned to the build directory - # where we need the most space - run: | - echo "Available storage before:" - sudo df -h - echo - - echo "Removing Removes .NET runtime and libraries..." - sudo rm -rf /usr/share/dotnet - - echo "Removing Android SDKs and Tools..." - sudo rm -rf /usr/local/lib/android - - echo "Removing GHC (Haskell) artifacts..." - sudo rm -rf /opt/ghc - - echo "Removing CodeQL Action Bundles..." - sudo rm -rf /opt/hostedtoolcache/CodeQL - - echo "Removing cached Docker images..." - sudo docker image prune --all --force - - echo "Available storage after:" - sudo df -h - echo - - name: Checkout uses: actions/checkout@v4 + - name: Clean + uses: ./.github/actions/maximize-build-space + - name: Setup run: | sudo apt update diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 1909f9b..fbb5410 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -28,37 +28,12 @@ jobs: architecture: aarch64 steps: - - name: Clean - # Reserve some space on the / partition to install the needed org.gnome runtimes and their Debug extensions. - # This probably needs around 10-12GB, the rest of the free space on / then gets assigned to the build directory - # where we need the most space - run: | - echo "Available storage before:" - sudo df -h - echo - - echo "Removing Removes .NET runtime and libraries..." - sudo rm -rf /usr/share/dotnet - - echo "Removing Android SDKs and Tools..." - sudo rm -rf /usr/local/lib/android - - echo "Removing GHC (Haskell) artifacts..." - sudo rm -rf /opt/ghc - - echo "Removing CodeQL Action Bundles..." - sudo rm -rf /opt/hostedtoolcache/CodeQL - - echo "Removing cached Docker images..." - sudo docker image prune --all --force - - echo "Available storage after:" - sudo df -h - echo - - name: Checkout uses: actions/checkout@v4 + - name: Clean + uses: ./.github/actions/maximize-build-space + - name: Setup run: | sudo apt update diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4cddfca..3cf71c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,36 +31,11 @@ jobs: if: github.event.pull_request.merged == true && true == contains(join(github.event.pull_request.labels.*.name), 'Release') steps: - - name: Clean - # Reserve some space on the / partition to install the needed org.gnome runtimes and their Debug extensions. - # This probably needs around 10-12GB, the rest of the free space on / then gets assigned to the build directory - # where we need the most space - run: | - echo "Available storage before:" - sudo df -h - echo - - echo "Removing Removes .NET runtime and libraries..." - sudo rm -rf /usr/share/dotnet - - echo "Removing Android SDKs and Tools..." - sudo rm -rf /usr/local/lib/android - - echo "Removing GHC (Haskell) artifacts..." - sudo rm -rf /opt/ghc - - echo "Removing CodeQL Action Bundles..." - sudo rm -rf /opt/hostedtoolcache/CodeQL - - echo "Removing cached Docker images..." - sudo docker image prune --all --force - - echo "Available storage after:" - sudo df -h - echo - - name: Checkout uses: actions/checkout@v4 + + - name: Clean + uses: ./.github/actions/maximize-build-space - name: Setup run: |