Skip to content

Commit ab99595

Browse files
committed
build/windows: always cache LLVM source/build even if the tests fail to avoid extra rebuilds
Signed-off-by: deadprogram <[email protected]>
1 parent e0a5fc2 commit ab99595

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

.github/workflows/windows.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ jobs:
3131
with:
3232
go-version: '1.20'
3333
cache: true
34-
- name: Cache LLVM source
35-
uses: actions/cache@v3
34+
- name: Restore cached LLVM source
35+
uses: actions/cache/restore@v3
3636
id: cache-llvm-source
3737
with:
3838
key: llvm-source-15-windows-v2
@@ -45,8 +45,19 @@ jobs:
4545
- name: Download LLVM source
4646
if: steps.cache-llvm-source.outputs.cache-hit != 'true'
4747
run: make llvm-source
48-
- name: Cache LLVM build
49-
uses: actions/cache@v3
48+
- name: Save cached LLVM source
49+
uses: actions/cache/save@v3
50+
if: always()
51+
with:
52+
key: llvm-source-15-windows-v2
53+
path: |
54+
llvm-project/clang/lib/Headers
55+
llvm-project/clang/include
56+
llvm-project/compiler-rt
57+
llvm-project/lld/include
58+
llvm-project/llvm/include
59+
- name: Restore cached LLVM build
60+
uses: actions/cache/restore@v3
5061
id: cache-llvm-build
5162
with:
5263
key: llvm-build-15-windows-v3
@@ -62,6 +73,13 @@ jobs:
6273
make llvm-build CCACHE=OFF
6374
# Remove unnecessary object files (to reduce cache size).
6475
find llvm-build -name CMakeFiles -prune -exec rm -r '{}' \;
76+
- name: Save cached LLVM build
77+
uses: actions/cache/save@v3
78+
id: cache-llvm-build
79+
if: always()
80+
with:
81+
key: llvm-build-15-windows-v3
82+
path: llvm-build
6583
- name: Cache wasi-libc sysroot
6684
uses: actions/cache@v3
6785
id: cache-wasi-libc

0 commit comments

Comments
 (0)