Skip to content

Commit 40bb954

Browse files
authored
ci: move daily macOS validation to Apple Silicon (#3852)
1 parent bcefe1a commit 40bb954

3 files changed

Lines changed: 21 additions & 14 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ jobs:
133133
- os: ubuntu-latest
134134
cache_key: ubuntu
135135
timeout_minutes: 30
136-
# Pin the Intel pool for macOS OS-contract validation; release jobs
137-
# select their Apple Silicon / Intel targets independently.
138-
- os: macos-15-intel
139-
cache_key: macos-intel
140-
# A cold Intel build can still be compiling the CLI at 30 minutes.
136+
# Keep the blocking macOS validation on Apple Silicon for predictable
137+
# PR latency; release and Nightly matrices retain both architectures.
138+
- os: macos-15
139+
cache_key: macos-arm64
140+
# Keep headroom for a cold macOS CLI build.
141141
timeout_minutes: 75
142142
- os: windows-latest
143143
cache_key: windows
@@ -220,7 +220,7 @@ jobs:
220220
matrix:
221221
os:
222222
- ubuntu-latest
223-
- macos-15-intel
223+
- macos-15
224224
- windows-latest
225225
steps:
226226
- uses: actions/checkout@v5
@@ -282,7 +282,7 @@ jobs:
282282

283283
- uses: swatinem/rust-cache@v2
284284
with:
285-
shared-key: "ci-check-v6-${{ github.base_ref || github.ref_name }}-${{ runner.os }}-no-cargo-bin"
285+
shared-key: "ci-check-v6-${{ github.base_ref || github.ref_name }}-${{ runner.os }}-${{ runner.arch }}-no-cargo-bin"
286286
cache-bin: false
287287
# PR caches are scoped to merge refs; trusted main pushes own shared
288288
# refreshes and retain completed dependency builds after late test failures.

‎docs/architecture/rust-build-dependency-boundaries.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ CI 负责 workspace 级检查、真实产品 feature 组合、跨平台、完整
228228

229229
### 7.1 Hosted CI 关键路径与缓存
230230

231-
- 日常 Rust/CLI 验证保留 Linux、Windows 和 macOS 三个平台,macOS 固定使用标准 Intel macOS 15 runner(`macos-15-intel`),避免默认标签的架构迁移和 ARM64 托管资源池分配失败阻塞 OS 契约验证。CLI 与 Rust 使用相同平台矩阵,缓存键区分 Intel。这提供 macOS x64 原生测试证据,不代表 Apple Silicon 运行验证;ARM64/x64 发布目标仍由发布 workflow 的矩阵拥有。
231+
- 日常 Rust/CLI 验证保留 Linux、Windows 和 macOS 三个平台,macOS 固定使用标准 Apple Silicon macOS 15 runner(`macos-15`),缩短 PR 的阻塞路径。CLI 与 Rust 使用相同平台矩阵,Rust 缓存键必须区分 runner 架构。日常验证提供 Apple Silicon 原生测试证据;macOS x64 仍由发布和 Nightly workflow 的矩阵拥有。
232232
- 验证 job 只依赖自身的编译期前置条件。Tauri `check`/`test` 只要求配置中的前端和资源目录存在时,Rust job 自行创建空目录,不等待或传递可发布前端产物;真实静态资源仍由前端构建和产品打包 owner 负责。
233233
- Rust/CLI 影响分类必须保守且 fail-closed:只有活动路径全部位于 `src/web-ui/**` 时才允许跳过 Rust 与 CLI matrix;仓库根目录/`docs/**` 的 Markdown 和 `png/**` 可作为已知中性伴随路径。其他嵌套 Markdown 可能是 `include_str!`/`include_bytes!` 输入,workflow 不得宽泛忽略全部 Markdown。空变更、非法或不可用 diff range、Rust/build 输入、CI 脚本、其他产品 surface 和所有未识别路径都必须运行完整验证,不能依赖易漏维护的“已知 Rust 目录”名单。PR 使用 base/head 的 merge-base range,只分类 PR 自身改动;`main` push 使用事件 before/head 的 direct range,保留 force-push 或回退提交的实际影响。
234234
- “纯 Web”前提必须是可执行边界:影响分类 job 在计算 diff 前,从 Git 跟踪文件列表扫描全仓 `.rs`(包括 workspace 外 Installer 和根 build script)。除逐行精确登记的既有测试 fixture 外,非注释 Rust 源码不得出现 `web-ui` 路径 token;因此 `include_dir!`、编译嵌入、分段 `PathBuf::join` 和间接路径变量都会在分类前失败。Frontend job 同时显式运行边界 contract tests 和真实 repository boundary check;跨 surface 的命令注册和调用分别由 owner 测试看护。新增类似源码读取时应修复所有权,而不是给影响分类器追加隐式例外。

‎scripts/check-github-config.test.mjs‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,8 @@ test('keeps Rust CI independent, restore-only on PRs, and target-focused', () =>
431431
);
432432
assert.deepEqual(
433433
rustJob.strategy.matrix.os,
434-
['ubuntu-latest', 'macos-15-intel', 'windows-latest'],
435-
'Rust validation must retain the reviewed Linux, macOS, and Windows matrix',
434+
['ubuntu-latest', 'macos-15', 'windows-latest'],
435+
'Rust validation must retain the reviewed Linux, Apple Silicon macOS, and Windows matrix',
436436
);
437437
assert.equal(
438438
rustJob.steps.some((step) => step.uses?.startsWith('actions/download-artifact@')),
@@ -471,23 +471,30 @@ test('keeps Rust CI independent, restore-only on PRs, and target-focused', () =>
471471
/github\.base_ref \|\| github\.ref_name/,
472472
`${jobName} must not mix main and explore build outputs`,
473473
);
474+
if (jobName === 'rust-build-check') {
475+
assert.match(
476+
cache?.with?.['shared-key'] ?? '',
477+
/runner\.arch/,
478+
'Rust validation caches must stay isolated by architecture',
479+
);
480+
}
474481
}
475482

476483
const cliJob = workflow.jobs['cli-test'];
477484
assert.deepEqual(
478485
cliJob.strategy.matrix.include.map((entry) => entry.os),
479486
rustJob.strategy.matrix.os,
480-
'CLI and Rust validation must exercise the same Linux, Intel macOS, and Windows hosts',
487+
'CLI and Rust validation must exercise the same Linux, Apple Silicon macOS, and Windows hosts',
481488
);
482489
assert.equal(
483-
cliJob.strategy.matrix.include.find((entry) => entry.os === 'macos-15-intel').cache_key,
484-
'macos-intel',
490+
cliJob.strategy.matrix.include.find((entry) => entry.os === 'macos-15').cache_key,
491+
'macos-arm64',
485492
);
486493
assert.equal(cliJob['timeout-minutes'], '${{ matrix.timeout_minutes }}');
487494
assert.deepEqual(
488495
cliJob.strategy.matrix.include.map((entry) => entry.timeout_minutes),
489496
[30, 75, 30],
490-
'Only the cold Intel macOS CLI build needs a longer job budget',
497+
'Only the cold macOS CLI build needs a longer job budget',
491498
);
492499
assert.ok(
493500
cliJob.strategy.matrix.include.some((entry) => entry.os === 'windows-latest'),

0 commit comments

Comments
 (0)