File tree Expand file tree Collapse file tree
actions/maximize-build-space Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : " Maximize Build Space"
2+ description : " Remove large artifacts to maximize available build space on GitHub Actions runners."
3+ runs :
4+ using : " composite"
5+ steps :
6+ - name : Clean
7+ shell : bash
8+ run : |
9+ echo "Available storage before:"
10+ sudo df -h
11+ echo
12+
13+ echo "Removing Removes .NET runtime and libraries..."
14+ sudo rm -rf /usr/share/dotnet
15+
16+ echo "Removing Android SDKs and Tools..."
17+ sudo rm -rf /usr/local/lib/android
18+
19+ echo "Removing GHC (Haskell) artifacts..."
20+ sudo rm -rf /opt/ghc
21+
22+ echo "Removing CodeQL Action Bundles..."
23+ sudo rm -rf /opt/hostedtoolcache/CodeQL
24+
25+ echo "Removing cached Docker images..."
26+ sudo docker image prune --all --force
27+
28+ echo "Available storage after:"
29+ sudo df -h
30+ echo
Original file line number Diff line number Diff line change @@ -31,23 +31,12 @@ jobs:
3131 architecture : aarch64
3232
3333 steps :
34- - name : Clean
35- uses : easimon/maximize-build-space@v10
36- with :
37- # Reserve some space on the / partition to install the needed org.gnome runtimes and their Debug extensions.
38- # This probably needs around 10-12GB, the rest of the free space on / then gets assigned to the build directory
39- # where we need the most space
40- root-reserve-mb : 16000
41- swap-size-mb : 1024
42- remove-dotnet : ' true'
43- remove-android : ' true'
44- remove-haskell : ' true'
45- remove-codeql : ' true'
46- remove-docker-images : ' true'
47-
4834 - name : Checkout
4935 uses : actions/checkout@v4
5036
37+ - name : Clean
38+ uses : ./.github/actions/maximize-build-space
39+
5140 - name : Setup
5241 run : |
5342 sudo apt update
6150 DISPLAY : " 0:0"
6251 run : |
6352 meson setup build --cross-file="architectures/${{ matrix.configuration.architecture }}.crossfile"
64- 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
53+ 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
6554
6655 - name : Fix Permissions
6756 run : sudo chown -R runner:docker .
Original file line number Diff line number Diff line change @@ -28,23 +28,12 @@ jobs:
2828 architecture : aarch64
2929
3030 steps :
31- - name : Clean
32- uses : easimon/maximize-build-space@v10
33- with :
34- # Reserve some space on the / partition to install the needed org.gnome runtimes and their Debug extensions.
35- # This probably needs around 10-12GB, the rest of the free space on / then gets assigned to the build directory
36- # where we need the most space
37- root-reserve-mb : 16000
38- swap-size-mb : 1024
39- remove-dotnet : ' true'
40- remove-android : ' true'
41- remove-haskell : ' true'
42- remove-codeql : ' true'
43- remove-docker-images : ' true'
44-
4531 - name : Checkout
4632 uses : actions/checkout@v4
4733
34+ - name : Clean
35+ uses : ./.github/actions/maximize-build-space
36+
4837 - name : Setup
4938 run : |
5039 sudo apt update
6352 DISPLAY : " 0:0"
6453 run : |
6554 meson setup build -Dbranch=daily --cross-file="architectures/${{ matrix.configuration.architecture }}.crossfile"
66- 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
55+ 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
6756
6857 - name : Fix Permissions
6958 run : sudo chown -R runner:docker .
Original file line number Diff line number Diff line change @@ -31,22 +31,11 @@ jobs:
3131 if : github.event.pull_request.merged == true && true == contains(join(github.event.pull_request.labels.*.name), 'Release')
3232
3333 steps :
34- - name : Clean
35- uses : easimon/maximize-build-space@v10
36- with :
37- # Reserve some space on the / partition to install the needed org.gnome runtimes and their Debug extensions.
38- # This probably needs around 10-12GB, the rest of the free space on / then gets assigned to the build directory
39- # where we need the most space
40- root-reserve-mb : 16000
41- swap-size-mb : 1024
42- remove-dotnet : ' true'
43- remove-android : ' true'
44- remove-haskell : ' true'
45- remove-codeql : ' true'
46- remove-docker-images : ' true'
47-
4834 - name : Checkout
4935 uses : actions/checkout@v4
36+
37+ - name : Clean
38+ uses : ./.github/actions/maximize-build-space
5039
5140 - name : Setup
5241 run : |
6655 DISPLAY : " 0:0"
6756 run : |
6857 meson setup build -Dbranch=${RUNTIME_VERSION} --cross-file="architectures/${{ matrix.configuration.architecture }}.crossfile"
69- 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
58+ 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
7059
7160 - name : Fix Permissions
7261 run : sudo chown -R runner:docker .
You can’t perform that action at this time.
0 commit comments