Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions actions/environment-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
# ══════════════════════════════════════════════════════════════════════════
Expand Down
5 changes: 5 additions & 0 deletions actions/environment-setup/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
6 changes: 6 additions & 0 deletions actions/environment-setup/scripts/parse-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ------------------------------------------------------------------------------
Expand Down
Loading