75
75
if : steps.build-cache.outputs.cache-hit != 'true'
76
76
run : cargo build --manifest-path rewatch/Cargo.toml --target ${{matrix.rust-target}} --release
77
77
78
- - name : Copy exe to platform bin dirs
78
+ - name : Copy rewatch exe to platform bin dir
79
79
run : |
80
80
cp rewatch/target/${{matrix.rust-target}}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch
81
81
node ./scripts/copyExes.js -rewatch
@@ -121,8 +121,10 @@ jobs:
121
121
- name : Get artifact dir name
122
122
run : node .github/workflows/get_artifact_dir_name.js
123
123
124
- - name : Copy exes to platform bin dirs
125
- run : node ./scripts/copyExes.js -compiler
124
+ - name : Copy exes to platform bin dir
125
+ run : |
126
+ node ./scripts/copyExes.js -compiler
127
+ node ./scripts/copyExes.js -ninja
126
128
127
129
- name : " Upload artifacts: binaries"
128
130
uses : actions/upload-artifact@v4
@@ -164,6 +166,11 @@ jobs:
164
166
with :
165
167
fetch-depth : 2 # to be able to check for changes in subfolder jscomp/syntax later
166
168
169
+ - name : Use Node.js
170
+ uses : actions/setup-node@v4
171
+ with :
172
+ node-version : 18
173
+
167
174
- name : Get artifact dir name
168
175
run : node .github/workflows/get_artifact_dir_name.js
169
176
@@ -175,11 +182,6 @@ jobs:
175
182
packages : bubblewrap darcs g++-multilib gcc-multilib mercurial musl-tools rsync
176
183
version : v1
177
184
178
- - name : Setup Python for ninja build
179
- uses : actions/setup-python@v5
180
- with :
181
- python-version : ' 3.10'
182
-
183
185
# matrix.ocaml_compiler may contain commas
184
186
- name : Get OPAM cache key
185
187
shell : bash
@@ -284,32 +286,44 @@ jobs:
284
286
if : runner.os == 'Linux'
285
287
run : opam exec -- dune build --display quiet --profile static
286
288
287
- - name : Use Node.js
288
- uses : actions/setup-node@v4
289
- with :
290
- node-version : 18
291
-
292
289
- name : Install npm packages
293
290
run : npm ci --ignore-scripts
294
291
292
+ - name : Copy compiler exes to platform bin dir
293
+ run : node ./scripts/copyExes.js -compiler
294
+
295
+ - name : Restore ninja build cache
296
+ id : ninja-build-cache
297
+ uses : actions/cache@v4
298
+ with :
299
+ path : ${{ env.artifact_dir_name }}/ninja.exe
300
+ key : ninja-build-v1-${{ matrix.os }}-${{ hashFiles('ninja/src/**') }}
301
+
302
+ - name : Setup Python for ninja build
303
+ if : steps.ninja-build-cache.outputs.cache-hit != 'true'
304
+ uses : actions/setup-python@v5
305
+ with :
306
+ python-version : ' 3.10'
307
+
295
308
- name : Setup MSVC for ninja build (Windows)
296
- if : runner.os == 'Windows'
309
+ if : steps.ninja-build-cache.outputs.cache-hit != 'true' && runner.os == 'Windows'
297
310
uses : TheMrMilchmann/setup-msvc-dev@v3
298
311
with :
299
312
arch : x64
300
313
301
314
- name : Build ninja
302
- if : runner.os != 'Linux'
315
+ if : steps.ninja-build-cache.outputs.cache-hit != 'true' && runner.os != 'Linux'
303
316
run : node scripts/buildNinjaBinary.js
304
317
305
318
- name : Build ninja (Linux static)
306
- if : runner.os == 'Linux'
319
+ if : steps.ninja-build-cache.outputs.cache-hit != 'true' && runner.os == 'Linux'
307
320
env :
308
321
LDFLAGS : -static
309
322
run : node scripts/buildNinjaBinary.js
310
323
311
- - name : Copy exes to platform bin dirs
312
- run : node ./scripts/copyExes.js -compiler
324
+ - name : Copy ninja exe to platform bin dir
325
+ if : steps.ninja-build-cache.outputs.cache-hit != 'true'
326
+ run : node ./scripts/copyExes.js -ninja
313
327
314
328
- name : " Check if syntax subfolder has changed"
315
329
id : syntax-diff
0 commit comments