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 0d18cd8..0ac9211 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,23 +31,12 @@ jobs: architecture: aarch64 steps: - - name: Clean - uses: easimon/maximize-build-space@v10 - with: - # 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 - root-reserve-mb: 16000 - swap-size-mb: 1024 - remove-dotnet: 'true' - remove-android: 'true' - remove-haskell: 'true' - remove-codeql: 'true' - remove-docker-images: 'true' - - name: Checkout uses: actions/checkout@v4 + - name: Clean + uses: ./.github/actions/maximize-build-space + - name: Setup run: | sudo apt update @@ -61,7 +50,7 @@ jobs: DISPLAY: "0:0" run: | meson setup build --cross-file="architectures/${{ matrix.configuration.architecture }}.crossfile" - sudo xvfb-run --auto-servernum flatpak-builder --arch=${{ matrix.configuration.architecture }} --disable-rofiles-fuse --keep-build-dirs --install-deps-from=flathub --ccache --repo=elementary builddir ./build/io.elementary.Sdk.json + sudo xvfb-run --auto-servernum flatpak-builder --arch=${{ matrix.configuration.architecture }} --disable-rofiles-fuse --keep-build-dirs --install-deps-from=flathub --ccache --repo=elementary /mnt/builddir --state-dir=/mnt/.flatpak-builder ./build/io.elementary.Sdk.json - name: Fix Permissions run: sudo chown -R runner:docker . diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 22a779f..fbb5410 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -28,23 +28,12 @@ jobs: architecture: aarch64 steps: - - name: Clean - uses: easimon/maximize-build-space@v10 - with: - # 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 - root-reserve-mb: 16000 - swap-size-mb: 1024 - remove-dotnet: 'true' - remove-android: 'true' - remove-haskell: 'true' - remove-codeql: 'true' - remove-docker-images: 'true' - - name: Checkout uses: actions/checkout@v4 + - name: Clean + uses: ./.github/actions/maximize-build-space + - name: Setup run: | sudo apt update @@ -63,7 +52,7 @@ jobs: DISPLAY: "0:0" run: | meson setup build -Dbranch=daily --cross-file="architectures/${{ matrix.configuration.architecture }}.crossfile" - sudo xvfb-run --auto-servernum flatpak-builder --arch=${{ matrix.configuration.architecture }} --default-branch=daily --disable-rofiles-fuse --keep-build-dirs --install-deps-from=flathub --ccache --repo=elementary builddir ./build/io.elementary.Sdk.json + sudo xvfb-run --auto-servernum flatpak-builder --arch=${{ matrix.configuration.architecture }} --default-branch=daily --disable-rofiles-fuse --keep-build-dirs --install-deps-from=flathub --ccache --repo=elementary /mnt/builddir --state-dir=/mnt/.flatpak-builder ./build/io.elementary.Sdk.json - name: Fix Permissions run: sudo chown -R runner:docker . diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5c3dccc..3cf71c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,22 +31,11 @@ jobs: if: github.event.pull_request.merged == true && true == contains(join(github.event.pull_request.labels.*.name), 'Release') steps: - - name: Clean - uses: easimon/maximize-build-space@v10 - with: - # 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 - root-reserve-mb: 16000 - swap-size-mb: 1024 - remove-dotnet: 'true' - remove-android: 'true' - remove-haskell: 'true' - remove-codeql: 'true' - remove-docker-images: 'true' - - name: Checkout uses: actions/checkout@v4 + + - name: Clean + uses: ./.github/actions/maximize-build-space - name: Setup run: | @@ -66,7 +55,7 @@ jobs: DISPLAY: "0:0" run: | meson setup build -Dbranch=${RUNTIME_VERSION} --cross-file="architectures/${{ matrix.configuration.architecture }}.crossfile" - sudo xvfb-run --auto-servernum flatpak-builder --arch=${{ matrix.configuration.architecture }} --default-branch="${RUNTIME_VERSION}" --disable-rofiles-fuse --keep-build-dirs --install-deps-from=flathub --ccache --repo=elementary builddir ./build/io.elementary.Sdk.json + sudo xvfb-run --auto-servernum flatpak-builder --arch=${{ matrix.configuration.architecture }} --default-branch="${RUNTIME_VERSION}" --disable-rofiles-fuse --keep-build-dirs --install-deps-from=flathub --ccache --repo=elementary /mnt/builddir --state-dir=/mnt/.flatpak-builder ./build/io.elementary.Sdk.json - name: Fix Permissions run: sudo chown -R runner:docker .