Commit 60f16fc
committed
🤖 ci: optimize Playwright installation with caching and Docker
Addresses slow/flaky CI caused by apt mirror issues during Playwright
browser installation.
## Changes
### Storybook tests - Use Docker container (eliminates apt entirely)
- Run in mcr.microsoft.com/playwright:v1.56.0-noble container
- All browser dependencies are pre-installed in the image
- No apt-get calls needed, immune to mirror issues
### E2E tests - Use caching + retry logic
- Cache ~/.cache/ms-playwright keyed by Playwright version
- On cache hit: only run install-deps (apt for system libs)
- On cache miss: run install --with-deps (download + apt)
- Add retry logic (3 attempts with 10s delay) for apt flakiness
- Install only chromium (sufficient for Electron tests)
## Why not Docker for E2E?
E2E tests run Electron which requires xvfb and host display access,
making containerization complex. The cache + retry approach handles
the apt issue for this case.
## Expected Impact
| Job | Before | After |
|-----|--------|-------|
| Storybook | apt flaky, 3-5 min | No apt, ~1 min |
| E2E (cache hit) | apt flaky | apt with retry |
| E2E (cache miss) | apt flaky, all browsers | apt with retry, chromium only |
_Generated with `mux`_1 parent 6830b71 commit 60f16fc
2 files changed
+54
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
129 | 133 | | |
130 | 134 | | |
131 | 135 | | |
| |||
134 | 138 | | |
135 | 139 | | |
136 | 140 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| |||
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
163 | | - | |
| 164 | + | |
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
| 169 | + | |
173 | 170 | | |
174 | 171 | | |
175 | 172 | | |
| |||
0 commit comments