ci: cache Playwright browser binaries across desktop CI jobs#483
Merged
wesbillman merged 3 commits intomainfrom May 5, 2026
Merged
ci: cache Playwright browser binaries across desktop CI jobs#483wesbillman merged 3 commits intomainfrom
wesbillman merged 3 commits intomainfrom
Conversation
Adds actions/cache for Playwright Chromium binaries in the desktop and desktop-e2e-integration jobs. On cache hit, the ~180MB browser download from Playwright CDN is skipped entirely, eliminating the primary source of CI slowness when the CDN is congested (observed 9+ minutes in slow runs). - Set PLAYWRIGHT_BROWSERS_PATH to a workspace-relative path for reliable cache key resolution - Key on exact Playwright version (extracted at runtime) to avoid over-invalidation from unrelated lockfile changes - Split `playwright install --with-deps` into conditional `install` (only on cache miss) + unconditional `install-deps` (system packages needed every run on fresh runners) - Pin actions/cache to SHA (v4.3.0) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Split actions/cache into actions/cache/restore (read-only, all events) + actions/cache/save (write, push events only). This prevents pull requests from writing to the cache, addressing the cache poisoning attack vector flagged by zizmor. PRs still benefit from reading cached Playwright browsers populated by push-to-main runs. Cache saves only happen on push events when the cache key is new (miss). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
actions/cachefor Playwright Chromium binaries in thedesktopanddesktop-e2e-integrationCI jobsplaywright install --with-deps chromiuminto conditionalinstall(only on cache miss) + unconditionalinstall-deps(system packages needed every run on fresh runners)Details
Problem: The
desktopanddesktop-e2e-integrationjobs download Playwright browser binaries from scratch every run. When the Playwright CDN is slow, this balloons from ~8 seconds to ~9 minutes. Combined with slow apt mirrors, total job time can go from 5 min to 23 min.Solution: Cache the Playwright Chromium binary (~180MB) using
actions/cache. The cache key is based on the exact Playwright version (extracted from@playwright/test/package.jsonat runtime), so it only invalidates when Playwright is actually bumped.What stays the same: System dependencies (
playwright install-deps chromium) run unconditionally on every run because each GitHub Actions runner is a fresh VM. Apt caching was evaluated and intentionally excluded — the complexity/risk outweighs the benefit given the existing retry/timeout configuration.Changes:
PLAYWRIGHT_BROWSERS_PATHat workflow level for reliable cache path resolutionactions/cachestep (pinned to SHA, v4.3.0) before Playwright installplaywright install chromiumconditional on cache missplaywright install-deps chromiumunconditionalTest plan
desktopanddesktop-e2e-integrationjobs exercise the new steps)desktop/package.jsonshould trigger cache miss🤖 Generated with Claude Code