-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Linear ticket: https://linear.app/getsentry/issue/JS-1880
Prerequisite for #19673, #19674, #19675, #19676.
Context
When test workflows are split into independent workflow files, they can no longer use actions/download-artifact to get build output (artifacts are scoped to the workflow run). This issue covers the caching infrastructure needed to share build output across workflows.
Tasks
1. Add actions/cache/save to job_build
After the existing actions/upload-artifact step in job_build, add:
- uses: actions/cache/save@v5
with:
key: build-output-${{ github.sha }}
path: |
dev-packages/*/build
packages/*/build
packages/*/lib
packages/ember/*.d.ts
packages/gatsby/*.d.tsThis runs alongside existing behavior. No jobs consume it yet. Validates that cache save works and fits within the 10GB repo cache budget.
2. Create cross-workflow restore-cache variant
The existing .github/actions/restore-cache/action.yml uses actions/download-artifact which only works within the same workflow run. Create a new composite action (e.g., .github/actions/restore-build/action.yml) that:
- Restores dependency cache via
actions/cache/restore(same as today) - Restores build output via
actions/cache/restorewith keybuild-output-{SHA} - On cache miss: runs
yarn buildwith Nx cache (warm from develop, ~2 min) - Uploads build output via
actions/upload-artifactfor downstream jobs within the same workflow
3. Validate cache size budget
actions/cache has a 10GB per-repo limit. Current usage includes Nx cache, dependency cache, Playwright browsers, and E2E tarballs. Build output adds ~200-400MB per SHA. Verify this fits, monitor after rollout. GitHub evicts entries not accessed in 7 days, and cleanup-pr-caches.yml already handles PR cache cleanup.
Notes
- GitHub cache is branch-scoped: feature branches can only read from their own branch + the base branch (develop). No cross-contamination between PRs.
- The Nx-cached fallback build handles the race condition where a test workflow starts before the build workflow finishes saving the cache.
- E2E tarballs already use this exact
actions/cachepattern with keytarball-{SHA}, so this is a proven approach in this repo.