Skip to content

Commit 35f85a0

Browse files
greclaude
andcommitted
ci(android): free disk space before Android APK build
The build-android job intermittently fails with "No space left on device" during `gradlew assembleDebug` (RN new arch is disk-heavy and the ubuntu runner ships only ~14 GB free). Add a cleanup step right after checkout that removes large preinstalled toolchains we don't use (.NET, Haskell/GHC, CodeQL, boost, etc.), prunes docker images, and drops swap — reclaiming ~20+ GB. It runs before the Node/Java setup steps so their tool caches are untouched, and leaves the Android SDK/NDK in place. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent ee6cfda commit 35f85a0

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,25 @@ jobs:
5252
- name: Checkout code
5353
uses: actions/checkout@v4
5454

55+
# The Android assembleDebug build (RN new arch) exhausts the runner's
56+
# ~14 GB of free disk. Reclaim space by removing large preinstalled
57+
# toolchains we don't use, while keeping the Android SDK/NDK. Runs
58+
# before Node/Java setup so their tool caches are untouched.
59+
- name: Free up disk space
60+
run: |
61+
echo "Disk before cleanup:"; df -h /
62+
sudo rm -rf /usr/share/dotnet \
63+
/opt/ghc /usr/local/.ghcup \
64+
/opt/hostedtoolcache/CodeQL \
65+
/usr/local/share/boost \
66+
/usr/local/share/powershell \
67+
/usr/local/lib/node_modules || true
68+
sudo docker image prune --all --force || true
69+
sudo swapoff -a || true
70+
sudo rm -f /mnt/swapfile || true
71+
sudo apt-get clean || true
72+
echo "Disk after cleanup:"; df -h /
73+
5574
- name: Setup Node.js
5675
uses: actions/setup-node@v4
5776
with:

0 commit comments

Comments
 (0)