perf(ci): cache Playwright browsers in integration tests - #7286
Draft
maverbiest wants to merge 1 commit into
Draft
perf(ci): cache Playwright browsers in integration tests#7286maverbiest wants to merge 1 commit into
maverbiest wants to merge 1 commit into
Conversation
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.
🤖 Generated with Claude Code
What
Caches
~/.cache/ms-playwrightin the integration-tests workflow so the Playwright browser binaries aren't re-downloaded on every run.Why this key
The cache key is
${{ runner.os }}-playwright-<browser>-<playwright version>, and both variables are load-bearing:chromium firefox, while the chromium and cli jobs install chromium only. Sharing one key wouldlet a chromium-only cache restore into the firefox job and leave firefox missing.
chromium-headless-shell v1234andfirefox v1538), so that's the granularity that actually matters.integration-tests/package-lock.jsonchanged 25 times in the last 90 days, essentially all dependabot bumps of things unrelated tobrowsers (
eslint-plugin-unicorn,browserslist,@humanfs/node,brace-expansion); Playwright itself moved once, in chore(deps-dev): bump to playwright with new firefox version #7049. Keying on the lockfile would evict the browsers ~25 times a quarter to track ~1 real change, and would leave every one of those dependabot PRs starting cold. The version also makes the cache list readable at a glance (Linux-playwright-firefox-1.62.1) when something needs debugging.The version is read from
node_modules, so the resolve step has to run afternpm ci— it sits directly above the cache step to keep that dependency visible.What this saves, honestly
About 29s per job, not the couple of minutes you might expect from the step's total duration.
playwright install --with-depsspends most of its time on apt-level system dependencies (ffmpeg codecs, fonts), which live outside~/.cache/ms-playwrightand can't be cached this way. Breaking down the install step on a recent green run (34334463748):So this is ~20-30s off a ~21m30s critical path — modest on its own. It's worth having mainly because the saving is per-job, so it scales if we shard the browser jobs across runners later.
Notes
playwright installis left unchanged. It's idempotent, so on a cache hit it skips the downloads by itself and just runs the system-dependency install; no conditional needed.restore-keysdeliberately. A partial restore on a Playwright bump would leave the old browser version sitting in the directory next to the newly downloaded one and bake both into the next cache..githubis excluded from yamlfmt (.yamlfmt.yaml), so there's no formatting check to satisfy here.🤖 Generated with Claude Code
PR Checklist