Skip to content

Commit 58ce338

Browse files
committed
chore: node24
1 parent a018f9d commit 58ce338

File tree

1 file changed

+114
-0
lines changed

1 file changed

+114
-0
lines changed

.github/workflows/nodejs.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,120 @@ jobs:
146146
with:
147147
token: ${{ secrets.CODECOV_TOKEN }}
148148

149+
nodejs-testing-new:
150+
name: Testing on Node.js ${{ matrix.node-version }} (${{ matrix.host }})
151+
needs:
152+
- build-rust-binding
153+
- build-rust-wasm
154+
strategy:
155+
matrix:
156+
node-version: [22, 24]
157+
host: [macos-13, macos-latest, windows-latest, ubuntu-latest]
158+
exclude:
159+
- node-version: 22
160+
host: macos-13
161+
- node-version: 22
162+
host: macos-latest
163+
- node-version: 22
164+
host: windows-latest
165+
include:
166+
- host: macos-13
167+
target: x86_64-apple-darwin
168+
- host: macos-latest
169+
target: aarch64-apple-darwin
170+
- host: windows-latest
171+
target: x86_64-pc-windows-msvc
172+
- host: ubuntu-latest
173+
target: x86_64-unknown-linux-gnu
174+
- host: ubuntu-latest
175+
target: x86_64-unknown-linux-musl
176+
177+
runs-on: ${{ matrix.host }}
178+
steps:
179+
- name: Checkout
180+
uses: actions/checkout@v5
181+
- name: Setup pnpm
182+
uses: pnpm/action-setup@v4
183+
with:
184+
version: 10
185+
- name: Setup Node.js ${{ matrix.node-version }}
186+
uses: actions/setup-node@v6
187+
with:
188+
node-version: ${{ matrix.node-version }}
189+
cache: 'pnpm'
190+
- name: Install dependencies
191+
run: pnpm install --frozen-lockfile
192+
- name: Lint
193+
run: pnpm lint
194+
- name: Download artifact bindings-${{ matrix.target }}
195+
uses: actions/download-artifact@v6
196+
with:
197+
name: bindings-${{ matrix.target }}
198+
path: crates/native_binding
199+
- name: Test bindings
200+
run: pnpm test:binding
201+
if: ${{ matrix.host != 'ubuntu-latest' }}
202+
- name: Test bindings with docker
203+
if: ${{ matrix.host == 'ubuntu-latest' }}
204+
# 暂时使用了一个第三方的 docker 镜像
205+
run: docker run --rm -v $(pwd):/build -w /build chf007/pnpm pnpm test:binding
206+
# 以下的测试流程应该在所有平台都执行,但 windows 好像还有些问题,因此目前只在 ubuntu-latest 执行
207+
- name: Download all artifacts
208+
uses: actions/download-artifact@v6
209+
with:
210+
path: crates/native_binding/artifacts
211+
- name: List Package crates/native_binding
212+
run: ls -R ./crates/native_binding
213+
shell: bash
214+
- name: Move artifacts
215+
run: pnpm artifacts
216+
- name: build
217+
shell: bash
218+
run: |
219+
if [ "${{ matrix.host }}" = "windows-latest" ]; then
220+
pnpm build:serial
221+
else
222+
pnpm build
223+
fi
224+
env:
225+
NODE_OPTIONS: --max_old_space_size=4096
226+
- name: test
227+
run: pnpm test
228+
# 以下 coverage 流程通过 artifact 拆分文件作为单独 job 上传时间损耗过长,因此在在 node test 后直接继续执行
229+
- name: Upload [taro-cli] coverage to Codecov
230+
uses: codecov/codecov-action@v5
231+
if: ${{ matrix.host == 'ubuntu-latest' }}
232+
with:
233+
flags: taro-cli
234+
files: ./packages/taro-cli/coverage/clover.xml
235+
token: ${{ secrets.CODECOV_TOKEN }}
236+
- name: Upload runner coverage to Codecov
237+
uses: codecov/codecov-action@v5
238+
if: ${{ matrix.host == 'ubuntu-latest' }}
239+
with:
240+
flags: taro-runner
241+
files: ./packages/taro-webpack5-runner/coverage/clover.xml
242+
token: ${{ secrets.CODECOV_TOKEN }}
243+
- name: Upload [taro-runtime] coverage to Codecov
244+
uses: codecov/codecov-action@v5
245+
if: ${{ matrix.host == 'ubuntu-latest' }}
246+
with:
247+
flags: taro-runtime
248+
files: ./packages/taro-runtime/coverage/clover.xml
249+
token: ${{ secrets.CODECOV_TOKEN }}
250+
- name: Upload [taro-web] coverage to Codecov
251+
uses: codecov/codecov-action@v5
252+
if: ${{ matrix.host == 'ubuntu-latest' }}
253+
with:
254+
flags: taro-web
255+
files: ./packages/taro-components/coverage/clover.xml,./packages/taro-h5/coverage/clover.xml,./packages/taro-router/coverage/clover.xml
256+
token: ${{ secrets.CODECOV_TOKEN }}
257+
- name: Upload rest coverage to Codecov
258+
uses: codecov/codecov-action@v5
259+
if: ${{ matrix.host == 'ubuntu-latest' }}
260+
with:
261+
token: ${{ secrets.CODECOV_TOKEN }}
262+
149263
rust-testing:
150264
name: Testing on Rust
151265
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)