Skip to content

Commit b4ee1de

Browse files
B4nanclaude
andauthored
chore: cache Playwright browsers and add install timeout in CI (#3691)
`playwright install --with-deps` re-downloaded all browsers from `cdn.playwright.dev` on every CI run, with no browser cache and no timeout. When the CDN stalls, the step hangs until the 6h job limit instead of failing fast — which is why many PRs get stuck on `Install Playwright browsers` simultaneously (it's CDN-driven, not PR-specific). This caches `~/.cache/ms-playwright` keyed by the lockfile so warm runs skip the download entirely, and caps the install step at `timeout-minutes: 10` so a stalled download fails fast and can be retried. Applied to `test-ci.yml`, `release.yml`, and `test-e2e.yml`. Browser set is unchanged (still installs all browsers). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 77fbf9e commit b4ee1de

3 files changed

Lines changed: 38 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,19 @@ jobs:
7171
turbo-${{ github.job }}-${{ github.ref_name }}-
7272
7373
- name: Install Dependencies
74-
run: |
75-
yarn
76-
yarn playwright install --with-deps
74+
run: yarn
75+
76+
- name: Cache Playwright browsers
77+
uses: actions/cache@v5
78+
with:
79+
path: ~/.cache/ms-playwright
80+
key: playwright-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
81+
restore-keys: |
82+
playwright-${{ runner.os }}-
83+
84+
- name: Install Playwright browsers
85+
timeout-minutes: 10
86+
run: yarn playwright install --with-deps
7787

7888
- name: Build
7989
run: yarn ci:build

.github/workflows/test-ci.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,21 @@ jobs:
5959
turbo-${{ github.job }}-${{ matrix.node-version }}-${{ github.ref_name }}-
6060
6161
- name: Install Dependencies
62-
run: |
63-
yarn
64-
yarn playwright install --with-deps
62+
run: yarn
63+
env:
64+
YARN_IGNORE_NODE: 1
65+
66+
- name: Cache Playwright browsers
67+
uses: actions/cache@v5
68+
with:
69+
path: ~/.cache/ms-playwright
70+
key: playwright-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
71+
restore-keys: |
72+
playwright-${{ runner.os }}-
73+
74+
- name: Install Playwright browsers
75+
timeout-minutes: 10
76+
run: yarn playwright install --with-deps
6577
env:
6678
YARN_IGNORE_NODE: 1
6779

.github/workflows/test-e2e.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,18 @@ jobs:
6666
- name: Install Dependencies
6767
run: yarn
6868

69+
- name: Cache Playwright browsers
70+
if: (matrix.storage != 'PLATFORM')
71+
uses: actions/cache@v5
72+
with:
73+
path: ~/.cache/ms-playwright
74+
key: playwright-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
75+
restore-keys: |
76+
playwright-${{ runner.os }}-
77+
6978
- name: Install Playwright Dependencies
7079
if: (matrix.storage != 'PLATFORM')
80+
timeout-minutes: 10
7181
run: yarn playwright install --with-deps
7282

7383
- name: Build

0 commit comments

Comments
 (0)