Skip to content

ci: restore each job's turbo cache before the build cache - #356

Open
pjeweb wants to merge 1 commit into
mainfrom
ci/turbo-cache-restore-order
Open

pjeweb wants to merge 1 commit into
mainfrom
ci/turbo-cache-restore-order

Conversation

@pjeweb

@pjeweb pjeweb commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Put ${{ github.job }} ahead of build in the Turbo cache restore-keys. actions/cache stops at the first prefix match, so the previous order made lint, typecheck, and test restore the Build cache on every run and never reuse the caches those jobs had saved.
  • Keep the Build cache as the fallback for a job that has not saved one yet.

Note

Low Risk
CI caching configuration only; no application, auth, or data-path changes.

Overview
Reorders Turbo restore-keys in the shared setup action so each GitHub job (lint, typecheck, test, build, etc.) matches its own prior .turbo cache before falling back to the build job’s cache.

Because actions/cache uses the first prefix match, putting build first caused non-build jobs to always restore the build cache and ignore caches they had saved on earlier runs. Comments in the action are updated to document that behavior.

Reviewed by Cursor Bugbot for commit e6097b9. Bugbot is set up for automated code reviews on this repo. Configure here.

actions/cache stops at the first matching restore prefix, so a leading
build- key made lint, typecheck, and test always reuse the build cache
and never their own saved task hashes.
@changeset-bot

changeset-bot Bot commented Sep 30, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e6097b9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@open-mapsight open-mapsight deleted a comment from cursor Bot Oct 2, 2026
@pjeweb
pjeweb requested a balanced review from Copilot October 2, 2026 23:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The narrow configuration change implements the intended cache priority while preserving fallback behavior.

Review effort: Balanced
Findings: None

What changed in this PR

Updates shared CI setup to prefer each job’s own Turbo cache.

Changes:

  • Restores job-specific caches before the build cache, preserving existing fallbacks.
  • Updates comments to explain restore-key precedence.
File Description
.github/​actions/​setup/​action.yml Reorders Turbo cache restore keys and clarifies comments.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants