Skip to content

Cache Playwright browser binaries in CI#970

Merged
jorgemanrubia merged 1 commit intomainfrom
cache-playwright-browsers
Apr 17, 2026
Merged

Cache Playwright browser binaries in CI#970
jorgemanrubia merged 1 commit intomainfrom
cache-playwright-browsers

Conversation

@jorgemanrubia
Copy link
Copy Markdown
Member

@jorgemanrubia jorgemanrubia commented Apr 10, 2026

Summary

  • Cache ~/.cache/ms-playwright in the browser-test job, keyed on Playwright version and browser name
  • On cache hit, skip the full browser download and only install system apt deps (playwright install-deps), which should cut ~14 minutes off WebKit runs

Copilot AI review requested due to automatic review settings April 10, 2026 11:40
@jorgemanrubia jorgemanrubia force-pushed the cache-playwright-browsers branch from e1b2345 to ef8ea73 Compare April 10, 2026 11:42
The browser-test job downloads Playwright browsers from scratch on every run.
WebKit takes ~14 minutes. Cache ~/.cache/ms-playwright keyed on the Playwright
version and browser name so subsequent runs only install system apt deps.
@jorgemanrubia jorgemanrubia force-pushed the cache-playwright-browsers branch from ef8ea73 to bc18289 Compare April 10, 2026 11:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR speeds up Playwright CI runs by caching downloaded browser binaries between workflow runs, and adjusts installation steps to avoid redundant downloads on cache hits.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Changes:

  • Add an actions/cache step for ~/.cache/ms-playwright, keyed by Playwright version and the matrix browser.
  • On cache hit, skip browser download and only install OS dependencies via playwright install-deps.
  • Bump package.json version to 0.9.7-beta.

Reviewed changes

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

File Description
package.json Bumps the package version (not mentioned in PR description).
.github/workflows/ci.yml Caches Playwright browser binaries and changes install flow based on cache hit.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description only mentions caching Playwright binaries in CI, but this change bumps the package version from 0.9.5-beta to 0.9.7-beta. If the version bump isn’t intentional/release-related, it should be reverted or explained in the PR description to keep the change scoped and auditable.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/.cache/ms-playwright
key: playwright-${{ matrix.browser }}-${{ steps.playwright-version.outputs.version }}
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cache key doesn’t include runner OS/arch, but the contents of ~/.cache/ms-playwright are OS-specific browser binaries. Including something like ${{ runner.os }} (and potentially ${{ runner.arch }}) in the key helps avoid restoring incompatible binaries if the job ever runs on a different runner image or OS.

Suggested change
key: playwright-${{ matrix.browser }}-${{ steps.playwright-version.outputs.version }}
key: playwright-${{ runner.os }}-${{ runner.arch }}-${{ matrix.browser }}-${{ steps.playwright-version.outputs.version }}

Copilot uses AI. Check for mistakes.
@jorgemanrubia jorgemanrubia merged commit ec22748 into main Apr 17, 2026
12 checks passed
@jorgemanrubia jorgemanrubia deleted the cache-playwright-browsers branch April 17, 2026 08:39
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