fix(ci): ensure apt cache is saved for Playwright system deps#222
Closed
steilerDev wants to merge 6 commits into
Closed
fix(ci): ensure apt cache is saved for Playwright system deps#222steilerDev wants to merge 6 commits into
steilerDev wants to merge 6 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Keep-Downloaded-Packages "true"so.debfiles persist after installactions/cache@v4into explicitactions/cache/restore@v4+actions/cache/save@v4so archives are captured immediately after install (not in a post-job step where they may already be cleaned)e2e-smokeand shardede2ejobsFollow-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
Save apt cachestep runs and uploadsapt-playwright-*entry appears ingh cache listSave apt cachestep is skipped → install-deps runs faster🤖 Generated with Claude Code