Skip to content

chore: ci update#18573

Merged
yoyo837 merged 3 commits intoNervJS:mainfrom
ianzone:ci
Nov 6, 2025
Merged

chore: ci update#18573
yoyo837 merged 3 commits intoNervJS:mainfrom
ianzone:ci

Conversation

@ianzone
Copy link
Copy Markdown
Contributor

@ianzone ianzone commented Nov 6, 2025

这个 PR 做了什么? (简要描述所做更改)

  1. 更新 CI 依赖
  2. 在 matrix 中将 exclude 置于 include 之前。由于 include 优先级大于 exclude,该顺序调整符合阅读时的直觉
  3. 去掉 CI = true,因为 GitHub 自带了 https://github.blog/changelog/2020-04-15-github-actions-sets-the-ci-environment-variable-to-true/
  4. 去掉 pnpm store prune,因为 pnpm/action-setup@v4 会自动执行

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

  • 错误修复 (Bugfix) issue: fix #
  • 新功能 (Feature)
  • 代码重构 (Refactor)
  • TypeScript 类型定义修改 (Types)
  • 文档修改 (Docs)
  • 代码风格更新 (Code style update)
  • 构建优化 (Chore)
  • 其他,请描述 (Other, please describe):

这个 PR 涉及以下平台:

  • 所有平台
  • Web 端(H5)
  • 移动端(React-Native)
  • 鸿蒙(Harmony)
  • 鸿蒙容器(Harmony Hybrid)
  • ASCF 元服务
  • 快应用(QuickApp)
  • 所有小程序
  • 微信小程序
  • 企业微信小程序
  • 京东小程序
  • 百度小程序
  • 支付宝小程序
  • 支付宝 IOT 小程序
  • 钉钉小程序
  • QQ 小程序
  • 飞书小程序
  • 快手小程序
  • 头条小程序

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 6, 2025

概览

跨多个 GitHub Actions 工作流文件更新依赖项版本,包括 actions/checkout 从 v4 升级到 v5、actions/setup-node 从 v4 升级到 v6、actions/download-artifact 从 v4 升级到 v6,并修复 YAML 格式问题。nodejs.yml 重新引入了显式的目标映射配置。

变更

内聚组 / 文件 变更摘要
GitHub Actions 版本升级
.github/workflows/auto-review.yml, .github/workflows/build-rust-binding.yml, .github/workflows/build-rust-wasm.yml, .github/workflows/dependabot-update-lockfile.yml, .github/workflows/issue-labeler.yml, .github/workflows/nodejs.yml, .github/workflows/publish.yml, .github/workflows/sync-components-types.yml
actions/checkout 从 v4 升级到 v5;在多个工作流中将 actions/setup-node 从 v4 升级到 v6;将 actions/download-artifact 从 v4 升级到 v6(在 nodejs.yml 和 publish.yml 中)
YAML 格式规范化
.github/workflows/auto-review.yml, .github/workflows/issue-labeler.yml, .github/workflows/publish.yml, .github/workflows/sync-components-types.yml
统一步骤名称格式(修复 name : GITHUB CONTEXTname: GITHUB CONTEXT);规范化引号风格;修复缩进;确保尾部换行符
NodeJS 工作流矩阵重构
.github/workflows/nodejs.yml
从注释掉的矩阵条目转换为显式的 include 块,重新引入目标映射(x86_64-apple-darwin、x86_64-pc-windows-msvc、x86_64-unknown-linux-gnu 等);移除 pnpm store prune 清理步骤;移除测试步骤中的 CI 环境变量
字符串字面量规范化
.github/workflows/dependabot-update-lockfile.yml, .github/workflows/publish.yml, .github/workflows/sync-components-types.yml
调整引号风格以确保一致性(如 "v" 改为 'v'"_manifest/spdx_2.2/" 改为 '_manifest/spdx_2.2/'

估计代码审查工作量

🎯 2 (简单) | ⏱️ ~12 分钟

  • nodejs.yml 需要额外审查:矩阵重构从注释配置改为显式 include 块,需验证目标映射的正确性和完整性
  • 重复模式:大多数变更是同质化的版本升级和格式修复,降低了总体审查复杂度
  • 依赖升级:确保 GitHub Actions 新版本与工作流逻辑兼容

可能相关的 PR

建议的审查者

  • yoyo837
  • tutuxxx
  • luckyadam

诗歌

🐰 工作流迎新春,actions 升级闪闪金,
格式整齐又通顺,版本号齐步走,
CI/CD 跑得更欢快,兔子为君庆祝! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive 标题过于宽泛,未能准确反映变更的具体内容,仅使用通用的'ci update'术语。 建议将标题改为更具体的描述,如'chore: upgrade GitHub Actions versions in CI workflows'或'chore: update GitHub Actions to v5/v6',以更清晰地说明主要变更内容。
✅ Passed checks (1 passed)
Check name Status Explanation
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
Copy Markdown

@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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3d0ba18 and f8d0b11.

📒 Files selected for processing (8)
  • .github/workflows/auto-review.yml (1 hunks)
  • .github/workflows/build-rust-binding.yml (1 hunks)
  • .github/workflows/build-rust-wasm.yml (1 hunks)
  • .github/workflows/dependabot-update-lockfile.yml (2 hunks)
  • .github/workflows/issue-labeler.yml (3 hunks)
  • .github/workflows/nodejs.yml (3 hunks)
  • .github/workflows/publish.yml (7 hunks)
  • .github/workflows/sync-components-types.yml (3 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-07-01T15:46:08.457Z
Learnt from: ianzone
Repo: NervJS/taro PR: 17937
File: .github/workflows/issue-labeler.yml:31-31
Timestamp: 2025-07-01T15:46:08.457Z
Learning: stefanbuck/github-issue-parserv3 GitHub Action 的输出字段名称是 `jsonString`,不是 `json`。在工作流中应该使用 `${{ steps.issue-parser.outputs.jsonString }}` 来引用解析后的 JSON 数据。

Applied to files:

  • .github/workflows/issue-labeler.yml
📚 Learning: 2025-08-09T21:41:18.741Z
Learnt from: ianzone
Repo: NervJS/taro PR: 17842
File: .github/workflows/merged.yml:34-41
Timestamp: 2025-08-09T21:41:18.741Z
Learning: 在 NervJS/taro 项目中,merged.yml workflow 故意使用 actions/upload-artifact 而非 actions/cache/save 来保存公共 NX 缓存,因为 Artifact 具有更长的保留时间(最多 90 天),而 Actions Cache 仅保留 7 天。缓存键采用精确匹配策略,不使用 restore-keys 前缀匹配。

Applied to files:

  • .github/workflows/nodejs.yml
📚 Learning: 2025-08-08T02:32:58.265Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18146
File: packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json:12-14
Timestamp: 2025-08-08T02:32:58.265Z
Learning: 在 Taro 项目的 pnpm 工作区中,Vitest 相关依赖(vitest 和 vitest/coverage-istanbul)被管理在根目录的 package.json 中,而不是各个子包的 devDependencies 中。这是 monorepo 中依赖提升的标准做法。

Applied to files:

  • .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). (5)
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
🔇 Additional comments (16)
.github/workflows/issue-labeler.yml (2)

20-20: 新增 checkout action。

新增 checkout@v5 符合系统性工作流升级的需求。此前工作流似乎缺少显式的checkout步骤,现在添加可确保最新的issue template文件被正确解析。


4-4: 验证 actions/checkout@v5 运行时要求,确保 Actions Runner 满足最低版本条件。

YAML 数组格式化改进([ opened ][opened])符合 YAML 最佳实践。checkout@v5 升级至 Node 24 运行时,需要 Actions Runner 最低版本 v2.327.1。请确认工作流所在的环境满足此要求。若环境已使用现代版本的 GitHub Actions Runner,则此变更可安全应用。

.github/workflows/dependabot-update-lockfile.yml (2)

31-31: 字符串引号风格统一。

filePath 从双引号改为单引号是YAML风格的一致性调整。功能无变化。


15-17: checkout@v5 升级与 dependabot PR 工作流兼容。

验证结果确认,actions/checkout@v5 不存在与 pull_request_target 事件相关的破坏性变更。v5 升级主要是运行时环境升级(Node 24、最低运行程序版本),现有的 pull_request/pull_request_target 使用模式仍然完全支持。代码中使用 github.head_ref 的方式在 v5 中继续有效。

.github/workflows/publish.yml (3)

366-366: 字符串引号风格统一。

git_tag_prefix: 'v' 使用单引号是YAML风格调整。功能无变化。


173-173: 验证 download-artifact@v6 与上传的制品兼容性。

下载由 action/upload-artifact@v3 及更早版本创建的制品不受支持。 Artifacts v4 与之前的版本不兼容——例如,使用 v3 上传的制品无法与 actions/download-artifact@v4 一起使用。

v6 更新至支持 Node v24.x,并将 @actions/artifact 升级至 v4.0.0。 由于 v6 与 v4/v5 使用相同的 @actions/artifact 后端,理论上应兼容 v4 上传的制品。

需手动确认以下内容:

  • .github/workflows/publish.yml 中 upload-artifact 使用的版本
  • 确保 upload-artifact 和 download-artifact 使用匹配的主版本(都是 v4+ 或都是 v3 及以下)
  • 验证制品命名约定 (bindings-${{ matrix.target }}) 在上传和下载步骤中保持一致

102-102: setup-node@v6 升级与 npm 认证兼容,无需修改。

代码实际配置已验证:工作流在第 102 行使用 setup-node@v6,并正确指定了 registry-url: 'https://registry.npmjs.org';第 396 行通过 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 设置认证。根据 setup-node v6 文档,该版本继续通过 env 中的 NODE_AUTH_TOKEN 配置 .npmrc,与此配置完全兼容,不存在破坏性改变。

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

22-22: YAML 语法规范化。

run: | 格式调整是YAML规范化。功能无变化。


64-68: PR 创建字符串使用单引号。

PR 的 body、branch、commit-message、title 都改为单引号字符串。这是YAML风格统一,功能无变化。


14-14: actions/checkout@v5 支持多仓库检出,无需修改。

actions/checkout@v5 的 README 文档仍然支持相同的多仓库场景(并排、嵌套、私有),不存在影响多仓库检出的特殊 breaking changes。工作流中的双重 checkout@v5(第 14 行和第 17 行)可以正常同步这两个仓库的类型定义。v5 的主要变化是运行时版本提升至 node24,需要确保 runner 版本不低于 v2.327.1。


46-46: setup-node@v6 完全兼容当前配置,无需修改

工作流中已显式指定 node-version: 18cache: 'pnpm'。v6 的破坏性变化(自动缓存限制为 npm)仅影响未显式设置缓存的情况;当前工作流显式配置了缓存,因此不受影响。Node 版本选择机制在 v6 中保持不变,node18 锁定将继续有效,ts-node 与 node20 的兼容性问题不会出现。

.github/workflows/build-rust-wasm.yml (1)

12-12: actions/checkout@v5 兼容性已验证。

v5 相比 v4 没有特性级别的破坏性变化,主要要求是运行时兼容性:Node 24 支持和 GitHub Actions Runner >= v2.327.1。对于标准的 GitHub 托管 Runner,这些要求已满足。升级安全,无需进一步操作。

.github/workflows/auto-review.yml (1)

14-14: actions/checkout@v5 升级安全可靠。

auto-review.yml 使用 runs-on: ubuntu-latest(GitHub 托管 runner),GitHub 自动维护该环境以支持最新的 actions,无需担心 v5 所需的 Node 24 runtime 或 Actions Runner 版本兼容性问题。YAML 格式化修正(移除 name : 中的多余空格)符合最佳实践。所有变更均正确无误。

.github/workflows/build-rust-binding.yml (1)

48-48: 工作流配置已正确处理 setup-node@v6 与 pnpm v10 的兼容性,无需修改。

验证结果确认配置完全符合 actions/setup-node@v6 的要求:pnpm/action-setup@v4 在 setup-node@v6 之前安装了 pnpm v10,且 setup-node 已显式配置 cache: 'pnpm'。这正是 v6 所要求的显式缓存启用模式(v6 不再自动为 pnpm 启用缓存)。多平台构建(macOS、Windows、Linux)配置正确,Docker 环境通过条件判断独立处理,无兼容性风险。

.github/workflows/nodejs.yml (2)

81-81: 验证完成:download-artifact@v6 与当前工作流配置兼容,无需修改。

已确认:

  • build-rust-binding.yml 使用 upload-artifact@v4 上传 bindings-${{ matrix.settings.target }}
  • nodejs.yml 使用 download-artifact@v6 下载相同工件,版本对齐且兼容(两者均基于 @actions/artifact v4)
  • Line 81 的 bindings-${{ matrix.target }} 命名模式与 v6 兼容
  • Line 94 的通用路径下载操作在 v6 中正常工作

v6 的主要变更(Node 24 运行时、@actions/artifact v4 依赖)已妥善处理,工作流配置无需调整。


66-66: setup-node@v6 的跨平台缓存配置已正确实现,无需修改。

根据web查询和工作流检查,您的担忧是有效的:setup-node@v6 在缓存行为上有重大变更,npm自动缓存,但yarn/pnpm需显式配置。

验证结果表明:工作流已正确处理此问题。在第72行,setup-node@v6已明确设置 cache: 'pnpm',而非依赖自动检测。配合pnpm/action-setup@v4的设置,该配置在所有三个平台(macos-13、windows-latest、ubuntu-latest)上保证一致的缓存和Node版本处理行为。

Comment thread .github/workflows/nodejs.yml
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 6, 2025

Codecov Report

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

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #18573   +/-   ##
=======================================
  Coverage   55.97%   55.97%           
=======================================
  Files         416      416           
  Lines       21563    21563           
  Branches     5282     5285    +3     
=======================================
  Hits        12070    12070           
- Misses       7915     8010   +95     
+ Partials     1578     1483   -95     
Flag Coverage Δ
taro-cli 72.85% <ø> (ø)
taro-runtime 59.87% <ø> (ø)
taro-web 53.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 46 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.

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