diff --git a/actions/environment-setup/action.yml b/actions/environment-setup/action.yml index 834fecf..d3f3065 100644 --- a/actions/environment-setup/action.yml +++ b/actions/environment-setup/action.yml @@ -185,6 +185,27 @@ runs: CONFIG_FILE: ${{ inputs.config }} run: ${{ github.action_path }}/scripts/parse-config.sh "$CONFIG_FILE" + # ══════════════════════════════════════════════════════════════════════════ + # 🧹 FREE DISK SPACE (optional, Linux only) + # ══════════════════════════════════════════════════════════════════════════ + # Runs before any heavy install/compile steps so they see a fresh ~10–14 GB. + # GitHub-hosted ubuntu runners pre-install Android SDK, .NET, Haskell, large + # Docker images, etc. — none of which we need for a typical Rust/Nx build. + # Gated on `free_disk_space: true` in .environment.yml so the action remains + # opt-in (the cleanup takes ~30–60s and isn't needed for small workloads). + + - name: Free disk space + if: steps.config.outputs.free_disk_space == 'true' && runner.os == 'Linux' + uses: jlumbroso/free-disk-space@v1.3.1 + with: + tool-cache: false # keep actions/cache, Node, Python, Go pre-installs + android: true + dotnet: true + haskell: true + large-packages: false # slow and we don't need most of it gone + swap-storage: false # keep swap — Rust linker still benefits + docker-images: true + # ══════════════════════════════════════════════════════════════════════════ # ✅ VALIDATE CI ENV VARS (cargo-critical) # ══════════════════════════════════════════════════════════════════════════ diff --git a/actions/environment-setup/schema.json b/actions/environment-setup/schema.json index 7f6f195..965e961 100644 --- a/actions/environment-setup/schema.json +++ b/actions/environment-setup/schema.json @@ -173,6 +173,11 @@ ] }, + "free_disk_space": { + "type": "boolean", + "description": "Free ~10–14 GB by purging pre-installed runner images content (Android SDK, .NET, Haskell, Docker images we won't use, etc.) via jlumbroso/free-disk-space. Runs first in the setup flow before any other step. Linux runners only." + }, + "services": { "type": "object", "description": "External daemons installed onto the runner's PATH so tests can spawn them as subprocesses (via Command::new(\"redis-server\") etc.). Each key toggles a specific service binary. Linux runners only for now.", diff --git a/actions/environment-setup/scripts/parse-config.sh b/actions/environment-setup/scripts/parse-config.sh index 9f156ec..cd3e1f3 100755 --- a/actions/environment-setup/scripts/parse-config.sh +++ b/actions/environment-setup/scripts/parse-config.sh @@ -96,6 +96,12 @@ fi out "has_config=true" echo "📖 Parsing $CONFIG_FILE..." +# ------------------------------------------------------------------------------ +# Top-level knob: free disk space +# ------------------------------------------------------------------------------ +FREE_DISK=$(yq_get '.free_disk_space' "false") +out "free_disk_space=$FREE_DISK" + # ------------------------------------------------------------------------------ # Node.js # ------------------------------------------------------------------------------