Skip to content

ci: free disk space on Linux E2E runners before building Electron apps#305

Merged
goosewobbler merged 2 commits into
mainfrom
ci/free-disk-space-linux
May 30, 2026
Merged

ci: free disk space on Linux E2E runners before building Electron apps#305
goosewobbler merged 2 commits into
mainfrom
ci/free-disk-space-linux

Conversation

@goosewobbler
Copy link
Copy Markdown
Contributor

The flake

E2E - Electron [Linux] - script has intermittently failed because the GitHub-hosted Linux runner runs out of disk space mid-test. The runner's own worker crashes with System.IO.IOException: No space left on device, so the test step never finishes and the job log blob is never uploaded — the failure surfaces as an opaque dead job rather than a test error.

Observed on #298 and #301.

The fix

Add an early Linux-only "Free Disk Space" step to the E2E reusable workflow, placed after the build filter is generated and before "Build Test Applications", so the build/test phase has headroom.

  • Dependency-free: plain shell, no third-party action (e.g. no jlumbroso/free-disk-space) — zero new supply-chain surface, nothing for dependabot to track.
  • Gated to Linux via if: runner.os == 'Linux'.
  • Prints df -h / before and after, then sudo rm -rf large preinstalled toolchains unused by these Electron/web tests (.NET, Android SDK, GHC/ghcup, CodeQL, Swift) and prunes Docker images.
  • Non-fatal: every removal is guarded with || true, so a missing path or prune failure can never fail the job.

Scope

Only .github/workflows/_ci-e2e.reusable.yml is touched — the observed crashes were E2E-only. The same step could be lifted into the package/build workflows later if disk pressure shows up there.

Validation

Locally validated as parseable YAML and passes actionlint. CI will exercise the step on the next Linux E2E run.

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

Release Preview — no release

No bump label detected.
Reason: No release labels found (need bump:* or channel:stable)
Note: Add bump:patch, bump:minor, or bump:major to trigger a release.


Updated automatically by ReleaseKit

@goosewobbler goosewobbler marked this pull request as ready for review May 29, 2026 00:12
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 29, 2026

Greptile Summary

Adds a Linux-only disk cleanup step to the E2E reusable workflow to prevent the intermittent "No space left on device" runner crashes seen on #298 and #301. The step is placed immediately after checkout — before pnpm install and artifact download — so every subsequent step benefits from the freed space.

  • Removes large, unused pre-installed toolchains (.NET, Android SDK, GHC/ghcup, CodeQL, Swift) and prunes Docker images using plain shell; no third-party action required.
  • Every removal is guarded with || true and the step is gated to runner.os == 'Linux', so it cannot fail the job or affect macOS/Windows runs.

Confidence Score: 5/5

This is a safe, additive-only change to a CI workflow that cannot regress existing build or test logic.

The change adds a single, well-guarded shell step that removes well-known unused toolchain directories on GitHub-hosted Linux runners. The || true on every removal and the if: runner.os == 'Linux' gate mean it is impossible for this step to fail the job or affect macOS/Windows runs. The paths targeted are the standard set documented and used across the GitHub Actions community for disk reclamation. Placement immediately after checkout ensures maximum benefit.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/_ci-e2e.reusable.yml Adds a Linux-only "Free Disk Space" step immediately after checkout that removes unused toolchains (.NET, Android, GHC, CodeQL, Swift) and prunes Docker images; all removals guarded with `

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[👷 Checkout Repository] --> B{runner.os == 'Linux'?}
    B -- Yes --> C[🧹 Free Disk Space\nsudo rm -rf dotnet/android/ghc/CodeQL/swift\ndocker image prune]
    B -- No --> D[🛠️ Setup Development Environment]
    C --> D
    D --> E[📦 Download Build Artifacts]
    E --> F[📊 Show Build Information]
    F --> G[🔒 Validate Build Command]
    G --> H[🪄 Generate Build Filter]
    H --> I[🏗️ Build Test Applications]
    I --> J[🔗 Setup Protocol Handlers]
    J --> K[🪄 Generate Test Execution Plan]
    K --> L[🧪 Execute E2E Tests]
    L --> M{Success?}
    M -- Failure --> N[🐛 Show Logs on Failure]
    M -- Always --> O[📦 Upload Test Logs]
    N --> O
    O --> P[🐛 Debug Build on Failure]
Loading

Reviews (3): Last reviewed commit: "ci: run the Linux free-disk step right a..." | Re-trigger Greptile

Comment thread .github/workflows/_ci-e2e.reusable.yml Outdated
goosewobbler and others added 2 commits May 30, 2026 02:00
Electron Linux E2E runs intermittently crashed with "No space left on
device" (#298/#301). The runner worker died mid-test before the job log
blob could upload, so the failures surfaced as opaque timeouts.

Add an early Linux-only "Free Disk Space" step (after the build filter is
generated, before "Build Test Applications") that removes large unused
preinstalled toolchains (.NET, Android, GHC/ghcup, CodeQL, Swift) and
prunes Docker images. It is dependency-free plain shell — no third-party
action — and every removal is guarded with `|| true` so it can never fail
the job. df -h is printed before and after for observability.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Addresses Greptile review: the cleanup previously ran after Setup Development Environment (pnpm install) and Download Build Artifacts, which can consume gigabytes before space is reclaimed. Moving it to immediately after checkout gives every subsequent step the freed headroom.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@goosewobbler goosewobbler force-pushed the ci/free-disk-space-linux branch from b7256d6 to 8bb0c88 Compare May 30, 2026 01:01
@goosewobbler goosewobbler merged commit a22b608 into main May 30, 2026
99 of 103 checks passed
goosewobbler added a commit that referenced this pull request May 30, 2026
…307)

Bounds session teardown with a timeout and swallows benign teardown errors (libuv UV_HANDLE_CLOSING / 0xC0000409 crashes, CDP teardown hangs) via shared @wdio/native-utils helpers, applied to the electron and dioxus worker services.

Validated post-rebase onto #305/#306: Package-Electron 9/9 green. The two Windows E2E reds in the merge run are confirmed intermittent flakes (Dioxus Windows standalone was green 4x on this branch + green on main; Electron Windows forge alternates), not regressions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
goosewobbler added a commit that referenced this pull request May 30, 2026
The Electron E2E build/install footprint can fill the Linux runner disk by job
end. Tests and log upload still succeed, but the job's post-actions then fail
writing to a full disk ("the disk was full" on event.json), marking an
otherwise-passing job red. Add a final always()-guarded Linux step that
reclaims that footprint (electron caches, pnpm store, node_modules, build
output dirs) after the failure-debug steps, with df probes for visibility.

Follow-up to #305.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
goosewobbler added a commit that referenced this pull request May 30, 2026
GitHub runners vary in starting free space, so the Electron E2E job can hit
ENOSPC either during the test (crashing the runner Worker) or at teardown
(failing the post-actions on an otherwise-green job). Two layers on top of the
existing free-disk step:

- Free more preinstalled, unused toolchains upfront (jvm, powershell, boost,
  graalvm, Ruby/go/PyPy tool-caches, apt cache) for headroom during the run.
- A final always() step that reclaims the build/install footprint (electron
  caches, pnpm store, node_modules, build output dirs) before teardown.

df probes bracket both for visibility.

Follow-up to #305.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
goosewobbler added a commit that referenced this pull request May 30, 2026
Two layers on top of #305's free-disk step: free more unused preinstalled toolchains upfront (jvm, powershell, boost, graalvm, Ruby/go/PyPy tool-caches, apt cache; Node+Python kept), and a final always() step that reclaims the build/install footprint before teardown. Validated: both Linux E2E script jobs green (the prior during-test ENOSPC is gone); the lone red is an unrelated Windows pnpm-setup flake on a Linux-only change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant