@@ -54,31 +54,42 @@ jobs:
54
54
- name : Checkout
55
55
uses : actions/checkout@v4
56
56
57
+ - name : Restore build cache
58
+ id : build-cache
59
+ uses : actions/cache@v4
60
+ with :
61
+ path : rewatch/target
62
+ key : rewatch-build-${{ matrix.rust-target }}-${{ hashFiles('rewatch/src/**', 'rewatch/Cargo.lock') }}
63
+
57
64
- name : Install musl gcc
58
- if : runner.os == 'Linux'
65
+ if : steps.build-cache.outputs.cache-hit != 'true' && runner.os == 'Linux'
59
66
run : sudo apt-get install -y --no-install-recommends musl-tools
60
67
61
68
- name : Set up sccache
69
+ if : steps.build-cache.outputs.cache-hit != 'true'
62
70
uses :
mozilla-actions/[email protected]
63
71
with :
64
72
version : " v0.8.0"
65
73
66
74
- name : Install rust toolchain
75
+ if : steps.build-cache.outputs.cache-hit != 'true'
67
76
uses : dtolnay/rust-toolchain@master
68
77
with :
69
78
toolchain : stable
70
79
targets : ${{matrix.rust-target}}
71
80
72
81
- name : Build rewatch
82
+ if : steps.build-cache.outputs.cache-hit != 'true'
73
83
run : cargo build --manifest-path rewatch/Cargo.toml --target ${{matrix.rust-target}} --release
74
84
75
85
- name : Get artifact dir name
86
+ id : artifact-dir
76
87
run : node .github/workflows/get_artifact_dir_name.js
77
88
78
89
- name : " Upload artifact: rewatch binary"
79
90
uses : actions/upload-artifact@v4
80
91
with :
81
- name : rewatch-${{env.artifact_dir_name }}
92
+ name : rewatch-${{ steps.artifact-dir.outputs.dirname }}
82
93
path : rewatch/target/${{matrix.rust-target}}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }}
83
94
84
95
# Build statically linked Linux binaries in an Alpine-based Docker container
@@ -373,6 +384,7 @@ jobs:
373
384
- name : Build playground compiler
374
385
if : matrix.os == 'ubuntu-latest'
375
386
run : |
387
+ opam install js_of_ocaml.5.8.1
376
388
opam exec -- node packages/playground-bundling/scripts/generate_cmijs.js
377
389
opam exec -- dune build --profile browser
378
390
cp ./_build/default/jscomp/jsoo/jsoo_playground_main.bc.js playground/compiler.js
0 commit comments