Skip to content

Conversation

@ianzone
Copy link
Contributor

@ianzone ianzone commented Nov 6, 2025

这个 PR 做了什么? (简要描述所做更改)
更新 node 版本为 node22
更新 macOS 至 latest arm 架构,actions/runner-images#13046

这个 PR 是什么类型? (至少选择一个)

这个 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.

@coderabbitai
Copy link

coderabbitai bot commented Nov 6, 2025

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-latest20 的排除规则调整;macOS 目标改为 aarch64-apple-darwin;Ubuntu 目标包含 x86_64-unknown-linux-gnux86_64-unknown-linux-musl。其它步骤(install/lint/artifact/coverage)与新矩阵对齐。
Rust 绑定 构建工作流
​.github/workflows/build-rust-binding.yml
node-version18.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

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/nodejs.yml (1)

149-261: 建议重构:大量代码重复需要整合

nodejs-testing-new job与原有的 nodejs-testing job几乎完全相同(约110行重复代码),仅在矩阵配置和第191行的安装命令有差异。这违反了DRY原则,增加了维护成本。

根据PR描述,旧的 nodejs-testing 最终会被移除,建议考虑以下方案:

  1. 短期:直接合并两个矩阵到一个job中(更新 node-versionhost,调整exclude/include规则)
  2. 使用GitHub Actions的reusable workflows来消除重复

这样可以避免未来维护两份相同代码的问题。

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a018f9d and 58ce338.

📒 Files selected for processing (1)
  • .github/workflows/nodejs.yml (1 hunks)
🔇 Additional comments (1)
.github/workflows/nodejs.yml (1)

156-165: 澄清矩阵排除规则的设计意图

新job的矩阵配置中,Node 22被排除在所有非ubuntu平台上(macos-13、macos-latest、windows-latest),这意味着:

  • Node 22:仅在ubuntu-latest上测试
  • Node 24:在所有平台上测试

请确认这是否为故意设计(例如Node 22在其他平台上还不稳定),还是需要扩展Node 22的测试覆盖范围。

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.83%. Comparing base (ef4a0b2) to head (b104fd7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            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%) ⬇️
taro-runtime 60.33% <ø> (ø)
taro-web 49.68% <ø> (-3.44%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 133 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This was referenced Nov 8, 2025
Copilot AI review requested due to automatic review settings December 8, 2025 15:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the CI/CD pipeline by updating Node.js versions and build infrastructure to support newer platforms while dropping legacy Intel Mac support.

Key Changes:

  • Updates CI testing from Node.js 18.x/20.x to Node.js 22/24
  • Migrates macOS builds from Intel (x86_64) to ARM (aarch64) architecture exclusively
  • Adds browser sandbox flags for improved CI test stability

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/nodejs.yml Updates Node.js test matrix to versions 22 and 24; switches macOS runner to latest (ARM); changes macOS target to aarch64-apple-darwin; simplifies pnpm install command
.github/workflows/build-rust-binding.yml Updates to Node.js 22; removes Intel Mac (x86_64-apple-darwin) build target; migrates all hosts to latest versions; retains only ARM Mac builds
packages/taro-components/scripts/stencil/stencil.config.ts Adds browser args for sandboxed CI environments; improves comment formatting with proper spacing
Comments suppressed due to low confidence (1)

.github/workflows/build-rust-binding.yml:38

  • [nitpick] The removal of the x86_64-apple-darwin build target (Intel Mac) means the project will no longer build native bindings for Intel-based Macs, only for ARM-based Macs (aarch64-apple-darwin).

While Apple Silicon is now the standard, there are still users on Intel-based Macs who may need these bindings. Ensure this is an intentional decision and that either:

  1. Intel Mac users are no longer supported, or
  2. Rosetta 2 translation is acceptable for Intel Mac users (ARM binaries can run on Intel Macs via Rosetta, but with performance overhead)

Consider documenting this architecture support change in release notes if this represents a change in platform support policy.

        settings:
          - host: windows-latest
            build: pnpm build:binding:release
            target: x86_64-pc-windows-msvc
          - host: ubuntu-latest
            target: x86_64-unknown-linux-gnu
            docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
            build: |-
              set -e &&
              npm install -g corepack@0.31.0 &&
              pnpm build:binding:release --target x86_64-unknown-linux-gnu &&
              strip crates/native_binding/*.node
          - host: ubuntu-latest
            target: x86_64-unknown-linux-musl
            docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
            build: set -e && pnpm build:binding:release && strip crates/native_binding/*.node
          - host: macos-latest
            target: aarch64-apple-darwin
            build: |
              pnpm build:binding:release --target aarch64-apple-darwin
              strip -x crates/native_binding/*.node

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ianzone
Copy link
Contributor Author

ianzone commented Dec 9, 2025

macOS-13 已弃用,请及时更新分支保护规则@luckyadam @tutuxxx

@ianzone
Copy link
Contributor Author

ianzone commented Dec 9, 2025

macOS-13 已弃用,请及时更新分支保护规则@luckyadam @tutuxxx

@yoyo837 兄弟有更新权限吗?现在所有macOS-13的CI都跑不了了
image

@yoyo837
Copy link
Contributor

yoyo837 commented Dec 9, 2025

macOS-13 已弃用,请及时更新分支保护规则@luckyadam @tutuxxx

@yoyo837 兄弟有更新权限吗?现在所有macOS-13的CI都跑不了了 image

我没有,我给群里吆喝一下吧。

@yoyo837
Copy link
Contributor

yoyo837 commented Dec 9, 2025

现在所有macOS-13的CI都跑不了了

先撤回 #18649?

@yoyo837
Copy link
Contributor

yoyo837 commented Dec 9, 2025

按理说,node 目前应该最低的 LTS 是20,为什么只留22、24呢?

@ianzone
Copy link
Contributor Author

ianzone commented Dec 9, 2025

按理说,node 目前应该最低的 LTS 是20,为什么只留22、24呢?

这个PR初衷也是想把node版本更新了

@yoyo837
Copy link
Contributor

yoyo837 commented Dec 9, 2025

Taro 目前以稳定为主,如果不是必须,最好不动。

@ianzone
Copy link
Contributor Author

ianzone commented Dec 9, 2025

反正18必须弃用了,依赖也陆续不支持18了,20在5个月后也将弃用,还不如从现在起紧跟头两个LTS

@ianzone
Copy link
Contributor Author

ianzone commented Dec 9, 2025

Taro 目前以稳定为主,如果不是必须,最好不动。

如果现在没有人手处理24可能的问题的话,那就保留20,等5个月后弃用了再更24

@ianzone
Copy link
Contributor Author

ianzone commented Dec 9, 2025

@yoyo837 咋说?保留20还是24?

@yoyo837
Copy link
Contributor

yoyo837 commented Dec 9, 2025

@yoyo837 咋说?保留20还是24?

能不动则不动

@ianzone ianzone changed the title chore: node24 chore: node22 Dec 9, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/sync-components-types.yml (1)

44-48: 注意 ts-node 兼容性问题(第 44 行注释)

注释表明当前同步脚本与 ts-node 在 Node 20+ 存在兼容问题,已标记为待修复。升级至 Node 22 后,需要确认 pnpm --filter=@tarojs/components run sync:types 脚本(第 57 行)的执行状态。

建议在此 PR 合并后跟进 ts-node 兼容性修复,或在下一次 CI 运行中监控该步骤是否有报错。

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0a97428 and b104fd7.

📒 Files selected for processing (3)
  • .github/workflows/nodejs.yml (1 hunks)
  • .github/workflows/publish.yml (2 hunks)
  • .github/workflows/sync-components-types.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/nodejs.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
🔇 Additional comments (4)
.github/workflows/publish.yml (3)

101-104: 更新 Node.js 版本至 22,步骤名称改为通用标签

此变更与 PR 目标一致,将 Node 版本从 18 升级到 22 以支持最新 LTS。步骤名称改为 "Setup Node" 更加通用,便于未来灵活调整版本。


178-178: 正确的拼写修正

步骤名称从 "Checkout Harmony Commond Line Tools" 改为 "Checkout Harmony Command Line Tools",正确修复了拼写错误。


171-171: The -r flag is unnecessary for this workflow; pnpm install works equivalently in the Taro monorepo.

In Taro's pnpm workspace, pnpm install executed at the repository root automatically performs a recursive installation across all workspace packages because pnpm's recursiveInstall defaults to true. This means pnpm install --frozen-lockfile and pnpm -r install --frozen-lockfile are functionally equivalent when run from the root directory.

.github/workflows/sync-components-types.yml (1)

45-48: Node.js 版本升级至 22,与发布工作流一致

此更新与 .github/workflows/publish.yml 中的 Node 版本升级保持一致,符合 PR 目标。步骤名称也改为通用标签。

@ianzone
Copy link
Contributor Author

ianzone commented Dec 9, 2025

@yoyo837 咋说?保留20还是24?

能不动则不动

留了20,删了24

@ianzone
Copy link
Contributor Author

ianzone commented Dec 11, 2025

@yoyo837 这个可以先合吗?还是说要等人先更新分支保护规则

@yoyo837
Copy link
Contributor

yoyo837 commented Dec 11, 2025

不更新的话,合上去也没有用吧?

@ianzone
Copy link
Contributor Author

ianzone commented Dec 11, 2025

不更新的话,合上去也没有用吧?

合上去至少可以让CI跑起来,只是会有pending checks

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