Skip to content

Commit b0776b4

Browse files
committed
builds/macos, linux, windows: update to explicit restore/save for LLVM source and LLVM builds
Signed-off-by: deadprogram <[email protected]>
1 parent e1b00c5 commit b0776b4

File tree

3 files changed

+119
-34
lines changed

3 files changed

+119
-34
lines changed

.github/workflows/build-macos.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ jobs:
2929
with:
3030
go-version: '1.20'
3131
cache: true
32-
- name: Cache LLVM source
33-
uses: actions/cache@v3
32+
- name: Restore LLVM source cache
33+
uses: actions/cache/restore@v3
3434
id: cache-llvm-source
3535
with:
36-
key: llvm-source-15-macos-v2
36+
key: llvm-source-15-macos-v3
3737
path: |
3838
llvm-project/clang/lib/Headers
3939
llvm-project/clang/include
@@ -43,11 +43,22 @@ jobs:
4343
- name: Download LLVM source
4444
if: steps.cache-llvm-source.outputs.cache-hit != 'true'
4545
run: make llvm-source
46-
- name: Cache LLVM build
47-
uses: actions/cache@v3
46+
- name: Save LLVM source cache
47+
uses: actions/cache/save@v3
48+
if: steps.cache-llvm-source.outputs.cache-hit != 'true'
49+
with:
50+
key: ${{ steps.cache-llvm-source.outputs.cache-primary-key }}
51+
path: |
52+
llvm-project/clang/lib/Headers
53+
llvm-project/clang/include
54+
llvm-project/compiler-rt
55+
llvm-project/lld/include
56+
llvm-project/llvm/include
57+
- name: Restore LLVM build cache
58+
uses: actions/cache/restore@v3
4859
id: cache-llvm-build
4960
with:
50-
key: llvm-build-15-macos-v3
61+
key: llvm-build-15-macos-v4
5162
path: llvm-build
5263
- name: Build LLVM
5364
if: steps.cache-llvm-build.outputs.cache-hit != 'true'
@@ -61,6 +72,12 @@ jobs:
6172
# build!
6273
make llvm-build
6374
find llvm-build -name CMakeFiles -prune -exec rm -r '{}' \;
75+
- name: Save LLVM build cache
76+
uses: actions/cache/save@v3
77+
if: steps.cache-llvm-build.outputs.cache-hit != 'true'
78+
with:
79+
key: ${{ steps.cache-llvm-build.outputs.cache-primary-key }}
80+
path: llvm-build
6481
- name: Cache wasi-libc sysroot
6582
uses: actions/cache@v3
6683
id: cache-wasi-libc

.github/workflows/linux.yml

Lines changed: 92 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ jobs:
3939
path: |
4040
~/.cache/go-build
4141
~/go/pkg/mod
42-
- name: Cache LLVM source
43-
uses: actions/cache@v3
42+
- name: Restore LLVM source cache
43+
uses: actions/cache/restore@v3
4444
id: cache-llvm-source
4545
with:
46-
key: llvm-source-15-linux-alpine-v2
46+
key: llvm-source-15-linux-alpine-v3
4747
path: |
4848
llvm-project/clang/lib/Headers
4949
llvm-project/clang/include
@@ -53,11 +53,22 @@ jobs:
5353
- name: Download LLVM source
5454
if: steps.cache-llvm-source.outputs.cache-hit != 'true'
5555
run: make llvm-source
56-
- name: Cache LLVM build
57-
uses: actions/cache@v3
56+
- name: Save LLVM source cache
57+
uses: actions/cache/save@v3
58+
if: steps.cache-llvm-source.outputs.cache-hit != 'true'
59+
with:
60+
key: ${{ steps.cache-llvm-source.outputs.cache-primary-key }}
61+
path: |
62+
llvm-project/clang/lib/Headers
63+
llvm-project/clang/include
64+
llvm-project/compiler-rt
65+
llvm-project/lld/include
66+
llvm-project/llvm/include
67+
- name: Restore LLVM build cache
68+
uses: actions/cache/restore@v3
5869
id: cache-llvm-build
5970
with:
60-
key: llvm-build-15-linux-alpine-v3
71+
key: llvm-build-15-linux-alpine-v4
6172
path: llvm-build
6273
- name: Build LLVM
6374
if: steps.cache-llvm-build.outputs.cache-hit != 'true'
@@ -71,6 +82,12 @@ jobs:
7182
make llvm-build
7283
# Remove unnecessary object files (to reduce cache size).
7384
find llvm-build -name CMakeFiles -prune -exec rm -r '{}' \;
85+
- name: Save LLVM build cache
86+
uses: actions/cache/save@v3
87+
if: steps.cache-llvm-build.outputs.cache-hit != 'true'
88+
with:
89+
key: ${{ steps.cache-llvm-build.outputs.cache-primary-key }}
90+
path: llvm-build
7491
- name: Cache Binaryen
7592
uses: actions/cache@v3
7693
id: cache-binaryen
@@ -168,11 +185,11 @@ jobs:
168185
run: |
169186
curl https://wasmtime.dev/install.sh -sSf | bash
170187
echo "$HOME/.wasmtime/bin" >> $GITHUB_PATH
171-
- name: Cache LLVM source
172-
uses: actions/cache@v3
188+
- name: Restore LLVM source cache
189+
uses: actions/cache/restore@v3
173190
id: cache-llvm-source
174191
with:
175-
key: llvm-source-15-linux-asserts-v2
192+
key: llvm-source-15-linux-asserts-v3
176193
path: |
177194
llvm-project/clang/lib/Headers
178195
llvm-project/clang/include
@@ -182,11 +199,22 @@ jobs:
182199
- name: Download LLVM source
183200
if: steps.cache-llvm-source.outputs.cache-hit != 'true'
184201
run: make llvm-source
185-
- name: Cache LLVM build
186-
uses: actions/cache@v3
202+
- name: Save LLVM source cache
203+
uses: actions/cache/save@v3
204+
if: steps.cache-llvm-source.outputs.cache-hit != 'true'
205+
with:
206+
key: ${{ steps.cache-llvm-source.outputs.cache-primary-key }}
207+
path: |
208+
llvm-project/clang/lib/Headers
209+
llvm-project/clang/include
210+
llvm-project/compiler-rt
211+
llvm-project/lld/include
212+
llvm-project/llvm/include
213+
- name: Restore LLVM build cache
214+
uses: actions/cache/restore@v3
187215
id: cache-llvm-build
188216
with:
189-
key: llvm-build-15-linux-asserts-v3
217+
key: llvm-build-15-linux-asserts-v4
190218
path: llvm-build
191219
- name: Build LLVM
192220
if: steps.cache-llvm-build.outputs.cache-hit != 'true'
@@ -198,6 +226,12 @@ jobs:
198226
make llvm-build ASSERT=1
199227
# Remove unnecessary object files (to reduce cache size).
200228
find llvm-build -name CMakeFiles -prune -exec rm -r '{}' \;
229+
- name: Save LLVM build cache
230+
uses: actions/cache/save@v3
231+
if: steps.cache-llvm-build.outputs.cache-hit != 'true'
232+
with:
233+
key: ${{ steps.cache-llvm-build.outputs.cache-primary-key }}
234+
path: llvm-build
201235
- name: Cache Binaryen
202236
uses: actions/cache@v3
203237
id: cache-binaryen
@@ -254,11 +288,11 @@ jobs:
254288
with:
255289
go-version: '1.20'
256290
cache: true
257-
- name: Cache LLVM source
258-
uses: actions/cache@v3
291+
- name: Restore LLVM source cache
292+
uses: actions/cache/restore@v3
259293
id: cache-llvm-source
260294
with:
261-
key: llvm-source-15-linux-v2
295+
key: llvm-source-15-linux-v3
262296
path: |
263297
llvm-project/clang/lib/Headers
264298
llvm-project/clang/include
@@ -268,11 +302,22 @@ jobs:
268302
- name: Download LLVM source
269303
if: steps.cache-llvm-source.outputs.cache-hit != 'true'
270304
run: make llvm-source
271-
- name: Cache LLVM build
272-
uses: actions/cache@v3
305+
- name: Save LLVM source cache
306+
uses: actions/cache/save@v3
307+
if: steps.cache-llvm-source.outputs.cache-hit != 'true'
308+
with:
309+
key: ${{ steps.cache-llvm-source.outputs.cache-primary-key }}
310+
path: |
311+
llvm-project/clang/lib/Headers
312+
llvm-project/clang/include
313+
llvm-project/compiler-rt
314+
llvm-project/lld/include
315+
llvm-project/llvm/include
316+
- name: Restore LLVM build cache
317+
uses: actions/cache/restore@v3
273318
id: cache-llvm-build
274319
with:
275-
key: llvm-build-15-linux-arm-v3
320+
key: llvm-build-15-linux-arm-v4
276321
path: llvm-build
277322
- name: Build LLVM
278323
if: steps.cache-llvm-build.outputs.cache-hit != 'true'
@@ -286,6 +331,12 @@ jobs:
286331
make llvm-build CROSS=arm-linux-gnueabihf
287332
# Remove unnecessary object files (to reduce cache size).
288333
find llvm-build -name CMakeFiles -prune -exec rm -r '{}' \;
334+
- name: Save LLVM build cache
335+
uses: actions/cache/save@v3
336+
if: steps.cache-llvm-build.outputs.cache-hit != 'true'
337+
with:
338+
key: ${{ steps.cache-llvm-build.outputs.cache-primary-key }}
339+
path: llvm-build
289340
- name: Cache Binaryen
290341
uses: actions/cache@v3
291342
id: cache-binaryen
@@ -354,11 +405,11 @@ jobs:
354405
with:
355406
go-version: '1.20'
356407
cache: true
357-
- name: Cache LLVM source
358-
uses: actions/cache@v3
408+
- name: Restore LLVM source cache
409+
uses: actions/cache/restore@v3
359410
id: cache-llvm-source
360411
with:
361-
key: llvm-source-15-linux-v2
412+
key: llvm-source-15-linux-v3
362413
path: |
363414
llvm-project/clang/lib/Headers
364415
llvm-project/clang/include
@@ -368,11 +419,22 @@ jobs:
368419
- name: Download LLVM source
369420
if: steps.cache-llvm-source.outputs.cache-hit != 'true'
370421
run: make llvm-source
371-
- name: Cache LLVM build
372-
uses: actions/cache@v3
422+
- name: Save LLVM source cache
423+
uses: actions/cache/save@v3
424+
if: steps.cache-llvm-source.outputs.cache-hit != 'true'
425+
with:
426+
key: ${{ steps.cache-llvm-source.outputs.cache-primary-key }}
427+
path: |
428+
llvm-project/clang/lib/Headers
429+
llvm-project/clang/include
430+
llvm-project/compiler-rt
431+
llvm-project/lld/include
432+
llvm-project/llvm/include
433+
- name: Restore LLVM build cache
434+
uses: actions/cache/restore@v3
373435
id: cache-llvm-build
374436
with:
375-
key: llvm-build-15-linux-arm64-v3
437+
key: llvm-build-15-linux-arm64-v4
376438
path: llvm-build
377439
- name: Build LLVM
378440
if: steps.cache-llvm-build.outputs.cache-hit != 'true'
@@ -384,6 +446,12 @@ jobs:
384446
make llvm-build CROSS=aarch64-linux-gnu
385447
# Remove unnecessary object files (to reduce cache size).
386448
find llvm-build -name CMakeFiles -prune -exec rm -r '{}' \;
449+
- name: Save LLVM build cache
450+
uses: actions/cache/save@v3
451+
if: steps.cache-llvm-build.outputs.cache-hit != 'true'
452+
with:
453+
key: ${{ steps.cache-llvm-build.outputs.cache-primary-key }}
454+
path: llvm-build
387455
- name: Cache Binaryen
388456
uses: actions/cache@v3
389457
id: cache-binaryen

.github/workflows/windows.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
uses: actions/cache/restore@v3
4242
id: cache-llvm-source
4343
with:
44-
key: llvm-source-15-windows-v3
44+
key: llvm-source-15-windows-v4
4545
path: |
4646
llvm-project/clang/lib/Headers
4747
llvm-project/clang/include
@@ -53,7 +53,7 @@ jobs:
5353
run: make llvm-source
5454
- name: Save cached LLVM source
5555
uses: actions/cache/save@v3
56-
if: always()
56+
if: steps.cache-llvm-source.outputs.cache-hit != 'true'
5757
with:
5858
key: ${{ steps.cache-llvm-source.outputs.cache-primary-key }}
5959
path: |
@@ -66,7 +66,7 @@ jobs:
6666
uses: actions/cache/restore@v3
6767
id: cache-llvm-build
6868
with:
69-
key: llvm-build-15-windows-v4
69+
key: llvm-build-15-windows-v5
7070
path: llvm-build
7171
- name: Build LLVM
7272
if: steps.cache-llvm-build.outputs.cache-hit != 'true'
@@ -81,7 +81,7 @@ jobs:
8181
find llvm-build -name CMakeFiles -prune -exec rm -r '{}' \;
8282
- name: Save cached LLVM build
8383
uses: actions/cache/save@v3
84-
if: always()
84+
if: steps.cache-llvm-build.outputs.cache-hit != 'true'
8585
with:
8686
key: ${{ steps.cache-llvm-build.outputs.cache-primary-key }}
8787
path: llvm-build

0 commit comments

Comments
 (0)