@@ -36,13 +36,13 @@ jobs:
36
36
uses : actions/setup-node@v4
37
37
with :
38
38
node-version : 22
39
- - name : Cache Node Modules
39
+ - name : Restore Node dependencies cache
40
40
id : cache-node-modules
41
- uses : actions/cache@v4
41
+ uses : actions/cache/restore @v4
42
42
with :
43
43
path : node_modules
44
44
key : node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
45
- - name : Install dependencies
45
+ - name : Install Node dependencies
46
46
if : steps.cache-node-modules.outputs.cache-hit != 'true'
47
47
run : npm ci --ignore-scripts
48
48
- name : Lint
64
64
matrix :
65
65
settings :
66
66
# WASM
67
- - host : windows -latest
68
- target : x86_64-pc-windows-msvc
67
+ - host : ubuntu -latest
68
+ target : wasm32-unknown-unknown
69
69
name : wasm
70
70
is-wasm-build : true
71
71
build : >-
75
75
path : |
76
76
wasm/
77
77
.empty
78
- - host : windows -latest
79
- target : x86_64-pc-windows-msvc
78
+ - host : ubuntu -latest
79
+ target : wasm32-unknown-unknown
80
80
name : wasm-node
81
81
is-wasm-build : true
82
82
build : >-
@@ -222,8 +222,8 @@ jobs:
222
222
with :
223
223
toolchain : stable
224
224
targets : ${{ matrix.settings.target }}
225
- - name : Cache cargo
226
- uses : actions/cache@v4
225
+ - name : Restore Cargo cache
226
+ uses : actions/cache/restore @v4
227
227
with :
228
228
path : |
229
229
~/.cargo/registry/index/
@@ -241,15 +241,21 @@ jobs:
241
241
run : ${{ matrix.settings.setup }}
242
242
if : ${{ matrix.settings.setup }}
243
243
shell : bash
244
- - name : Cache Node Modules
244
+ - name : Restore Node dependencies cache
245
245
id : cache-node-modules
246
- uses : actions/cache@v4
246
+ uses : actions/cache/restore @v4
247
247
with :
248
248
path : node_modules
249
249
key : node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
250
- - name : Install dependencies
250
+ - name : Install Node dependencies
251
251
if : steps.cache-node-modules.outputs.cache-hit != 'true'
252
252
run : npm ci --ignore-scripts
253
+ - name : Save Node dependencies cache
254
+ if : steps.cache-node-modules.outputs.cache-hit != 'true' && github.ref == 'refs/heads/master'
255
+ uses : actions/cache/save@v4
256
+ with :
257
+ path : node_modules
258
+ key : node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
253
259
- name : Build in docker
254
260
uses : addnab/docker-run-action@v3
255
261
if : ${{ matrix.settings.docker }}
@@ -261,6 +267,17 @@ jobs:
261
267
run : ${{ matrix.settings.build }}
262
268
if : ${{ !matrix.settings.docker }}
263
269
shell : bash
270
+ - name : Save Cargo cache
271
+ if : github.ref == 'refs/heads/master'
272
+ uses : actions/cache/save@v4
273
+ with :
274
+ path : |
275
+ ~/.cargo/registry/index/
276
+ ~/.cargo/registry/cache/
277
+ ~/.cargo/git/db/
278
+ .cargo-cache
279
+ rust/target/
280
+ key : ${{ matrix.settings.name || matrix.settings.target }}-cargo-${{ matrix.settings.host }}-${{ hashFiles('rust/Cargo.lock') }}
264
281
- name : Upload wasm artifact
265
282
uses : actions/upload-artifact@v4
266
283
with :
@@ -295,8 +312,8 @@ jobs:
295
312
steps :
296
313
- name : Checkout Commit
297
314
uses : actions/checkout@v4
298
- - name : Cache cargo
299
- uses : actions/cache@v4
315
+ - name : Restore Cargo cache
316
+ uses : actions/cache/restore @v4
300
317
with :
301
318
path : |
302
319
~/.cargo/registry/index/
@@ -317,6 +334,17 @@ jobs:
317
334
sudo pkg install -y node npm rust
318
335
npm ci --ignore-scripts
319
336
npm run build:napi -- --release --target ${{ matrix.settings.target }}
337
+ - name : Save Cargo cache
338
+ if : github.ref == 'refs/heads/master'
339
+ uses : actions/cache/save@v4
340
+ with :
341
+ path : |
342
+ ~/.cargo/registry/index/
343
+ ~/.cargo/registry/cache/
344
+ ~/.cargo/git/db/
345
+ .cargo-cache
346
+ rust/target/
347
+ key : ${{ matrix.settings.target }}-cargo-${{ hashFiles('rust/Cargo.lock') }}
320
348
- name : Upload napi artifact
321
349
uses : actions/upload-artifact@v4
322
350
with :
@@ -365,13 +393,13 @@ jobs:
365
393
steps :
366
394
- name : Checkout Commit
367
395
uses : actions/checkout@v4
368
- - name : Cache Node Modules
396
+ - name : Restore Node dependencies cache
369
397
id : cache-node-modules
370
- uses : actions/cache@v4
398
+ uses : actions/cache/restore @v4
371
399
with :
372
400
path : node_modules
373
401
key : node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
374
- - name : Install dependencies
402
+ - name : Install Node dependencies
375
403
if : steps.cache-node-modules.outputs.cache-hit != 'true'
376
404
run : npm ci --ignore-scripts
377
405
- name : Build JS
@@ -460,13 +488,13 @@ jobs:
460
488
with :
461
489
node-version : ${{ matrix.node }}
462
490
check-latest : true
463
- - name : Cache Node Modules
491
+ - name : Restore Node dependencies cache
464
492
id : cache-node-modules
465
- uses : actions/cache@v4
493
+ uses : actions/cache/restore @v4
466
494
with :
467
495
path : node_modules
468
496
key : node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
469
- - name : Install dependencies
497
+ - name : Install Node dependencies
470
498
if : steps.cache-node-modules.outputs.cache-hit != 'true'
471
499
run : npm ci --ignore-scripts
472
500
- name : Download napi artifacts
@@ -515,13 +543,13 @@ jobs:
515
543
with :
516
544
node-version : ${{ matrix.node }}
517
545
check-latest : true
518
- - name : Cache Node Modules
546
+ - name : Restore Node dependencies cache
519
547
id : cache-node-modules
520
- uses : actions/cache@v4
548
+ uses : actions/cache/restore @v4
521
549
with :
522
550
path : node_modules
523
551
key : node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
524
- - name : Install dependencies
552
+ - name : Install Node dependencies
525
553
if : steps.cache-node-modules.outputs.cache-hit != 'true'
526
554
run : npm ci --ignore-scripts
527
555
- name : Download all artifacts
0 commit comments