From f1eb14d214f98ffb2e7b1fb0d08bc8f75d447f2a Mon Sep 17 00:00:00 2001 From: Satoshi Qazi Muhammed Date: Wed, 10 Jun 2026 14:59:11 -0700 Subject: [PATCH] fix(ci): free disk space before building debug androidTest APKs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The scheduled 'Run balances tests' workflow has been failing for weeks with 'No space left on device' — assembleDebug + assembleDebugAndroidTest for every module exceeds the ~14 GB free on GitHub-hosted runners. Add an opt-in free-disk-space input to the reusable build workflow that removes preinstalled toolchains we never use (dotnet, ghc, CodeQL, swift, boost, etc., ~30+ GB), and enable it for the balances test build. Other callers of the reusable workflow are unaffected. --- .github/workflows/android_build.yml | 15 +++++++++++++++ .github/workflows/balances_test.yml | 1 + 2 files changed, 16 insertions(+) diff --git a/.github/workflows/android_build.yml b/.github/workflows/android_build.yml index a276c0d..082540f 100644 --- a/.github/workflows/android_build.yml +++ b/.github/workflows/android_build.yml @@ -31,6 +31,10 @@ on: required: false type: boolean default: false + free-disk-space: + required: false + type: boolean + default: false secrets: # Crowdloan secrets - NOT NEEDED for Pezkuwi (own blockchain) ACALA_PROD_AUTH_TOKEN: @@ -140,6 +144,17 @@ jobs: runs-on: ubuntu-24.04 timeout-minutes: 90 steps: + - name: 🧹 Free disk space + if: ${{ inputs.free-disk-space }} + run: | + # The androidTest build of all modules fills the ~14 GB free on + # GitHub-hosted runners; drop preinstalled toolchains we never use. + sudo rm -rf /usr/share/dotnet /usr/share/swift /opt/ghc /usr/local/.ghcup \ + /opt/hostedtoolcache/CodeQL /usr/local/share/boost /usr/local/share/powershell \ + /usr/local/lib/node_modules /usr/local/julia* /opt/microsoft + sudo docker image prune -af > /dev/null 2>&1 || true + df -h / + - name: Checkout particular branch uses: actions/checkout@v4 with: diff --git a/.github/workflows/balances_test.yml b/.github/workflows/balances_test.yml index 40fecec..a1832c8 100644 --- a/.github/workflows/balances_test.yml +++ b/.github/workflows/balances_test.yml @@ -14,6 +14,7 @@ jobs: upload-name: develop-apk run-tests: false build-debug-tests: true + free-disk-space: true secrets: inherit run-tests: