ci: 修正 turbo 2.x 的 Actions 缓存路径(Type Check 关键路径 ~6min → 预计 ~4min) - #3164
Merged
Conversation
…che) 六处缓存步骤仍指向 turbo 1.x 的缓存目录 node_modules/.cache/turbo,而仓库 用的是 turbo ^2.10.7,实际写入 .turbo/cache(已实测确认)——即每次恢复和 保存的都是不存在的目录,Turbo 缓存形同虚设。Type Check job 因此每个 PR 都 在冷缓存下全量重建 ^build 依赖再全量检查(实测 5m26s,是 CI 关键路径)。 修正后未变更包命中缓存,预计该 job 降至 1-2 分钟。 涉及 ci.yml(type-check、docs)、lint.yml、release.yml、 changeset-release.yml、performance-budget.yml。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U8Ms7unkKxTrmNCX2r1dfs
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
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.
问题
六处缓存步骤(ci.yml 的 type-check/docs、lint.yml、release.yml、changeset-release.yml、performance-budget.yml)仍指向 turbo 1.x 的缓存目录
node_modules/.cache/turbo,而仓库用的是turbo ^2.10.7,实际读写.turbo/cache。已在本仓库实测确认:跑一个 turbo 任务后node_modules/.cache/turbo不存在,缓存 tarball 写入.turbo/cache/,且turbo config报告cacheDir: ".turbo/cache"。也就是说这些 job 每次恢复和保存的都是不存在的目录,Turbo 缓存完全失效。实测后果(run 30700529091):Type Check 的缓存恢复步骤 1 秒(空),随后
turbo run type-check在冷缓存下全量重建^build依赖并全量检查,耗时 5m26s,是该仓库 CI 的关键路径。作为对照,objectstack 的 ci.yml 用的是正确路径,其注释记录了同一构建"无缓存 ~4.5 分钟 / 有缓存不到 1 分钟"。改动
6 处
path: node_modules/.cache/turbo→path: .turbo/cache,无其它变更。缓存键沿用现状,旧键下的既有缓存条目会自然失配换新。预期效果
Type Check(及 lint、docs、release 系列)在未变更包上命中缓存;PR 关键路径从 ~6 min 降到 ~4 min(转为由 test 分片决定)。
🤖 Generated with Claude Code
https://claude.ai/code/session_01U8Ms7unkKxTrmNCX2r1dfs
Generated by Claude Code