@@ -33,138 +33,20 @@ jobs:
3333 uses : ./.github/workflows/build-rust-wasm.yml
3434
3535 nodejs-testing :
36- name : Testing on Node.js ${{ matrix.node-version }} (${{ matrix.host }})
37- needs :
38- - build-rust-binding
39- - build-rust-wasm
40- strategy :
41- matrix :
42- node-version : [18.x, 20.x]
43- host : [macos-13, windows-latest, ubuntu-latest]
44- exclude :
45- - node-version : 18.x
46- host : macos-13
47- - node-version : 18.x
48- host : windows-latest
49- - node-version : 20.x
50- host : macos-13
51- - node-version : 20.x
52- host : windows-latest
53- include :
54- - host : macos-13
55- target : x86_64-apple-darwin
56- - host : windows-latest
57- target : x86_64-pc-windows-msvc
58- - host : ubuntu-latest
59- target : x86_64-unknown-linux-gnu
60- - host : ubuntu-latest
61- target : x86_64-unknown-linux-musl
62-
63- runs-on : ${{ matrix.host }}
64- steps :
65- - name : Checkout
66- uses : actions/checkout@v5
67- - name : Setup pnpm
68- uses : pnpm/action-setup@v4
69- with :
70- version : 10
71- - name : Setup Node.js ${{ matrix.node-version }}
72- uses : actions/setup-node@v6
73- with :
74- node-version : ${{ matrix.node-version }}
75- cache : ' pnpm'
76- - name : Install dependencies
77- run : pnpm -r install --frozen-lockfile
78- - name : Lint
79- run : pnpm lint
80- - name : Download artifact bindings-${{ matrix.target }}
81- uses : actions/download-artifact@v6
82- with :
83- name : bindings-${{ matrix.target }}
84- path : crates/native_binding
85- - name : Test bindings
86- run : pnpm test:binding
87- if : ${{ matrix.host != 'ubuntu-latest' }}
88- - name : Test bindings with docker
89- if : ${{ matrix.host == 'ubuntu-latest' }}
90- # 暂时使用了一个第三方的 docker 镜像
91- run : docker run --rm -v $(pwd):/build -w /build chf007/pnpm pnpm test:binding
92- # 以下的测试流程应该在所有平台都执行,但 windows 好像还有些问题,因此目前只在 ubuntu-latest 执行
93- - name : Download all artifacts
94- uses : actions/download-artifact@v6
95- with :
96- path : crates/native_binding/artifacts
97- - name : List Package crates/native_binding
98- run : ls -R ./crates/native_binding
99- shell : bash
100- - name : Move artifacts
101- run : pnpm artifacts
102- - name : build
103- shell : bash
104- run : |
105- if [ "${{ matrix.host }}" = "windows-latest" ]; then
106- pnpm build:serial
107- else
108- pnpm build
109- fi
110- env :
111- NODE_OPTIONS : --max_old_space_size=4096
112- - name : test
113- run : pnpm test
114- # 以下 coverage 流程通过 artifact 拆分文件作为单独 job 上传时间损耗过长,因此在在 node test 后直接继续执行
115- - name : Upload [taro-cli] coverage to Codecov
116- uses : codecov/codecov-action@v5
117- if : ${{ matrix.host == 'ubuntu-latest' }}
118- with :
119- flags : taro-cli
120- files : ./packages/taro-cli/coverage/clover.xml
121- token : ${{ secrets.CODECOV_TOKEN }}
122- - name : Upload runner coverage to Codecov
123- uses : codecov/codecov-action@v5
124- if : ${{ matrix.host == 'ubuntu-latest' }}
125- with :
126- flags : taro-runner
127- files : ./packages/taro-webpack5-runner/coverage/clover.xml
128- token : ${{ secrets.CODECOV_TOKEN }}
129- - name : Upload [taro-runtime] coverage to Codecov
130- uses : codecov/codecov-action@v5
131- if : ${{ matrix.host == 'ubuntu-latest' }}
132- with :
133- flags : taro-runtime
134- files : ./packages/taro-runtime/coverage/clover.xml
135- token : ${{ secrets.CODECOV_TOKEN }}
136- - name : Upload [taro-web] coverage to Codecov
137- uses : codecov/codecov-action@v5
138- if : ${{ matrix.host == 'ubuntu-latest' }}
139- with :
140- flags : taro-web
141- files : ./packages/taro-components/coverage/clover.xml,./packages/taro-h5/coverage/clover.xml,./packages/taro-router/coverage/clover.xml
142- token : ${{ secrets.CODECOV_TOKEN }}
143- - name : Upload rest coverage to Codecov
144- uses : codecov/codecov-action@v5
145- if : ${{ matrix.host == 'ubuntu-latest' }}
146- with :
147- token : ${{ secrets.CODECOV_TOKEN }}
148-
149- nodejs-testing-new :
15036 name : Testing on Node.js ${{ matrix.node-version }} (${{ matrix.host }})
15137 needs :
15238 - build-rust-binding
15339 - build-rust-wasm
15440 strategy :
15541 matrix :
15642 node-version : [22, 24]
157- host : [macos-13, macos- latest, windows-latest, ubuntu-latest]
43+ host : [macos-latest, windows-latest, ubuntu-latest]
15844 exclude :
159- - node-version : 22
160- host : macos-13
16145 - node-version : 22
16246 host : macos-latest
16347 - node-version : 22
16448 host : windows-latest
16549 include :
166- - host : macos-13
167- target : x86_64-apple-darwin
16850 - host : macos-latest
16951 target : aarch64-apple-darwin
17052 - host : windows-latest
0 commit comments