Skip to content

fix(ci): ensure apt cache is saved for Playwright system deps#222

Closed
steilerDev wants to merge 6 commits into
betafrom
ci/e2e-parallel-sharding
Closed

fix(ci): ensure apt cache is saved for Playwright system deps#222
steilerDev wants to merge 6 commits into
betafrom
ci/e2e-parallel-sharding

Conversation

@steilerDev
Copy link
Copy Markdown
Owner

Summary

  • Fix apt cache not being saved: set Keep-Downloaded-Packages "true" so .deb files persist after install
  • Split actions/cache@v4 into explicit actions/cache/restore@v4 + actions/cache/save@v4 so archives are captured immediately after install (not in a post-job step where they may already be cleaned)
  • Only saves on cache miss to avoid redundant uploads
  • Applies to both e2e-smoke and sharded e2e jobs

Follow-up to #218 which added the cache step but archives were being cleaned by apt before the implicit post-job save could capture them.

Test plan

  • First CI run: cache miss → packages downloaded → Save apt cache step runs and uploads
  • Verify apt-playwright-* entry appears in gh cache list
  • Subsequent CI run: cache hit → Save apt cache step is skipped → install-deps runs faster
  • All E2E jobs still pass

🤖 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>
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>
Ubuntu runners have apt configured to clean downloaded .deb files
after install. Set `Keep-Downloaded-Packages "true"` before the
cache restore step so archives persist for actions/cache to save.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
actions/cache@v4 saves implicitly in a post-job step, but by then
apt may have cleaned the archives. Split into cache/restore before
install and cache/save immediately after, so .deb files are captured
while they still exist. Only saves on cache miss.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@steilerDev steilerDev closed this Feb 23, 2026
@steilerDev steilerDev deleted the ci/e2e-parallel-sharding branch March 7, 2026 07:44
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