@@ -185,8 +185,18 @@ jobs:
185
185
echo "CLING_HASH=$env:CLING_HASH" >> $GITHUB_ENV
186
186
echo "LLVM_HASH=$env:LLVM_HASH" >> $GITHUB_ENV
187
187
188
+ - name : Restore Cache LLVM/Clang runtime build directory
189
+ uses : actions/cache/restore@v4
190
+ id : cache
191
+ with :
192
+ path : |
193
+ llvm-project
194
+ ${{ matrix.cling=='On' && 'cling' || '' }}
195
+ key : ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}.x-patch-${{ hashFiles(format('patches/llvm/clang{0}-*.patch', matrix.clang-runtime)) || 'none' }}
196
+ lookup-only : true
197
+
188
198
- name : Setup default Build Type on *nux
189
- if : runner.os != 'windows'
199
+ if : ${{ runner.os != 'windows' && steps.cache.outputs.cache-hit != 'true' }}
190
200
run : |
191
201
echo "BUILD_TYPE=Release" >> $GITHUB_ENV
192
202
echo "CODE_COVERAGE=0" >> $GITHUB_ENV
@@ -198,15 +208,15 @@ jobs:
198
208
fi
199
209
200
210
- name : Setup default Build Type on Windows
201
- if : runner.os == 'windows'
211
+ if : ${{ runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true' }}
202
212
run : |
203
213
echo "BUILD_TYPE=Release" >> $env:GITHUB_ENV
204
214
echo "CODE_COVERAGE=0" >> $env:GITHUB_ENV
205
215
echo "ncpus=%NUMBER_OF_PROCESSORS%"
206
216
echo "ncpus=%NUMBER_OF_PROCESSORS%" >> $GITHUB_ENV
207
217
208
218
- name : Setup compiler on Linux
209
- if : runner.os == 'Linux'
219
+ if : ${{ runner.os == 'Linux' && steps.cache.outputs.cache-hit != 'true' }}
210
220
run : |
211
221
# https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
212
222
vers="${compiler#*-}"
@@ -230,7 +240,7 @@ jobs:
230
240
compiler : ${{ matrix.compiler }}
231
241
232
242
- name : Setup compiler on macOS
233
- if : runner.os == 'macOS'
243
+ if : ${{ runner.os == 'macOS' && steps.cache.outputs.cache-hit != 'true' }}
234
244
run : |
235
245
vers="${compiler#*-}"
236
246
if [[ "${{ matrix.compiler }}" == *"gcc"* ]]; then
@@ -251,7 +261,7 @@ jobs:
251
261
# Section slightly modified version of
252
262
# https://github.com/vgvassilev/clad/blob/40d8bec11bde47b14a281078183a4f6147abeac5/.github/workflows/ci.yml#L510C1-L534C10
253
263
- name : Setup compiler on Windows
254
- if : runner.os == 'windows'
264
+ if : ${{ runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true' }}
255
265
run : |
256
266
if ( "${{ matrix.compiler }}" -imatch "clang" )
257
267
{
@@ -274,21 +284,21 @@ jobs:
274
284
}
275
285
276
286
- name : Install deps on Windows
277
- if : runner.os == 'windows'
287
+ if : ${{ runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true' }}
278
288
run : |
279
289
choco install findutils
280
290
$env:PATH="C:\Program Files (x86)\GnuWin32\bin;$env:PATH"
281
291
282
292
- name : Install deps on Linux
283
- if : runner.os == 'Linux'
293
+ if : ${{ runner.os == 'Linux' && steps.cache.outputs.cache-hit != 'true' }}
284
294
run : |
285
295
# Install deps
286
296
sudo apt-get update
287
297
sudo apt-get autoremove
288
298
sudo apt-get clean
289
299
290
300
- name : Install deps on MacOS
291
- if : runner.os == 'macOS'
301
+ if : ${{ runner.os == 'macOS' && steps.cache.outputs.cache-hit != 'true' }}
292
302
run : |
293
303
brew update
294
304
@@ -299,15 +309,6 @@ jobs:
299
309
done
300
310
brew upgrade
301
311
302
- - name : Restore Cache LLVM/Clang runtime build directory
303
- uses : actions/cache/restore@v4
304
- id : cache
305
- with :
306
- path : |
307
- llvm-project
308
- ${{ matrix.cling=='On' && 'cling' || '' }}
309
- key : ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}.x-patch-${{ hashFiles(format('patches/llvm/clang{0}-*.patch', matrix.clang-runtime)) || 'none' }}
310
-
311
312
- name : Build LLVM/Cling on Unix systems if the cache is invalid
312
313
if : ${{ runner.os != 'windows' && steps.cache.outputs.cache-hit != 'true' }}
313
314
run : |
0 commit comments