chore: node22
这个 PR 做了什么? (简要描述所做更改) 更新 node 版本为 node22 更新 macOS 至 latest arm 架构,https://github.com/actions/runner-images/issues/13046
这个 PR 是什么类型? (至少选择一个)
- [ ] 错误修复 (Bugfix) issue: fix #
- [ ] 新功能 (Feature)
- [ ] 代码重构 (Refactor)
- [ ] TypeScript 类型定义修改 (Types)
- [ ] 文档修改 (Docs)
- [ ] 代码风格更新 (Code style update)
- [x] 构建优化 (Chore) https://github.com/NervJS/taro/issues/18574
- [ ] 其他,请描述 (Other, please describe):
这个 PR 涉及以下平台:
- [ ] 所有平台
- [ ] Web 端(H5)
- [ ] 移动端(React-Native)
- [ ] 鸿蒙(Harmony)
- [ ] 鸿蒙容器(Harmony Hybrid)
- [ ] ASCF 元服务
- [ ] 快应用(QuickApp)
- [ ] 所有小程序
- [ ] 微信小程序
- [ ] 企业微信小程序
- [ ] 京东小程序
- [ ] 百度小程序
- [ ] 支付宝小程序
- [ ] 支付宝 IOT 小程序
- [ ] 钉钉小程序
- [ ] QQ 小程序
- [ ] 飞书小程序
- [ ] 快手小程序
- [ ] 头条小程序
Summary by CodeRabbit
- Chores
- 更新 CI 所用 Node 版本至 22 并调整矩阵与主机标签为 -latest,更新各平台的构建与测试目标以改善覆盖和兼容性。
- 简化并统一 macOS/Ubuntu 的构建步骤与目标(包括 macOS 架构调整、Ubuntu 同时支持 glibc 与 musl)。
- 发布流程与依赖安装命令微调,修正步骤名称拼写。
- Bug Fixes
- 测试配置中加入无沙箱参数以提升容器环境稳定性。
✏️ Tip: You can customize this high-level summary in your review settings.
[!NOTE]
Other AI code review bot(s) detected
CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.
Walkthrough
更新多个 GitHub Actions 工作流将 Node 版本切换到 22,统一部分 runner 为 *-latest;调整 nodejs.yml 的矩阵与包含/排除规则,macOS 目标改为 aarch64,Ubuntu 同时包含 gnu 与 musl 目标;在 Stencil 测试配置中新增无沙箱浏览器启动参数。
Changes
| Cohort / File(s) | 变更摘要 |
|---|---|
Node.js CI 工作流 .github/workflows/nodejs.yml |
将 node-version 矩阵从 [18.x, 20.x] 更新为 [22, 20];host 矩阵改为 macos-latest, windows-latest, ubuntu-latest;移除对 macos-13 的排除,新增对 macos-latest 与 20 的排除规则调整;macOS 目标改为 aarch64-apple-darwin;Ubuntu 目标包含 x86_64-unknown-linux-gnu 与 x86_64-unknown-linux-musl。其它步骤(install/lint/artifact/coverage)与新矩阵对齐。 |
Rust 绑定 构建工作流 .github/workflows/build-rust-binding.yml |
node-version 从 18.x 升级为 22;将 macOS runner 从 macos-13 改为 macos-latest 并简化该 host 的构建步骤(移除此前的 strip 步骤);ubuntu-22.04 更换为 ubuntu-latest;Windows 条目保持不变。 |
发布工作流 & 同步工作流 .github/workflows/publish.yml, .github/workflows/sync-components-types.yml |
将 Node 设定从 18 -> 22(步骤名由特定版本改为通用“Setup Node”);调整安装命令(pnpm -r install --frozen-lockfile -> pnpm install --frozen-lockfile)并修正拼写。缓存与 registry 配置保持一致。 |
Stencil 测试 配置 packages/taro-components/scripts/stencil/stencil.config.ts |
在 testing 配置中新增 browserArgs: ['--no-sandbox', '--disable-setuid-sandbox'],并做了少量注释/空白调整;无其它 API/导出签名变更。 |
Estimated code review effort
🎯 3 (中等) | ⏱️ ~20 分钟
- 关注点:matrix 的包含/排除规则是否与预期匹配(尤其 macOS aarch64 映射与对 macos-latest 的排除/包含);
- 检查 macOS 上移除 strip 步骤是否影响构建产物(
build-rust-binding.yml); - 验证 Stencil 新增的 browserArgs 在 CI 环境下能否正确启动无沙箱浏览器(
packages/.../stencil.config.ts)。
Possibly related PRs
- NervJS/taro#17548 — 与
.github/workflows/nodejs.yml的修改有重叠,可能涉及相同矩阵调整。 - NervJS/taro#17564 — 修改了
build-rust-binding.yml的 Ubuntu runner/矩阵,与本次 ubuntu-latest 变更直接相关。 - NervJS/taro#18649 — 同时触及 CI 工作流与 Stencil 配置,与本次改动在文件层面有直接关联。
Suggested reviewers
- yoyo837
- tutuxxx
- luckyadam
诗歌
🐰 我跳过 CI 草坪轻轻嚓,
节点换新靴子二二去,
苹果小芯朝云端,步伐快,
两条 Linux 路并肩不孤单,
无沙箱的风里我眯眼笑。
Pre-merge checks and finishing touches
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Title check | ⚠️ Warning | PR标题为 'chore: node22',但实际变更涉及Node.js 22和Node.js 24,以及macOS升级到最新架构和多个CI工作流的更新。标题未能准确反映主要变更内容。 | 建议更新标题为 'chore: upgrade Node.js to 22/24 and update CI runners' 或 'chore: update Node.js versions and macOS runner' 以更准确地描述所有关键变更。 |
✅ Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
✨ Finishing touches
- [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 51.83%. Comparing base (ef4a0b2) to head (b104fd7).
:warning: Report is 1 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #18578 +/- ##
==========================================
- Coverage 52.63% 51.83% -0.81%
==========================================
Files 463 545 +82
Lines 25108 28282 +3174
Branches 6629 7332 +703
==========================================
+ Hits 13215 14659 +1444
- Misses 9726 11331 +1605
- Partials 2167 2292 +125
| Flag | Coverage Δ | |
|---|---|---|
| taro-cli | 72.69% <ø> (-0.17%) |
:arrow_down: |
| taro-runtime | 60.33% <ø> (ø) |
|
| taro-web | 49.68% <ø> (-3.44%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more. see 133 files with indirect coverage changes
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
现在所有macOS-13的CI都跑不了了
先撤回 https://github.com/NervJS/taro/pull/18649?
按理说,node 目前应该最低的 LTS 是20,为什么只留22、24呢?
按理说,node 目前应该最低的 LTS 是20,为什么只留22、24呢?
这个PR初衷也是想把node版本更新了
Taro 目前以稳定为主,如果不是必须,最好不动。
反正18必须弃用了,依赖也陆续不支持18了,20在5个月后也将弃用,还不如从现在起紧跟头两个LTS
Taro 目前以稳定为主,如果不是必须,最好不动。
如果现在没有人手处理24可能的问题的话,那就保留20,等5个月后弃用了再更24
@yoyo837 咋说?保留20还是24?
@yoyo837 咋说?保留20还是24?
能不动则不动
@yoyo837 咋说?保留20还是24?
能不动则不动
留了20,删了24
@yoyo837 这个可以先合吗?还是说要等人先更新分支保护规则?
不更新的话,合上去也没有用吧?
不更新的话,合上去也没有用吧?
合上去至少可以让CI跑起来,只是会有pending checks