19
19
20
20
jobs :
21
21
build :
22
- if : " !contains(github.event.head_commit.message, 'skip ci')"
23
-
24
22
strategy :
25
23
fail-fast : false
26
24
matrix :
27
25
settings :
28
26
- host : macos-latest
29
27
target : ' x86_64-apple-darwin'
30
- build : |
31
- yarn build
32
- strip -x packages/*/*.node
28
+ build : yarn build --target x86_64-apple-darwin
33
29
- host : windows-latest
34
30
build : yarn build
35
31
target : ' x86_64-pc-windows-msvc'
@@ -40,16 +36,10 @@ jobs:
40
36
target : ' i686-pc-windows-msvc'
41
37
- host : ubuntu-latest
42
38
target : ' x86_64-unknown-linux-gnu'
43
- docker : ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
44
- build : >-
45
- set -e &&
46
- rustup target add x86_64-unknown-linux-gnu &&
47
- yarn build --target x86_64-unknown-linux-gnu &&
48
- strip packages/*/*.node
39
+ build : CC=clang yarn build --target x86_64-unknown-linux-gnu --use-napi-cross
49
40
- host : ubuntu-latest
50
41
target : ' x86_64-unknown-linux-musl'
51
- docker : ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
52
- build : yarn build
42
+ build : yarn build --target x86_64-unknown-linux-musl -x
53
43
- host : macos-latest
54
44
target : ' aarch64-apple-darwin'
55
45
build : |
@@ -59,63 +49,44 @@ jobs:
59
49
SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
60
50
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
61
51
yarn build --target aarch64-apple-darwin
62
- strip -x packages/*/*.node
63
52
- host : ubuntu-latest
64
53
target : aarch64-unknown-linux-gnu
65
- docker : ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
66
- build : >-
67
- rustup target add aarch64-unknown-linux-gnu &&
68
- yarn build --target aarch64-unknown-linux-gnu &&
69
- llvm-strip packages/*/*.node
54
+ build : CC=clang yarn build --target aarch64-unknown-linux-gnu --use-napi-cross
70
55
- host : ubuntu-latest
71
56
target : ' armv7-unknown-linux-gnueabihf'
72
- setup : |
73
- sudo apt-get update
74
- sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y
75
- build : yarn build --target armv7-unknown-linux-gnueabihf
57
+ build : CC=clang yarn build --target armv7-unknown-linux-gnueabihf --use-napi-cross
76
58
- host : ubuntu-latest
77
59
target : aarch64-linux-android
78
- build : |
79
- yarn build --target aarch64-linux-android
80
- ${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip packages/*/*.node
60
+ build : yarn build --target aarch64-linux-android
81
61
- host : ubuntu-latest
82
62
architecture : x64
83
63
target : armv7-linux-androideabi
84
- build : |
85
- yarn build --target armv7-linux-androideabi
86
- ${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip packages/*/*.node
64
+ build : yarn build --target armv7-linux-androideabi
87
65
- host : ubuntu-latest
88
66
target : ' aarch64-unknown-linux-musl'
89
67
downloadTarget : ' aarch64-unknown-linux-musl'
90
- docker : ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
91
- build : >-
92
- set -e &&
93
- rustup target add aarch64-unknown-linux-musl &&
94
- yarn build --target aarch64-unknown-linux-musl
68
+ build : yarn build --target aarch64-unknown-linux-musl -x
95
69
- host : windows-latest
96
70
target : ' aarch64-pc-windows-msvc'
97
- build : |
98
- npm i -g @napi-rs/cli
99
- yarn build --target aarch64-pc-windows-msvc
71
+ build : yarn build --target aarch64-pc-windows-msvc
100
72
101
- name : stable - ${{ matrix.settings.target }} - node@18
73
+ name : stable - ${{ matrix.settings.target }} - node@20
102
74
runs-on : ${{ matrix.settings.host }}
103
75
104
76
steps :
105
- - uses : actions/checkout@v3
77
+ - uses : actions/checkout@v4
106
78
107
79
- name : Setup node
108
80
uses : actions/setup-node@v4
109
81
if : ${{ !matrix.settings.docker }}
110
82
with :
111
- node-version : 18
83
+ node-version : 20
112
84
cache : yarn
113
85
114
86
- name : Install
115
87
uses : dtolnay/rust-toolchain@stable
116
- if : ${{ !matrix.settings.docker }}
117
88
with :
118
- toolchain : nightly-2023-10-25
89
+ toolchain : nightly-2023-12-23
119
90
targets : ${{ matrix.settings.target }}
120
91
121
92
- name : Cache cargo registry
124
95
path : |
125
96
~/.cargo/registry
126
97
~/.cargo/git
98
+ ~/.napi-rs
127
99
target
128
- .cargo-cache
129
100
key : ${{ matrix.settings.target }}-cargo-registry
130
101
131
102
- name : Setup toolchain
@@ -134,7 +105,7 @@ jobs:
134
105
shell : bash
135
106
136
107
- uses : goto-bus-stop/setup-zig@v2
137
- if : ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' }}
108
+ if : ${{ contains( matrix.settings.target, 'musl') }}
138
109
with :
139
110
version : 0.11.0
140
111
@@ -149,25 +120,15 @@ jobs:
149
120
- name : ' Build TypeScript'
150
121
run : yarn build:ts
151
122
152
- - name : Build in docker
153
- uses : addnab/docker-run-action@v3
154
- if : ${{ matrix.settings.docker }}
155
- with :
156
- image : ${{ matrix.settings.docker }}
157
- options : --user 0:0 -v ${{ github.workspace }}/.cargo-cache/.cargo/git:/usr/local/cargo/git -v ${{ github.workspace }}/.cargo-cache/.cargo/registry:/usr/local/cargo/registry -v ${{ github.workspace }}:/build -w /build
158
- run : ${{ matrix.settings.build }}
159
-
160
123
- name : Setup node x86
161
124
uses : actions/setup-node@v4
162
125
if : matrix.settings.target == 'i686-pc-windows-msvc'
163
126
with :
164
- node-version : 18
165
- cache : yarn
127
+ node-version : 20
166
128
architecture : x86
167
129
168
130
- name : ' Build'
169
131
run : ${{ matrix.settings.build }}
170
- if : ${{ !matrix.settings.docker }}
171
132
shell : bash
172
133
173
134
- name : Upload artifact
@@ -181,7 +142,7 @@ jobs:
181
142
runs-on : macos-12
182
143
name : Build FreeBSD
183
144
steps :
184
- - uses : actions/checkout@v3
145
+ - uses : actions/checkout@v4
185
146
- name : Build
186
147
id : build
187
148
uses :
cross-platform-actions/[email protected]
@@ -202,7 +163,7 @@ jobs:
202
163
sudo pkg install -y -f curl node libnghttp2 npm
203
164
sudo npm install -g yarn --ignore-scripts
204
165
curl https://sh.rustup.rs -sSf --output rustup.sh
205
- sh rustup.sh -y --default-toolchain nightly-2023-10-25
166
+ sh rustup.sh -y --default-toolchain nightly-2023-12-23
206
167
source "$HOME/.cargo/env"
207
168
echo "~~~~ rustc --version ~~~~"
208
169
rustc --version
@@ -221,7 +182,7 @@ jobs:
221
182
strip -x packages/*/*.node
222
183
rm -rf node_modules
223
184
rm -rf target
224
- rm -rf .yarn/cache
185
+ rm -rf .yarn
225
186
226
187
- name : Upload artifact
227
188
uses : actions/upload-artifact@v4
@@ -246,7 +207,7 @@ jobs:
246
207
runs-on : ${{ matrix.settings.host }}
247
208
248
209
steps :
249
- - uses : actions/checkout@v3
210
+ - uses : actions/checkout@v4
250
211
with :
251
212
submodules : true
252
213
@@ -273,13 +234,7 @@ jobs:
273
234
run : yarn build:ts
274
235
275
236
- name : Test bindings
276
- run : |
277
- yarn test packages/argon2
278
- yarn test packages/bcrypt
279
- yarn test packages/crc32
280
- yarn test packages/jieba
281
- yarn test packages/jsonwebtoken
282
- yarn test packages/xxhash
237
+ run : yarn workspaces foreach -A -j 1 run test
283
238
284
239
test-linux-x64-gnu-binding :
285
240
name : Test bindings on Linux-x64-gnu - node@${{ matrix.node }}
@@ -292,7 +247,7 @@ jobs:
292
247
runs-on : ubuntu-latest
293
248
294
249
steps :
295
- - uses : actions/checkout@v3
250
+ - uses : actions/checkout@v4
296
251
297
252
- name : Setup node
298
253
uses : actions/setup-node@v4
@@ -325,8 +280,7 @@ jobs:
325
280
with :
326
281
image : node:${{ matrix.node }}-slim
327
282
options : -v ${{ github.workspace }}:/build -w /build
328
- run : |
329
- yarn test
283
+ run : yarn test -s
330
284
331
285
test-linux-x64-centos-7 :
332
286
name : Test bindings on Linux-x64-glibc-2.17
@@ -379,7 +333,7 @@ jobs:
379
333
runs-on : ubuntu-latest
380
334
381
335
steps :
382
- - uses : actions/checkout@v3
336
+ - uses : actions/checkout@v4
383
337
384
338
- name : Setup node
385
339
uses : actions/setup-node@v4
@@ -415,7 +369,7 @@ jobs:
415
369
image : node:${{ matrix.node }}-alpine
416
370
options : -v ${{ github.workspace }}:/build -w /build
417
371
run : |
418
- yarn test
372
+ yarn test -s
419
373
420
374
test-linux-aarch64-gnu-binding :
421
375
name : Test bindings on aarch64-unknown-linux-gnu - node@${{ matrix.node }}
@@ -428,7 +382,7 @@ jobs:
428
382
runs-on : ubuntu-latest
429
383
430
384
steps :
431
- - uses : actions/checkout@v3
385
+ - uses : actions/checkout@v4
432
386
433
387
- name : Download artifacts
434
388
uses : actions/download-artifact@v4
@@ -472,10 +426,14 @@ jobs:
472
426
needs :
473
427
- build
474
428
429
+ strategy :
430
+ fail-fast : false
431
+ matrix :
432
+ node : ['18', '20']
475
433
runs-on : ubuntu-latest
476
434
477
435
steps :
478
- - uses : actions/checkout@v3
436
+ - uses : actions/checkout@v4
479
437
480
438
- name : Install dependencies
481
439
run : |
@@ -487,7 +445,7 @@ jobs:
487
445
uses : actions/download-artifact@v4
488
446
with :
489
447
name : bindings-aarch64-unknown-linux-musl
490
- path : packages
448
+ path : artifacts
491
449
492
450
- name : Move artifacts
493
451
run : yarn artifacts
@@ -511,7 +469,7 @@ jobs:
511
469
run : |
512
470
set -e
513
471
yarn build:ts
514
- yarn test
472
+ yarn test -s
515
473
516
474
test-linux-arm-gnueabihf-binding :
517
475
name : Test bindings on armv7-unknown-linux-gnueabihf - node@${{ matrix.node }}
@@ -524,7 +482,7 @@ jobs:
524
482
runs-on : ubuntu-latest
525
483
526
484
steps :
527
- - uses : actions/checkout@v3
485
+ - uses : actions/checkout@v4
528
486
529
487
- name : Install dependencies
530
488
run : |
@@ -559,7 +517,7 @@ jobs:
559
517
run : |
560
518
set -e
561
519
yarn build:ts
562
- yarn test
520
+ yarn test -s
563
521
ls -la
564
522
565
523
publish :
@@ -571,15 +529,16 @@ jobs:
571
529
- test-linux-x64-centos-7
572
530
- test-linux-x64-musl-binding
573
531
- test-linux-aarch64-gnu-binding
532
+ - test-linux-aarch64-musl-binding
574
533
- test-linux-arm-gnueabihf-binding
575
534
- test-macOS-windows-binding
576
535
steps :
577
- - uses : actions/checkout@v3
536
+ - uses : actions/checkout@v4
578
537
579
538
- name : Setup node
580
539
uses : actions/setup-node@v4
581
540
with :
582
- node-version : 18
541
+ node-version : 20
583
542
cache : yarn
584
543
585
544
- name : ' Install dependencies'
0 commit comments