63
63
- host : ubuntu-latest
64
64
target : aarch64-unknown-linux-musl
65
65
build : yarn build --target aarch64-unknown-linux-musl -x
66
+ - host : ubuntu-latest
67
+ target : powerpc64le-unknown-linux-gnu
68
+ build : |
69
+ sudo apt-get update
70
+ sudo apt-get install -y gcc-powerpc64le-linux-gnu
71
+ yarn build --target powerpc64le-unknown-linux-gnu
72
+ - host : ubuntu-latest
73
+ target : s390x-unknown-linux-gnu
74
+ build : |
75
+ sudo apt-get update
76
+ sudo apt-get install -y gcc-s390x-linux-gnu
77
+ yarn build --target s390x-unknown-linux-gnu
66
78
- host : windows-latest
67
79
target : aarch64-pc-windows-msvc
68
80
build : yarn build --target aarch64-pc-windows-msvc
@@ -95,16 +107,21 @@ jobs:
95
107
uses : actions/cache@v4
96
108
with :
97
109
path : |
98
- ~/.cargo/registry/index/
99
- ~/.cargo/registry/cache/
100
- ~/.cargo/git/db/
110
+ ~/.cargo
101
111
~/.napi-rs
102
112
target/
103
113
key : ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }}
104
114
- uses : goto-bus-stop/setup-zig@v2
105
115
if : ${{ contains(matrix.settings.target, 'musl') }}
106
116
with :
107
117
version : 0.13.0
118
+ - name : Install cargo-zigbuild
119
+ uses : taiki-e/install-action@v2
120
+ if : ${{ contains(matrix.settings.target, 'musl') }}
121
+ env :
122
+ GITHUB_TOKEN : ${{ github.token }}
123
+ with :
124
+ tool : cargo-zigbuild
108
125
- name : Setup toolchain
109
126
run : ${{ matrix.settings.setup }}
110
127
if : ${{ matrix.settings.setup }}
@@ -219,16 +236,30 @@ jobs:
219
236
shell : bash
220
237
- name : Test bindings
221
238
run : yarn test
222
- test-linux-x64-gnu- binding :
223
- name : Test bindings on Linux-x64-gnu - node@${{ matrix.node }}
239
+ test-linux-binding :
240
+ name : Test ${{ matrix.target }} - node@${{ matrix.node }}
224
241
needs :
225
242
- build
226
243
strategy :
227
244
fail-fast : false
228
245
matrix :
246
+ target :
247
+ - x86_64-unknown-linux-gnu
248
+ - x86_64-unknown-linux-musl
249
+ - aarch64-unknown-linux-gnu
250
+ - aarch64-unknown-linux-musl
251
+ - armv7-unknown-linux-gnueabihf
252
+ - s390x-unknown-linux-gnu
253
+ - powerpc64le-unknown-linux-gnu
229
254
node :
230
255
- ' 18'
231
256
- ' 20'
257
+ exclude :
258
+ # too slow
259
+ - target : aarch64-unknown-linux-gnu
260
+ node : ' 18'
261
+ - target : s390x-unknown-linux-gnu
262
+ node : ' 18'
232
263
runs-on : ubuntu-latest
233
264
steps :
234
265
- uses : actions/checkout@v4
@@ -237,162 +268,55 @@ jobs:
237
268
with :
238
269
node-version : ${{ matrix.node }}
239
270
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 }}
254
- needs :
255
- - build
256
- strategy :
257
- fail-fast : false
258
- matrix :
259
- node :
260
- - ' 18'
261
- - ' 20'
262
- runs-on : ubuntu-latest
263
- steps :
264
- - uses : actions/checkout@v4
265
- - name : Setup node
266
- uses : actions/setup-node@v4
267
- with :
268
- node-version : ${{ matrix.node }}
269
- cache : yarn
270
- - name : Install dependencies
271
- run : |
272
- yarn config set supportedArchitectures.libc "musl"
273
- yarn install
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
- - ' 18'
293
- - ' 20'
294
- runs-on : ubuntu-latest
295
- steps :
296
- - uses : actions/checkout@v4
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
271
+ - name : Output docker params
272
+ id : docker
306
273
run : |
307
- yarn config set supportedArchitectures.cpu "arm64"
308
- yarn config set supportedArchitectures.libc "glibc"
309
- yarn install
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@v4
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
274
+ node -e "
275
+ if ('${{ matrix.target }}'.startsWith('aarch64')) {
276
+ console.log('PLATFORM=linux/arm64')
277
+ } else if ('${{ matrix.target }}'.startsWith('armv7')) {
278
+ console.log('PLATFORM=linux/arm/v7')
279
+ } else if ('${{ matrix.target }}'.startsWith('powerpc64le')) {
280
+ console.log('PLATFORM=linux/ppc64le')
281
+ } else if ('${{ matrix.target }}'.startsWith('s390x')) {
282
+ console.log('PLATFORM=linux/s390x')
283
+ } else {
284
+ console.log('PLATFORM=linux/amd64')
285
+ }
286
+ " >> $GITHUB_OUTPUT
287
+ node -e "
288
+ if ('${{ matrix.target }}'.endsWith('-musl')) {
289
+ console.log('IMAGE=node:${{ matrix.node }}-alpine')
290
+ } else {
291
+ console.log('IMAGE=node:${{ matrix.node }}-slim')
292
+ }
293
+ " >> $GITHUB_OUTPUT
339
294
- name : Install dependencies
340
295
run : |
341
- yarn config set supportedArchitectures.cpu "arm64"
342
- yarn config set supportedArchitectures.libc "musl"
296
+ yarn config set --json supportedArchitectures.os '["current", "linux"]'
297
+ yarn config set --json supportedArchitectures.cpu '["current", "arm64", "arm", "ppc64", "s390x", "x64"]'
298
+ yarn config set --json supportedArchitectures.libc '["current", "glibc", "musl"]'
343
299
yarn install
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@v4
370
300
- name : Download artifacts
371
301
uses : actions/download-artifact@v4
372
302
with :
373
- name : bindings-armv7-unknown-linux-gnueabihf
303
+ name : bindings-${{ matrix.target }}
374
304
path : .
375
305
- name : List packages
376
306
run : ls -R .
377
307
shell : bash
378
- - name : Install dependencies
379
- run : |
380
- yarn config set supportedArchitectures.cpu "arm"
381
- yarn install
382
308
- name : Set up QEMU
383
309
uses : docker/setup-qemu-action@v3
384
310
with :
385
- platforms : arm
311
+ platforms : all
386
312
- run : docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
387
- - name : Setup and run tests
313
+ - name : Test bindings
388
314
uses : addnab/docker-run-action@v3
389
315
with :
390
- image : node:${{ matrix.node }}-slim
391
- options : ' --platform linux/arm/v7 -v ${{ github.workspace }}:/build -w /build'
392
- run : |
393
- set -e
394
- yarn test
395
- ls -la
316
+ image : ${{ steps.docker.outputs.IMAGE }}
317
+ options : -v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }} --platform ${{ steps.docker.outputs.PLATFORM }}
318
+ run : yarn run test
319
+
396
320
test-nodejs-wasi :
397
321
name : Test bindings on wasm32-wasi - node@${{ matrix.node }}
398
322
needs :
@@ -431,11 +355,7 @@ jobs:
431
355
needs :
432
356
- build-freebsd
433
357
- test-macOS-windows-binding
434
- - test-linux-x64-gnu-binding
435
- - test-linux-x64-musl-binding
436
- - test-linux-aarch64-gnu-binding
437
- - test-linux-aarch64-musl-binding
438
- - test-linux-arm-gnueabihf-binding
358
+ - test-linux-binding
439
359
- test-nodejs-wasi
440
360
steps :
441
361
- uses : actions/checkout@v4
0 commit comments