Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading