@@ -34,27 +34,22 @@ jobs:
34
34
build : yarn build --target x86_64-pc-windows-msvc
35
35
target : x86_64-pc-windows-msvc
36
36
- host : windows-latest
37
- build : |
38
- yarn build --target i686-pc-windows-msvc
39
- yarn test
37
+ build : yarn build --target i686-pc-windows-msvc
40
38
target : i686-pc-windows-msvc
41
39
- host : ubuntu-latest
42
40
target : x86_64-unknown-linux-gnu
43
41
build : yarn build --target x86_64-unknown-linux-gnu --use-napi-cross
44
42
- host : ubuntu-latest
45
43
target : x86_64-unknown-linux-musl
46
- build : yarn build -x -- target x86_64-unknown-linux-musl
44
+ build : yarn build -- target x86_64-unknown-linux-musl -x
47
45
- host : macos-latest
48
46
target : aarch64-apple-darwin
49
47
build : yarn build --target aarch64-apple-darwin
50
48
- host : ubuntu-latest
51
49
target : aarch64-unknown-linux-gnu
52
- build : CC=clang yarn build --target aarch64-unknown-linux-gnu --use-napi-cross
50
+ build : yarn build --target aarch64-unknown-linux-gnu --use-napi-cross
53
51
- host : ubuntu-latest
54
52
target : armv7-unknown-linux-gnueabihf
55
- setup : |
56
- sudo apt-get update
57
- sudo apt-get install gcc-arm-linux-gnueabihf -y
58
53
build : yarn build --target armv7-unknown-linux-gnueabihf --use-napi-cross
59
54
- host : ubuntu-latest
60
55
target : aarch64-linux-android
@@ -68,15 +63,35 @@ jobs:
68
63
- host : windows-latest
69
64
target : aarch64-pc-windows-msvc
70
65
build : yarn build --target aarch64-pc-windows-msvc
71
- name : stable - ${{ matrix.settings.target }} - node@20
66
+ - host : ubuntu-latest
67
+ target : riscv64gc-unknown-linux-gnu
68
+ build : |
69
+ sudo apt-get update
70
+ sudo apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu -y
71
+ export CC=riscv64-linux-gnu-gcc
72
+ export TARGET_CC=riscv64-linux-gnu-gcc
73
+ export CXX=riscv64-linux-gnu-g++
74
+ yarn build --target riscv64gc-unknown-linux-gnu
75
+ - host : ubuntu-latest
76
+ target : s390x-unknown-linux-gnu
77
+ build : |
78
+ export CC=clang
79
+ export CFLAGS="-fuse-ld=lld"
80
+ yarn build --target s390x-unknown-linux-gnu --use-napi-cross
81
+ - host : ubuntu-latest
82
+ target : powerpc64le-unknown-linux-gnu
83
+ build : yarn build --target powerpc64le-unknown-linux-gnu --use-napi-cross
84
+ - host : ubuntu-latest
85
+ target : aarch64-unknown-linux-ohos
86
+ build : yarn build --target aarch64-unknown-linux-ohos
87
+ name : stable - ${{ matrix.settings.target }} - node@22
72
88
runs-on : ${{ matrix.settings.host }}
73
89
steps :
74
90
- uses : actions/checkout@v5
75
91
- name : Setup node
76
92
uses : actions/setup-node@v4
77
- if : ${{ !matrix.settings.docker }}
78
93
with :
79
- node-version : 20
94
+ node-version : 22
80
95
cache : yarn
81
96
- name : Install
82
97
uses : dtolnay/rust-toolchain@stable
@@ -87,48 +102,43 @@ jobs:
87
102
uses : actions/cache@v4
88
103
with :
89
104
path : |
90
- ~/.cargo/registry
105
+ ~/.cargo/registry/index/
106
+ ~/.cargo/registry/cache/
91
107
~/.cargo/git/db/
92
- .cargo-cache
93
108
~/.napi-rs
109
+ .cargo-cache
94
110
target/
95
111
key : ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }}
96
- - uses : goto-bus-stop /setup-zig@v2
112
+ - uses : mlugg /setup-zig@v2
97
113
if : ${{ contains(matrix.settings.target, 'musl') }}
98
114
with :
99
- version : 0.13.0
115
+ version : 0.14.1
100
116
- name : Install cargo-zigbuild
101
117
uses : taiki-e/install-action@v2
102
118
if : ${{ contains(matrix.settings.target, 'musl') }}
103
119
env :
104
120
GITHUB_TOKEN : ${{ github.token }}
105
121
with :
106
122
tool : cargo-zigbuild
123
+ - name : Setup OpenHarmony SDK
124
+ if : ${{ contains(matrix.settings.target, 'ohos') }}
125
+ uses :
openharmony-rs/[email protected]
107
126
- name : Setup toolchain
108
127
run : ${{ matrix.settings.setup }}
109
128
if : ${{ matrix.settings.setup }}
110
129
shell : bash
111
- - name : Setup node x86
112
- if : matrix.settings.target == 'i686-pc-windows-msvc'
113
- run : yarn config set supportedArchitectures.cpu "ia32"
114
- shell : bash
115
130
- name : Install dependencies
116
131
run : yarn install
117
- - name : Setup node x86
118
- uses : actions/setup-node@v4
119
- if : matrix.settings.target == 'i686-pc-windows-msvc'
120
- with :
121
- node-version : 20
122
- cache : yarn
123
- architecture : x86
124
132
- name : Build
125
133
run : ${{ matrix.settings.build }}
126
134
shell : bash
127
135
- name : Upload artifact
128
136
uses : actions/upload-artifact@v4
129
137
with :
130
138
name : bindings-${{ matrix.settings.target }}
131
- path : ${{ env.APP_NAME }}.*.node
139
+ path : |
140
+ ${{ env.APP_NAME }}.*.node
141
+ ${{ env.APP_NAME }}.*.wasm
132
142
if-no-files-found : error
133
143
build-freebsd :
134
144
runs-on : ubuntu-latest
@@ -196,8 +206,8 @@ jobs:
196
206
target : x86_64-pc-windows-msvc
197
207
architecture : x64
198
208
node :
199
- - ' 18'
200
209
- ' 20'
210
+ - ' 22'
201
211
runs-on : ${{ matrix.settings.host }}
202
212
steps :
203
213
- uses : actions/checkout@v5
@@ -210,7 +220,7 @@ jobs:
210
220
- name : Install dependencies
211
221
run : yarn install --mode=skip-build
212
222
- name : Download artifacts
213
- uses : actions/download-artifact@v4
223
+ uses : actions/download-artifact@v5
214
224
with :
215
225
name : bindings-${{ matrix.settings.target }}
216
226
path : .
@@ -219,191 +229,85 @@ jobs:
219
229
shell : bash
220
230
- name : Test bindings
221
231
run : yarn test
222
- test-linux-x64-gnu-binding :
223
- name : Test bindings on Linux-x64-gnu - node@${{ matrix.node }}
224
- needs :
225
- - build
226
- strategy :
227
- fail-fast : false
228
- matrix :
229
- node :
230
- - ' 18'
231
- - ' 20'
232
- runs-on : ubuntu-latest
233
- steps :
234
- - uses : actions/checkout@v5
235
- - name : Setup node
236
- uses : actions/setup-node@v4
237
- with :
238
- node-version : ${{ matrix.node }}
239
- cache : yarn
240
- - name : Install dependencies
241
- run : yarn install
242
- - name : Download artifacts
243
- uses : actions/download-artifact@v4
244
- with :
245
- name : bindings-x86_64-unknown-linux-gnu
246
- path : .
247
- - name : List packages
248
- run : ls -R .
249
- shell : bash
250
- - name : Test bindings
251
- run : docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-slim yarn test
252
- test-linux-x64-musl-binding :
253
- name : Test bindings on x86_64-unknown-linux-musl - node@${{ matrix.node }}
232
+ test-linux-binding :
233
+ name : Test ${{ matrix.target }} - node@${{ matrix.node }}
254
234
needs :
255
235
- build
256
236
strategy :
257
237
fail-fast : false
258
238
matrix :
239
+ target :
240
+ - x86_64-unknown-linux-gnu
241
+ - x86_64-unknown-linux-musl
242
+ - aarch64-unknown-linux-gnu
243
+ - aarch64-unknown-linux-musl
244
+ - armv7-unknown-linux-gnueabihf
245
+ - s390x-unknown-linux-gnu
259
246
node :
260
- - ' 18'
261
247
- ' 20'
262
- runs-on : ubuntu-latest
248
+ - ' 22'
249
+ runs-on : ${{ contains(matrix.target, 'aarch64') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
263
250
steps :
264
251
- uses : actions/checkout@v5
265
252
- name : Setup node
266
253
uses : actions/setup-node@v4
267
254
with :
268
255
node-version : ${{ matrix.node }}
269
256
cache : yarn
270
- - name : Install dependencies
271
- run : |
272
- yarn config set supportedArchitectures.libc "musl"
273
- yarn install --mode=skip-build
274
- - name : Download artifacts
275
- uses : actions/download-artifact@v4
276
- with :
277
- name : bindings-x86_64-unknown-linux-musl
278
- path : .
279
- - name : List packages
280
- run : ls -R .
281
- shell : bash
282
- - name : Test bindings
283
- run : docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-alpine yarn test
284
- test-linux-aarch64-gnu-binding :
285
- name : Test bindings on aarch64-unknown-linux-gnu - node@${{ matrix.node }}
286
- needs :
287
- - build
288
- strategy :
289
- fail-fast : false
290
- matrix :
291
- node :
292
- - ' 20'
293
- - ' 22'
294
- runs-on : ubuntu-latest
295
- steps :
296
- - uses : actions/checkout@v5
297
- - name : Download artifacts
298
- uses : actions/download-artifact@v4
299
- with :
300
- name : bindings-aarch64-unknown-linux-gnu
301
- path : .
302
- - name : List packages
303
- run : ls -R .
304
- shell : bash
305
- - name : Install dependencies
257
+ - name : Output docker params
258
+ id : docker
306
259
run : |
307
- yarn config set supportedArchitectures.cpu "arm64"
308
- yarn config set supportedArchitectures.libc "glibc"
309
- yarn install --mode=skip-build
310
- - name : Set up QEMU
311
- uses : docker/setup-qemu-action@v3
312
- with :
313
- platforms : arm64
314
- - run : docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
315
- - name : Setup and run tests
316
- uses : addnab/docker-run-action@v3
317
- with :
318
- image : node:${{ matrix.node }}-slim
319
- options : ' --platform linux/arm64 -v ${{ github.workspace }}:/build -w /build'
320
- run : |
321
- set -e
322
- yarn test
323
- ls -la
324
- test-linux-aarch64-musl-binding :
325
- name : Test bindings on aarch64-unknown-linux-musl - node@lts
326
- needs :
327
- - build
328
- runs-on : ubuntu-latest
329
- steps :
330
- - uses : actions/checkout@v5
331
- - name : Download artifacts
332
- uses : actions/download-artifact@v4
333
- with :
334
- name : bindings-aarch64-unknown-linux-musl
335
- path : .
336
- - name : List packages
337
- run : ls -R .
338
- shell : bash
260
+ node -e "
261
+ if ('${{ matrix.target }}'.startsWith('aarch64')) {
262
+ console.log('PLATFORM=linux/arm64')
263
+ } else if ('${{ matrix.target }}'.startsWith('armv7')) {
264
+ console.log('PLATFORM=linux/arm/v7')
265
+ } else if ('${{ matrix.target }}'.startsWith('s390x')) {
266
+ console.log('PLATFORM=linux/s390x')
267
+ } else {
268
+ console.log('PLATFORM=linux/amd64')
269
+ }
270
+ " >> $GITHUB_OUTPUT
271
+ node -e "
272
+ if ('${{ matrix.target }}'.endsWith('-musl')) {
273
+ console.log('IMAGE=node:${{ matrix.node }}-alpine')
274
+ } else {
275
+ console.log('IMAGE=node:${{ matrix.node }}-slim')
276
+ }
277
+ " >> $GITHUB_OUTPUT
339
278
- name : Install dependencies
340
279
run : |
341
- yarn config set supportedArchitectures.cpu "arm64"
342
- yarn config set supportedArchitectures.libc "musl"
343
- yarn install --mode=skip-build
344
- - name : Set up QEMU
345
- uses : docker/setup-qemu-action@v3
346
- with :
347
- platforms : arm64
348
- - run : docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
349
- - name : Setup and run tests
350
- uses : addnab/docker-run-action@v3
351
- with :
352
- image : node:lts-alpine
353
- options : ' --platform linux/arm64 -v ${{ github.workspace }}:/build -w /build'
354
- run : |
355
- set -e
356
- yarn test
357
- test-linux-arm-gnueabihf-binding :
358
- name : Test bindings on armv7-unknown-linux-gnueabihf - node@${{ matrix.node }}
359
- needs :
360
- - build
361
- strategy :
362
- fail-fast : false
363
- matrix :
364
- node :
365
- - ' 18'
366
- - ' 20'
367
- runs-on : ubuntu-latest
368
- steps :
369
- - uses : actions/checkout@v5
280
+ yarn config set --json supportedArchitectures.cpu '["current", "arm64", "x64", "arm", "s390x"]'
281
+ yarn config set --json supportedArchitectures.libc '["current", "musl", "gnu"]'
282
+ yarn install
370
283
- name : Download artifacts
371
- uses : actions/download-artifact@v4
284
+ uses : actions/download-artifact@v5
372
285
with :
373
- name : bindings-armv7-unknown-linux-gnueabihf
286
+ name : bindings-${{ matrix.target }}
374
287
path : .
375
288
- name : List packages
376
289
run : ls -R .
377
290
shell : bash
378
- - name : Install dependencies
379
- run : |
380
- yarn config set supportedArchitectures.cpu "arm"
381
- yarn install --mode=skip-build
382
291
- name : Set up QEMU
383
292
uses : docker/setup-qemu-action@v3
293
+ if : ${{ !contains(matrix.target, 'aarch64') }}
384
294
with :
385
- platforms : arm
295
+ platforms : all
386
296
- run : docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
387
- - name : Setup and run tests
297
+ if : ${{ !contains(matrix.target, 'aarch64') }}
298
+ - name : Test bindings
388
299
uses : addnab/docker-run-action@v3
389
300
with :
390
- image : node:${{ matrix.node }}-bullseye-slim
391
- options : ' --platform linux/arm/v7 -v ${{ github.workspace }}:/build -w /build'
392
- run : |
393
- set -e
394
- yarn test
395
- ls -la
301
+ image : ${{ steps.docker.outputs.IMAGE }}
302
+ options : -v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }} --platform ${{ steps.docker.outputs.PLATFORM }}
303
+ run : yarn test
396
304
publish :
397
305
name : Publish
398
306
runs-on : ubuntu-latest
399
307
needs :
400
308
- build-freebsd
401
309
- test-macOS-windows-binding
402
- - test-linux-x64-gnu-binding
403
- - test-linux-x64-musl-binding
404
- - test-linux-aarch64-gnu-binding
405
- - test-linux-aarch64-musl-binding
406
- - test-linux-arm-gnueabihf-binding
310
+ - test-linux-binding
407
311
steps :
408
312
- uses : actions/checkout@v5
409
313
- name : Setup node
@@ -414,7 +318,7 @@ jobs:
414
318
- name : Install dependencies
415
319
run : yarn install --mode=skip-build
416
320
- name : Download all artifacts
417
- uses : actions/download-artifact@v4
321
+ uses : actions/download-artifact@v5
418
322
with :
419
323
path : artifacts
420
324
- name : Move artifacts
0 commit comments