Commit bc590bd
authored
ci: use artifacts for e2e prep so job retries don't fail on cache eviction (#16310)
Switches the `e2e-prep` handoff from `actions/cache` to
`actions/upload-artifact` + `actions/download-artifact`, so that
re-running an individual failed E2E shard works without having to re-run
the entire workflow (or push an empty commit to re-trigger CI, which is
what we've been doing).
This is also the pattern [recommended by
GitHub](https://docs.github.com/en/actions/tutorials/store-and-share-data):
cache is for dependencies reused across runs, artifacts are for passing
data between jobs within a run. `e2e-prep` falls squarely into the
second category.
### Why
The Actions cache for this repo is permanently at its 10 GB limit, so
the `e2e-prep-<sha>` entry gets evicted by LRU within a few hours of
being saved. When that happens, any retry of a failed shard fails at the
"Restore prepared test environment" step with `Failed to restore cache
entry`, and the only recovery path is re-running the full workflow.
Artifacts are scoped to the workflow run and not subject to the 10 GB
cache budget, so they survive across attempts.
Real example that motivated this:
https://github.com/payloadcms/payload/actions/runs/24524398342/job/71809444756
### Notes for reviewers
- `include-hidden-files: true` is required because `test/node_modules`
contains `.bin`, `.pnpm`, etc. Missing that flag silently produces a
broken artifact.
- Added an explicit "Verify prepared test environment" step with an
actionable error, since `download-artifact` has no `fail-on-cache-miss`
equivalent.
- Left the default 90 day retention. This repo is public, so artifact
storage is free and there's no reason to be aggressive.
- Upload/download is slightly slower than cache (zip vs zstd), but the
difference is in the order of tens of seconds on a job that takes
minutes. Worth it for the reliability win.
- `e2e-prep-<sha>` cache key is left behind on old runs; it will
naturally age out on its own, no cleanup needed.
This does not touch the separate `restore-build` cache used by
`.github/actions/setup`. That one still has its own polling + full-build
fallback, which is orthogonal to this change.
Co-authored-by: German Jablonski <GermanJablo@users.noreply.github.com>1 parent 1c1ed97 commit bc590bd
1 file changed
Lines changed: 32 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
245 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
246 | 251 | | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
253 | 255 | | |
254 | 256 | | |
255 | 257 | | |
| |||
270 | 272 | | |
271 | 273 | | |
272 | 274 | | |
273 | | - | |
274 | | - | |
| 275 | + | |
| 276 | + | |
275 | 277 | | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
283 | 296 | | |
284 | 297 | | |
285 | 298 | | |
| |||
335 | 348 | | |
336 | 349 | | |
337 | 350 | | |
338 | | - | |
339 | | - | |
| 351 | + | |
| 352 | + | |
340 | 353 | | |
341 | 354 | | |
342 | 355 | | |
| |||
0 commit comments