Skip to content

Comments

fix(ci): cache and install Playwright browsers in e2e job#844

Merged
rekmarks merged 4 commits intomainfrom
rekm/fix-playwright-cache-in-ci
Feb 19, 2026
Merged

fix(ci): cache and install Playwright browsers in e2e job#844
rekmarks merged 4 commits intomainfrom
rekm/fix-playwright-cache-in-ci

Conversation

@rekmarks
Copy link
Member

@rekmarks rekmarks commented Feb 19, 2026

The e2e CI job was failing on #843 with "Executable doesn't exist" for the Playwright Chromium binary. The root cause: the prepare job installs dependencies with PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 and caches node_modules. When the e2e job restores that cache, yarn install is skipped entirely, so postinstall/playwright-install.sh never runs and the browsers are never downloaded. Playwright browsers live in ~/.cache/ms-playwright/, not in node_modules, so they are not covered by the node_modules cache.

Changes

  • Add a Playwright browser cache step (actions/cache) to the e2e job, keyed on runner.os + yarn.lock hash so it automatically invalidates when Playwright is updated.
  • Add an Install Playwright browsers step that runs yarn playwright install chromium only on a cache miss, and always installs Playwright dependencies, which are not cached.
  • Bump Playwright deps to trigger cache miss in CI.

Testing

This is a CI configuration change. It is verified by pushing the branch and confirming the E2E Tests / omnium-gatherum (and sibling matrix) jobs pass. On the first run the cache will miss and download Chromium; subsequent runs with the same yarn.lock will hit the cache and skip the download.


Note

Low Risk
CI/workflow and dependency-version updates only; main risk is longer first-run CI times or cache-key issues affecting E2E job reliability.

Overview
Prevents E2E CI failures caused by missing Playwright Chromium binaries when node_modules is restored from cache and Playwright postinstall doesn’t run.

Updates the e2e GitHub Actions job to cache ~/.cache/ms-playwright (keyed by OS + yarn.lock) and to install Playwright Chromium on cache miss, plus always install required system deps via playwright install-deps.

Bumps Playwright tooling to ^1.58.2 across the repo (root playwright devDependency and workspace @playwright/test/playwright versions), updating yarn.lock accordingly.

Written by Cursor Bugbot for commit fb33ca9. This will update automatically on new commits. Configure here.

@rekmarks rekmarks requested a review from a team as a code owner February 19, 2026 19:15
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

rekmarks and others added 3 commits February 19, 2026 11:23
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tall

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rekmarks rekmarks force-pushed the rekm/fix-playwright-cache-in-ci branch from c346e26 to 7874d1c Compare February 19, 2026 19:31
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​playwright/​test@​1.57.0 ⏵ 1.58.210010010099100
Updatedplaywright@​1.57.0 ⏵ 1.58.2100 +110010099100

View full report

@socket-security

This comment was marked as resolved.

@rekmarks rekmarks enabled auto-merge February 19, 2026 19:43
@github-actions
Copy link
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 78.22%
🟰 ±0%
6508 / 8320
🔵 Statements 78.17%
🟰 ±0%
6613 / 8459
🔵 Functions 76.01%
🟰 ±0%
1626 / 2139
🔵 Branches 78.16%
🟰 ±0%
2406 / 3078
File CoverageNo changed files found.
Generated in workflow #3765 for commit fb33ca9 by the Vitest Coverage Report Action

@rekmarks rekmarks added this pull request to the merge queue Feb 19, 2026
Merged via the queue into main with commit fd122f6 Feb 19, 2026
29 checks passed
@rekmarks rekmarks deleted the rekm/fix-playwright-cache-in-ci branch February 19, 2026 19:58
rekmarks added a commit that referenced this pull request Feb 20, 2026
The `test` job was logging a Playwright \"Executable doesn't exist\"
error (the same root cause fixed for the `e2e` job in #844): the
`prepare` job caches `node_modules` while the postinstall script skips
browser downloads in CI, so when downstream jobs restore from cache,
Playwright browsers are never downloaded.

## Changes

- Add `.github/actions/playwright-install` composite action that caches
`~/.cache/ms-playwright` (keyed on OS + `yarn.lock`) and installs
Playwright Chromium with `--with-deps` on cache miss, or just
`install-deps` on cache hit; use it in both the `test` and `e2e` jobs
- Simplify `scripts/playwright-install.sh` to check `$CI` (always `true`
in GitHub Actions) instead of `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD`,
removing the need to set that env var in every job and the now-redundant
Dependabot check (Dependabot runs in CI)
- Always use `--with-deps` in `playwright-install.sh`, removing the dead
`PLAYWRIGHT_ONLY_SHELL` and CI-branch logic

## Testing

CI-only change. Verified by pushing and confirming both `Test` and `E2E
Tests` jobs install Playwright browsers correctly. The two jobs share
the same cache key, so only one download occurs per `yarn.lock` hash.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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