Commit d82bda3
committed
[ci] Cache Chrome binary across CI runs for Browser Run tests
Browser Run tests in `packages/miniflare/test/plugins/browser/index.spec.ts`
and the `fixtures/browser-run` fixture call into `@puppeteer/browsers`
to ensure Chrome is downloaded into the global Wrangler cache. Every
CI run currently re-downloads ~150 MB of Chrome from scratch because
the cache directory is per-runner-instance and not shared between runs.
Add an `actions/cache@v4` step keyed on the OS + the Chrome version
hardcoded in `packages/miniflare/src/index.ts` (`126.0.6478.182")`,
restoring/saving `~/.cache/.wrangler/chrome` (Linux),
`~/Library/Caches/.wrangler/chrome` (macOS), and
`~/AppData/Local/xdg.cache/.wrangler/chrome` (Windows).
Benefits:
- Cuts ~150 MB and the associated download time off cold CI runs.
- Reduces the surface area for the intermittent partial-extraction
race that surfaces as `The browser folder (...) exists but the
executable (...) is missing` (see #13971 for the diagnostic that
exposed this, #13980 for the in-process recovery layer). When the
cache is warm and the binary is already extracted, this race can't
fire at all because `install()` short-circuits.
The cache step runs for the `packages-and-tools` suite on all three
OSes and for the `fixtures` suite on macOS + Windows (the Browser Run
fixture is excluded on Ubuntu because of AppArmor).
When the Chrome version in `packages/miniflare/src/index.ts` changes,
the cache key here needs to be bumped manually. A miss only triggers a
fresh download — no functional impact.1 parent 9c4569f commit d82bda3
1 file changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
139 | 165 | | |
140 | 166 | | |
141 | 167 | | |
| |||
0 commit comments