Repository navigation
Conversation
`native-capsule.yml` 是上游新加的 job,只在 `pull_request` 上跑,而它的 `rust-cache` 步没有 `save-if`、也没有 `shared-key`: - 每次 PR 都往 `refs/pull/<n>/merge` 写一份 macOS + Windows 的依赖树 —— 这个 作用域此后不会被任何运行恢复,纯粹占配额、按 LRU 挤掉 beta 的缓存; - key 里带的是 job 名 `native-capsule`,而 beta 上没有任何 job 产出同 key 的 树(这个 workflow 根本不跑 push),所以 PR 侧也永远命中不了,冷编译是必然。 改成和其余 job 一致: - 增加 `push: branches: [main, beta]`:beta 的 push 负责把树焐热; - `shared-key: native-capsule`(稳定前缀,不随 job 名变化); - `save-if` 只在 beta 的 push / dispatch 上为真,PR 只读; - `workspaces: openless-all/app -> target`(原写法没有目标目录映射,rust-cache 会按 workspace 默认猜测); - 补 `permissions: contents: read`、`timeout-minutes: 30`、并发组 (PR 内重复推送互相取消,beta push 排队); - clippy 需要 `components: clippy`,原来没装,靠 runner 预装碰运气。 契约测试 `ci-cache-sharing.test.mjs` 增加三条断言(必须跑 beta push、必须 beta 门控 save-if、必须有 shared-key),并在缓存策略文档里写明这个坑。
原来的 `native-capsule.yml` 是独立 workflow,代价是多一次运行、多一条状态、多一套 缓存策略,而且它只在 `pull_request` 上触发——这也是它缓存永远命中不了的根因。 并入 `ci.yml` 后: - 复用同一个 `Changed areas` 门禁(`needs.changes.outputs.tauri != 'false'`), 只有真正能触及 Rust 的改动才跑; - 一次 PR 只有一条 CI 状态,矩阵 `macos-latest` / `windows-latest` 失败互不影响; - 缓存策略与其余 job 同源:`shared-key: native-capsule` + `save-if` 只在 beta 写, PR 只读,不再往 `refs/pull/<n>/merge` 写一次性依赖树; - 删除 `.github/workflows/native-capsule.yml`。 契约测试改为在 `ci.yml` 里定位 `native-capsule` job,并断言那个独立 workflow 文件必须不存在。
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.
问题
native-capsule.yml(上游新加的 job)只在pull_request上跑,rust-cache步既没有save-if也没有shared-key:refs/pull/<n>/merge写一份 macOS + Windows 依赖树 —— 这个作用域此后再也不会被恢复,只占配额、按 LRU 挤掉 beta 的缓存;native-capsule,而 beta 上没有任何 job 产出同 key 的树(workflow 不跑 push),所以 PR 侧也永远命中不了 → 每次冷编译。改动
push: branches: [main, beta],让 beta 的 push 把树焐热shared-key: native-capsule(稳定前缀,不随 job 名变化)save-if只在 beta 的 push / dispatch 为真,PR 只读workspaces: openless-all/app -> target(原来没给目标目录映射)permissions: contents: read、timeout-minutes: 30、并发组(PR 内重复推送互相取消)components: clippy契约测试
ci-cache-sharing.test.mjs新增三条断言,缓存策略文档补了这个坑。验证
ci-cache-sharing/ci-changed-areas/linux-egui-release-contract/ci-cache-usage全过,actionlint干净。