Skip to content

ci(e2e): cache Playwright browser binaries across CI runs#218

Merged
steilerDev merged 4 commits into
betafrom
ci/e2e-parallel-sharding
Feb 23, 2026
Merged

ci(e2e): cache Playwright browser binaries across CI runs#218
steilerDev merged 4 commits into
betafrom
ci/e2e-parallel-sharding

Conversation

@steilerDev
Copy link
Copy Markdown
Owner

Summary

  • Cache ~/.cache/ms-playwright browser binaries using actions/cache@v4 in both e2e-smoke and e2e (sharded) jobs
  • Cache key: playwright-<version>-<os> — shared across all E2E jobs so whichever runs first warms the cache
  • On cache hit, browser binary downloads (~1GB for Chromium + WebKit) are skipped entirely
  • System dependencies (install-deps) always run since apt packages don't persist on ephemeral runners
  • No restore-keys fallback — Playwright errors on version mismatch, so partial hits would be harmful

Expected improvement

Step Before After (cache hit)
Browser install (smoke) 120-180s ~10-20s (system deps only)
Browser install (shard) 180-300s ~10-20s (system deps only)

Test plan

  • First CI run: cache miss → browsers downloaded → cache saved (check logs for "Cache not found")
  • Subsequent push: cache hit → browser download skipped → only install-deps runs (check logs for "Cache restored")
  • Smoke and shards share cache (same key)

🤖 Generated with Claude Code

Cache ~/.cache/ms-playwright using actions/cache keyed on the
Playwright version and runner OS. On cache hit, browser binary
downloads (~1GB) are skipped entirely — only system dependencies
(apt packages) are installed since they don't persist on ephemeral
runners. Both e2e-smoke and sharded e2e jobs share the same cache
key so whichever runs first warms the cache for the others.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@steilerDev steilerDev force-pushed the ci/e2e-parallel-sharding branch from acdc6eb to 32dba92 Compare February 23, 2026 16:29
PRs targeting main are epic promotions (beta → main) which get
proper releases via semantic-release in release.yml on merge.
Publishing a pr-<number> image for these is redundant and confusing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tem deps

Cache /var/cache/apt/archives so Playwright's install-deps reuses
locally stored .deb files instead of re-downloading ~60 packages on
every E2E job. Also enable dpkg force-unsafe-io to skip fsync on
ephemeral CI runners. Applies to both e2e-smoke and sharded e2e jobs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
`npx playwright --version` outputs "Version 1.58.2" (with a space),
which would produce invalid cache keys. Pipe through `tr -d '[:space:]'`
to produce a clean key like "Version1.58.2".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@steilerDev steilerDev merged commit 25bf649 into beta Feb 23, 2026
8 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.9.0-beta.58 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

steilerDev pushed a commit that referenced this pull request Feb 23, 2026
Two fixes for the apt caching added in #218:

1. Set `Keep-Downloaded-Packages "true"` so apt retains .deb files
   after install (Ubuntu runners clean them by default)
2. Use explicit cache/restore + cache/save instead of actions/cache
   so archives are captured immediately after install, not in a
   post-job step where they may already be cleaned

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
steilerDev added a commit that referenced this pull request Feb 23, 2026
Two fixes for the apt caching added in #218:

1. Set `Keep-Downloaded-Packages "true"` so apt retains .deb files
   after install (Ubuntu runners clean them by default)
2. Use explicit cache/restore + cache/save instead of actions/cache
   so archives are captured immediately after install, not in a
   post-job step where they may already be cleaned

Co-authored-by: Claude product-architect (Opus 4.6) <noreply@anthropic.com>
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.

2 participants