ci: use artifacts for e2e prep so job retries don't fail on cache eviction#16310
Merged
Conversation
Contributor
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖 |
denolfe
reviewed
Apr 17, 2026
denolfe
left a comment
Member
There was a problem hiding this comment.
Just some comment cleanup needed, looks good otherwise.
denolfe
approved these changes
Apr 17, 2026
milamer
pushed a commit
to milamer/payload
that referenced
this pull request
Apr 20, 2026
…ction (payloadcms#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>
Contributor
|
🚀 This is included in version v3.84.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switches the
e2e-prephandoff fromactions/cachetoactions/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: cache is for dependencies reused across runs, artifacts are for passing data between jobs within a run.
e2e-prepfalls 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 withFailed 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: trueis required becausetest/node_modulescontains.bin,.pnpm, etc. Missing that flag silently produces a broken artifact.download-artifacthas nofail-on-cache-missequivalent.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-buildcache used by.github/actions/setup. That one still has its own polling + full-build fallback, which is orthogonal to this change.