From 3a856394f2ad696d8b0ce02e0007fca25a3b2a21 Mon Sep 17 00:00:00 2001 From: Jorge Martin Espinosa Date: Wed, 18 Feb 2026 22:55:50 +0100 Subject: [PATCH] Add free disk space action to CI actions (#6212) * Add free disk space action * Remove 'upload APK for Maestro' step since it's no longer used * Re-enable tool-cache removal * Add the free disk space step to other gradle-related jobs * Use commit SHA * Disable removing `large-packages` --- .github/workflows/build.yml | 24 ++++++++++++--------- .github/workflows/build_enterprise.yml | 14 +++++++++++++ .github/workflows/maestro-local.yml | 14 +++++++++++++ .github/workflows/nightly.yml | 14 +++++++++++++ .github/workflows/nightlyReports.yml | 14 +++++++++++++ .github/workflows/quality.yml | 14 +++++++++++++ .github/workflows/recordScreenshots.yml | 14 +++++++++++++ .github/workflows/release.yml | 28 +++++++++++++++++++++++++ .github/workflows/sonar.yml | 14 +++++++++++++ .github/workflows/tests.yml | 14 +++++++++++++ 10 files changed, 154 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aa62b83e36..eb9ee609cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,20 @@ jobs: group: ${{ github.ref == 'refs/heads/develop' && format('build-develop-{0}-{1}', matrix.variant, github.sha) || format('build-{0}-{1}', matrix.variant, github.ref) }} cancel-in-progress: true steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be + with: + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + tool-cache: true + # All of these default to true, but we should only need the 'android' one (and maybe swap-storage?) + android: false + dotnet: true + haskell: true + # This takes way too long to run (~2 minutes) and it saves only ~5.5GB + large-packages: false + docker-images: true + swap-storage: false + - uses: actions/checkout@v6 with: # Ensure we are building the branch and not the branch after being merged on develop @@ -60,16 +74,6 @@ jobs: path: | app/build/outputs/apk/gplay/debug/*-universal-debug.apk app/build/outputs/apk/fdroid/debug/*-universal-debug.apk - - name: Upload x86_64 APK for Maestro - if: ${{ matrix.variant == 'debug' }} - uses: actions/upload-artifact@v6 - with: - name: elementx-apk-maestro - path: | - app/build/outputs/apk/gplay/debug/app-gplay-x86_64-debug.apk - retention-days: 5 - overwrite: true - if-no-files-found: error - uses: rnkdsh/action-upload-diawi@4e1421305be7cfc510d05f47850262eeaf345108 # v1.5.12 id: diawi # Do not fail the whole build if Diawi upload fails diff --git a/.github/workflows/build_enterprise.yml b/.github/workflows/build_enterprise.yml index 1d416ffe42..9968a54592 100644 --- a/.github/workflows/build_enterprise.yml +++ b/.github/workflows/build_enterprise.yml @@ -27,6 +27,20 @@ jobs: group: ${{ github.ref == 'refs/heads/develop' && format('build-develop-enterprise-{0}-{1}', matrix.variant, github.sha) || format('build-enterprise-{0}-{1}', matrix.variant, github.ref) }} cancel-in-progress: true steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be + with: + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + tool-cache: true + # All of these default to true, but we should only need the 'android' one (and maybe swap-storage?) + android: false + dotnet: true + haskell: true + # This takes way too long to run (~2 minutes) and it saves only ~5.5GB + large-packages: false + docker-images: true + swap-storage: false + - uses: actions/checkout@v6 with: # Ensure we are building the branch and not the branch after being merged on develop diff --git a/.github/workflows/maestro-local.yml b/.github/workflows/maestro-local.yml index a2851eb863..ac85c66ed1 100644 --- a/.github/workflows/maestro-local.yml +++ b/.github/workflows/maestro-local.yml @@ -22,6 +22,20 @@ jobs: group: ${{ format('maestro-build-{0}', github.ref) }} cancel-in-progress: true steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be + with: + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + tool-cache: true + # All of these default to true, but we should only need the 'android' one (and maybe swap-storage?) + android: false + dotnet: true + haskell: true + # This takes way too long to run (~2 minutes) and it saves only ~5.5GB + large-packages: false + docker-images: true + swap-storage: false + - uses: actions/checkout@v6 with: # Ensure we are building the branch and not the branch after being merged on develop diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0ea049b2f0..933301cc49 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -16,6 +16,20 @@ jobs: runs-on: ubuntu-latest if: ${{ github.repository == 'element-hq/element-x-android' }} steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be + with: + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + tool-cache: true + # All of these default to true, but we should only need the 'android' one (and maybe swap-storage?) + android: false + dotnet: true + haskell: true + # This takes way too long to run (~2 minutes) and it saves only ~5.5GB + large-packages: false + docker-images: true + swap-storage: false + - uses: actions/checkout@v6 - name: Use JDK 21 uses: actions/setup-java@v5 diff --git a/.github/workflows/nightlyReports.yml b/.github/workflows/nightlyReports.yml index b7119c7036..bf6322ff2b 100644 --- a/.github/workflows/nightlyReports.yml +++ b/.github/workflows/nightlyReports.yml @@ -17,6 +17,20 @@ jobs: runs-on: ubuntu-latest if: ${{ github.repository == 'element-hq/element-x-android' }} steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be + with: + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + tool-cache: true + # All of these default to true, but we should only need the 'android' one (and maybe swap-storage?) + android: false + dotnet: true + haskell: true + # This takes way too long to run (~2 minutes) and it saves only ~5.5GB + large-packages: false + docker-images: true + swap-storage: false + - name: ⏬ Checkout with LFS uses: nschloe/action-cached-lfs-checkout@f46300cd8952454b9f0a21a3d133d4bd5684cfc2 # v1.2.3 diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 2084c7648a..33d2eac94b 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -17,6 +17,20 @@ jobs: name: Search for forbidden patterns runs-on: ubuntu-latest steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be + with: + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + tool-cache: true + # All of these default to true, but we should only need the 'android' one (and maybe swap-storage?) + android: false + dotnet: true + haskell: true + # This takes way too long to run (~2 minutes) and it saves only ~5.5GB + large-packages: false + docker-images: true + swap-storage: false + - uses: actions/checkout@v6 - name: Add SSH private keys for submodule repositories uses: webfactory/ssh-agent@a6f90b1f127823b31d4d4a8d96047790581349bd # v0.9.1 diff --git a/.github/workflows/recordScreenshots.yml b/.github/workflows/recordScreenshots.yml index bbcbef04d8..5ac4a2f350 100644 --- a/.github/workflows/recordScreenshots.yml +++ b/.github/workflows/recordScreenshots.yml @@ -17,6 +17,20 @@ jobs: if: github.event_name == 'workflow_dispatch' || github.event.label.name == 'Record-Screenshots' steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be + with: + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + tool-cache: true + # All of these default to true, but we should only need the 'android' one (and maybe swap-storage?) + android: false + dotnet: true + haskell: true + # This takes way too long to run (~2 minutes) and it saves only ~5.5GB + large-packages: false + docker-images: true + swap-storage: false + - name: Remove Record-Screenshots label if: github.event.label.name == 'Record-Screenshots' uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 439b97ba8c..fac72d4f7c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,20 @@ jobs: group: ${{ format('build-release-main-gplay-{0}', github.sha) }} cancel-in-progress: true steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be + with: + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + tool-cache: true + # All of these default to true, but we should only need the 'android' one (and maybe swap-storage?) + android: false + dotnet: true + haskell: true + # This takes way too long to run (~2 minutes) and it saves only ~5.5GB + large-packages: false + docker-images: true + swap-storage: false + - uses: actions/checkout@v6 - name: Use JDK 21 uses: actions/setup-java@v5 @@ -88,6 +102,20 @@ jobs: group: ${{ format('build-release-main-fdroid-{0}', github.sha) }} cancel-in-progress: true steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be + with: + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + tool-cache: true + # All of these default to true, but we should only need the 'android' one (and maybe swap-storage?) + android: false + dotnet: true + haskell: true + # This takes way too long to run (~2 minutes) and it saves only ~5.5GB + large-packages: false + docker-images: true + swap-storage: false + - uses: actions/checkout@v6 - name: Use JDK 21 uses: actions/setup-java@v5 diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index c289102116..1b8b6b61a5 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -22,6 +22,20 @@ jobs: group: ${{ format('sonar-{0}', github.ref) }} cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }} steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be + with: + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + tool-cache: true + # All of these default to true, but we should only need the 'android' one (and maybe swap-storage?) + android: false + dotnet: true + haskell: true + # This takes way too long to run (~2 minutes) and it saves only ~5.5GB + large-packages: false + docker-images: true + swap-storage: false + - uses: actions/checkout@v6 with: # Ensure we are building the branch and not the branch after being merged on develop diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index aa11a433f4..12b2fa17f2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,6 +22,20 @@ jobs: group: ${{ github.ref == 'refs/heads/main' && format('unit-tests-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('unit-tests-develop-{0}', github.sha) || format('unit-tests-{0}', github.ref) }} cancel-in-progress: true steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be + with: + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + tool-cache: true + # All of these default to true, but we should only need the 'android' one (and maybe swap-storage?) + android: false + dotnet: true + haskell: true + # This takes way too long to run (~2 minutes) and it saves only ~5.5GB + large-packages: false + docker-images: true + swap-storage: false + # Increase swapfile size to prevent screenshot tests getting terminated # https://github.com/actions/runner-images/discussions/7188#discussioncomment-6750749 - name: 💽 Increase swapfile size