From 58ce338690ba32a8aa96f93d0dd0e758be965b21 Mon Sep 17 00:00:00 2001 From: ian Date: Thu, 6 Nov 2025 17:25:50 +0800 Subject: [PATCH 1/5] chore: node24 --- .github/workflows/nodejs.yml | 114 +++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index d8f21be82b57..369d5f20e960 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -146,6 +146,120 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} + nodejs-testing-new: + name: Testing on Node.js ${{ matrix.node-version }} (${{ matrix.host }}) + needs: + - build-rust-binding + - build-rust-wasm + strategy: + matrix: + node-version: [22, 24] + host: [macos-13, macos-latest, windows-latest, ubuntu-latest] + exclude: + - node-version: 22 + host: macos-13 + - node-version: 22 + host: macos-latest + - node-version: 22 + host: windows-latest + include: + - host: macos-13 + target: x86_64-apple-darwin + - host: macos-latest + target: aarch64-apple-darwin + - host: windows-latest + target: x86_64-pc-windows-msvc + - host: ubuntu-latest + target: x86_64-unknown-linux-gnu + - host: ubuntu-latest + target: x86_64-unknown-linux-musl + + runs-on: ${{ matrix.host }} + steps: + - name: Checkout + uses: actions/checkout@v5 + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Lint + run: pnpm lint + - name: Download artifact bindings-${{ matrix.target }} + uses: actions/download-artifact@v6 + with: + name: bindings-${{ matrix.target }} + path: crates/native_binding + - name: Test bindings + run: pnpm test:binding + if: ${{ matrix.host != 'ubuntu-latest' }} + - name: Test bindings with docker + if: ${{ matrix.host == 'ubuntu-latest' }} + # 暂时使用了一个第三方的 docker 镜像 + run: docker run --rm -v $(pwd):/build -w /build chf007/pnpm pnpm test:binding + # 以下的测试流程应该在所有平台都执行,但 windows 好像还有些问题,因此目前只在 ubuntu-latest 执行 + - name: Download all artifacts + uses: actions/download-artifact@v6 + with: + path: crates/native_binding/artifacts + - name: List Package crates/native_binding + run: ls -R ./crates/native_binding + shell: bash + - name: Move artifacts + run: pnpm artifacts + - name: build + shell: bash + run: | + if [ "${{ matrix.host }}" = "windows-latest" ]; then + pnpm build:serial + else + pnpm build + fi + env: + NODE_OPTIONS: --max_old_space_size=4096 + - name: test + run: pnpm test + # 以下 coverage 流程通过 artifact 拆分文件作为单独 job 上传时间损耗过长,因此在在 node test 后直接继续执行 + - name: Upload [taro-cli] coverage to Codecov + uses: codecov/codecov-action@v5 + if: ${{ matrix.host == 'ubuntu-latest' }} + with: + flags: taro-cli + files: ./packages/taro-cli/coverage/clover.xml + token: ${{ secrets.CODECOV_TOKEN }} + - name: Upload runner coverage to Codecov + uses: codecov/codecov-action@v5 + if: ${{ matrix.host == 'ubuntu-latest' }} + with: + flags: taro-runner + files: ./packages/taro-webpack5-runner/coverage/clover.xml + token: ${{ secrets.CODECOV_TOKEN }} + - name: Upload [taro-runtime] coverage to Codecov + uses: codecov/codecov-action@v5 + if: ${{ matrix.host == 'ubuntu-latest' }} + with: + flags: taro-runtime + files: ./packages/taro-runtime/coverage/clover.xml + token: ${{ secrets.CODECOV_TOKEN }} + - name: Upload [taro-web] coverage to Codecov + uses: codecov/codecov-action@v5 + if: ${{ matrix.host == 'ubuntu-latest' }} + with: + flags: taro-web + files: ./packages/taro-components/coverage/clover.xml,./packages/taro-h5/coverage/clover.xml,./packages/taro-router/coverage/clover.xml + token: ${{ secrets.CODECOV_TOKEN }} + - name: Upload rest coverage to Codecov + uses: codecov/codecov-action@v5 + if: ${{ matrix.host == 'ubuntu-latest' }} + with: + token: ${{ secrets.CODECOV_TOKEN }} + rust-testing: name: Testing on Rust runs-on: ubuntu-latest From 600e3022a9c8545bdb4a3a017b95ec7fe9c0e6f9 Mon Sep 17 00:00:00 2001 From: ian Date: Wed, 12 Nov 2025 00:38:00 +0800 Subject: [PATCH 2/5] chore: remove mac13 --- .github/workflows/build-rust-binding.yml | 13 +-- .github/workflows/nodejs.yml | 120 +---------------------- 2 files changed, 5 insertions(+), 128 deletions(-) diff --git a/.github/workflows/build-rust-binding.yml b/.github/workflows/build-rust-binding.yml index 4250d336ea4a..4142a526b040 100644 --- a/.github/workflows/build-rust-binding.yml +++ b/.github/workflows/build-rust-binding.yml @@ -14,17 +14,12 @@ jobs: strategy: fail-fast: false matrix: - node-version: [18.x] + node-version: [22] settings: - - host: macos-13 - target: x86_64-apple-darwin - build: | - pnpm build:binding:release - strip -x crates/native_binding/*.node - host: windows-latest build: pnpm build:binding:release target: x86_64-pc-windows-msvc - - host: ubuntu-22.04 + - host: ubuntu-latest target: x86_64-unknown-linux-gnu docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian build: |- @@ -32,11 +27,11 @@ jobs: npm install -g corepack@0.31.0 && pnpm build:binding:release --target x86_64-unknown-linux-gnu && strip crates/native_binding/*.node - - host: ubuntu-22.04 + - 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-13 + - host: macos-latest target: aarch64-apple-darwin build: | pnpm build:binding:release --target aarch64-apple-darwin diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 369d5f20e960..b9bbcae110dc 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -33,120 +33,6 @@ jobs: uses: ./.github/workflows/build-rust-wasm.yml nodejs-testing: - name: Testing on Node.js ${{ matrix.node-version }} (${{ matrix.host }}) - needs: - - build-rust-binding - - build-rust-wasm - strategy: - matrix: - node-version: [18.x, 20.x] - host: [macos-13, windows-latest, ubuntu-latest] - exclude: - - node-version: 18.x - host: macos-13 - - node-version: 18.x - host: windows-latest - - node-version: 20.x - host: macos-13 - - node-version: 20.x - host: windows-latest - include: - - host: macos-13 - target: x86_64-apple-darwin - - host: windows-latest - target: x86_64-pc-windows-msvc - - host: ubuntu-latest - target: x86_64-unknown-linux-gnu - - host: ubuntu-latest - target: x86_64-unknown-linux-musl - - runs-on: ${{ matrix.host }} - steps: - - name: Checkout - uses: actions/checkout@v5 - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 10 - - name: Setup Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v6 - with: - node-version: ${{ matrix.node-version }} - cache: 'pnpm' - - name: Install dependencies - run: pnpm -r install --frozen-lockfile - - name: Lint - run: pnpm lint - - name: Download artifact bindings-${{ matrix.target }} - uses: actions/download-artifact@v6 - with: - name: bindings-${{ matrix.target }} - path: crates/native_binding - - name: Test bindings - run: pnpm test:binding - if: ${{ matrix.host != 'ubuntu-latest' }} - - name: Test bindings with docker - if: ${{ matrix.host == 'ubuntu-latest' }} - # 暂时使用了一个第三方的 docker 镜像 - run: docker run --rm -v $(pwd):/build -w /build chf007/pnpm pnpm test:binding - # 以下的测试流程应该在所有平台都执行,但 windows 好像还有些问题,因此目前只在 ubuntu-latest 执行 - - name: Download all artifacts - uses: actions/download-artifact@v6 - with: - path: crates/native_binding/artifacts - - name: List Package crates/native_binding - run: ls -R ./crates/native_binding - shell: bash - - name: Move artifacts - run: pnpm artifacts - - name: build - shell: bash - run: | - if [ "${{ matrix.host }}" = "windows-latest" ]; then - pnpm build:serial - else - pnpm build - fi - env: - NODE_OPTIONS: --max_old_space_size=4096 - - name: test - run: pnpm test - # 以下 coverage 流程通过 artifact 拆分文件作为单独 job 上传时间损耗过长,因此在在 node test 后直接继续执行 - - name: Upload [taro-cli] coverage to Codecov - uses: codecov/codecov-action@v5 - if: ${{ matrix.host == 'ubuntu-latest' }} - with: - flags: taro-cli - files: ./packages/taro-cli/coverage/clover.xml - token: ${{ secrets.CODECOV_TOKEN }} - - name: Upload runner coverage to Codecov - uses: codecov/codecov-action@v5 - if: ${{ matrix.host == 'ubuntu-latest' }} - with: - flags: taro-runner - files: ./packages/taro-webpack5-runner/coverage/clover.xml - token: ${{ secrets.CODECOV_TOKEN }} - - name: Upload [taro-runtime] coverage to Codecov - uses: codecov/codecov-action@v5 - if: ${{ matrix.host == 'ubuntu-latest' }} - with: - flags: taro-runtime - files: ./packages/taro-runtime/coverage/clover.xml - token: ${{ secrets.CODECOV_TOKEN }} - - name: Upload [taro-web] coverage to Codecov - uses: codecov/codecov-action@v5 - if: ${{ matrix.host == 'ubuntu-latest' }} - with: - flags: taro-web - files: ./packages/taro-components/coverage/clover.xml,./packages/taro-h5/coverage/clover.xml,./packages/taro-router/coverage/clover.xml - token: ${{ secrets.CODECOV_TOKEN }} - - name: Upload rest coverage to Codecov - uses: codecov/codecov-action@v5 - if: ${{ matrix.host == 'ubuntu-latest' }} - with: - token: ${{ secrets.CODECOV_TOKEN }} - - nodejs-testing-new: name: Testing on Node.js ${{ matrix.node-version }} (${{ matrix.host }}) needs: - build-rust-binding @@ -154,17 +40,13 @@ jobs: strategy: matrix: node-version: [22, 24] - host: [macos-13, macos-latest, windows-latest, ubuntu-latest] + host: [macos-latest, windows-latest, ubuntu-latest] exclude: - - node-version: 22 - host: macos-13 - node-version: 22 host: macos-latest - node-version: 22 host: windows-latest include: - - host: macos-13 - target: x86_64-apple-darwin - host: macos-latest target: aarch64-apple-darwin - host: windows-latest From 5ee148255ab0983b24f9ead734696b309b753cf3 Mon Sep 17 00:00:00 2001 From: ian Date: Wed, 12 Nov 2025 23:20:09 +0800 Subject: [PATCH 3/5] test: timeout --- packages/taro-components/scripts/stencil/stencil.config.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/taro-components/scripts/stencil/stencil.config.ts b/packages/taro-components/scripts/stencil/stencil.config.ts index 3208e0b8eaf4..52e486fa72e9 100644 --- a/packages/taro-components/scripts/stencil/stencil.config.ts +++ b/packages/taro-components/scripts/stencil/stencil.config.ts @@ -89,8 +89,8 @@ export const config: Config = { { components: ['taro-video-core', 'taro-video-control', 'taro-video-danmu'] } ], /** - * Note: Taro内部有很多地方都直接引用了dist/components,最终的编译产物中有很多super(),导致低版安装白屏 - * 为彻底解决此包导致的白屏问题,故暂不在包构建是转为es5,而是将此包加入到项目的babel编译中 + * Note: Taro 内部有很多地方都直接引用了 dist/components,最终的编译产物中有很多 super(),导致低版安装白屏 + * 为彻底解决此包导致的白屏问题,故暂不在包构建是转为 es5,而是将此包加入到项目的 babel 编译中 */ // buildEs5: 'prod', /** @@ -100,6 +100,7 @@ export const config: Config = { */ testing: { globals: { + testTimeout: 60000, 'ts-jest': { diagnostics: false, tsconfig: { From 0dac44bc6a35fb003e49898b052c3d347af6dade Mon Sep 17 00:00:00 2001 From: ian Date: Sun, 23 Nov 2025 22:38:43 +0800 Subject: [PATCH 4/5] test: puppeteer --- packages/taro-components/scripts/stencil/stencil.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/taro-components/scripts/stencil/stencil.config.ts b/packages/taro-components/scripts/stencil/stencil.config.ts index 52e486fa72e9..05cd6ecb250f 100644 --- a/packages/taro-components/scripts/stencil/stencil.config.ts +++ b/packages/taro-components/scripts/stencil/stencil.config.ts @@ -99,8 +99,8 @@ export const config: Config = { * 实际并不支持 clone 模式,暂不考虑修复 */ testing: { + browserArgs: ['--no-sandbox', '--disable-setuid-sandbox'], globals: { - testTimeout: 60000, 'ts-jest': { diagnostics: false, tsconfig: { From b104fd7959f474b0633b63000ae895b97a51a45b Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 9 Dec 2025 21:18:43 +0800 Subject: [PATCH 5/5] chore: node 22 --- .github/workflows/nodejs.yml | 6 +++--- .github/workflows/publish.yml | 8 ++++---- .github/workflows/sync-components-types.yml | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index b0261da8fe40..1b63d6f592f0 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -39,12 +39,12 @@ jobs: - build-rust-wasm strategy: matrix: - node-version: [22, 24] + node-version: [22, 20] host: [macos-latest, windows-latest, ubuntu-latest] exclude: - - node-version: 22 + - node-version: 20 host: macos-latest - - node-version: 22 + - node-version: 20 host: windows-latest include: - host: macos-latest diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 499b818a2362..cde2319f18ee 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -98,10 +98,10 @@ jobs: uses: pnpm/action-setup@v4 with: version: 10 - - name: Setup Node 18 + - name: Setup Node uses: actions/setup-node@v6 with: - node-version: 18 + node-version: 22 cache: 'pnpm' registry-url: 'https://registry.npmjs.org' # Don't touch! - name: Git Identity @@ -168,14 +168,14 @@ jobs: # Bootstrap project - name: Install dependencies - run: pnpm -r install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Download all artifacts uses: actions/download-artifact@v6 with: path: crates/native_binding/artifacts - name: Move artifacts run: pnpm artifacts - - name: Checkout Harmony Commond Line Tools + - name: Checkout Harmony Command Line Tools env: COMMANDLINE_TOOLS_URL: https://storage.360buyimg.com/taro-patch/command-line-tools-for-harmony/5.0.13.200/linux_x64 TOOLS_HOME: ${{ runner.os == 'macOS' && '~/harmony-tools' || '$HOME/harmony-tools' }} diff --git a/.github/workflows/sync-components-types.yml b/.github/workflows/sync-components-types.yml index d8ebdbe11f64..754edabcd3dd 100644 --- a/.github/workflows/sync-components-types.yml +++ b/.github/workflows/sync-components-types.yml @@ -42,10 +42,10 @@ jobs: args: [--frozen-lockfile, --strict-peer-dependencies] - args: [--filter @tarojs/components, -D, miniapp-types@latest] # Note: 当前同步脚本使用 ts-node 与 node20 存在兼容问题,修复后解除版本限制 - - name: Setup Node 18 + - name: Setup Node uses: actions/setup-node@v6 with: - node-version: 18 + node-version: 22 cache: 'pnpm' registry-url: 'https://registry.npmjs.org' # Don't touch!