@@ -185,8 +185,18 @@ jobs:
185185 echo "CLING_HASH=$env:CLING_HASH" >> $GITHUB_ENV
186186 echo "LLVM_HASH=$env:LLVM_HASH" >> $GITHUB_ENV
187187
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+
188198 - name : Setup default Build Type on *nux
189- if : runner.os != 'windows'
199+ if : ${{ runner.os != 'windows' && steps.cache.outputs.cache-hit != 'true' }}
190200 run : |
191201 echo "BUILD_TYPE=Release" >> $GITHUB_ENV
192202 echo "CODE_COVERAGE=0" >> $GITHUB_ENV
@@ -198,15 +208,15 @@ jobs:
198208 fi
199209
200210 - name : Setup default Build Type on Windows
201- if : runner.os == 'windows'
211+ if : ${{ runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true' }}
202212 run : |
203213 echo "BUILD_TYPE=Release" >> $env:GITHUB_ENV
204214 echo "CODE_COVERAGE=0" >> $env:GITHUB_ENV
205215 echo "ncpus=%NUMBER_OF_PROCESSORS%"
206216 echo "ncpus=%NUMBER_OF_PROCESSORS%" >> $GITHUB_ENV
207217
208218 - name : Setup compiler on Linux
209- if : runner.os == 'Linux'
219+ if : ${{ runner.os == 'Linux' && steps.cache.outputs.cache-hit != 'true' }}
210220 run : |
211221 # https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
212222 vers="${compiler#*-}"
@@ -230,7 +240,7 @@ jobs:
230240 compiler : ${{ matrix.compiler }}
231241
232242 - name : Setup compiler on macOS
233- if : runner.os == 'macOS'
243+ if : ${{ runner.os == 'macOS' && steps.cache.outputs.cache-hit != 'true' }}
234244 run : |
235245 vers="${compiler#*-}"
236246 if [[ "${{ matrix.compiler }}" == *"gcc"* ]]; then
@@ -251,7 +261,7 @@ jobs:
251261 # Section slightly modified version of
252262 # https://github.com/vgvassilev/clad/blob/40d8bec11bde47b14a281078183a4f6147abeac5/.github/workflows/ci.yml#L510C1-L534C10
253263 - name : Setup compiler on Windows
254- if : runner.os == 'windows'
264+ if : ${{ runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true' }}
255265 run : |
256266 if ( "${{ matrix.compiler }}" -imatch "clang" )
257267 {
@@ -274,21 +284,21 @@ jobs:
274284 }
275285
276286 - name : Install deps on Windows
277- if : runner.os == 'windows'
287+ if : ${{ runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true' }}
278288 run : |
279289 choco install findutils
280290 $env:PATH="C:\Program Files (x86)\GnuWin32\bin;$env:PATH"
281291
282292 - name : Install deps on Linux
283- if : runner.os == 'Linux'
293+ if : ${{ runner.os == 'Linux' && steps.cache.outputs.cache-hit != 'true' }}
284294 run : |
285295 # Install deps
286296 sudo apt-get update
287297 sudo apt-get autoremove
288298 sudo apt-get clean
289299
290300 - name : Install deps on MacOS
291- if : runner.os == 'macOS'
301+ if : ${{ runner.os == 'macOS' && steps.cache.outputs.cache-hit != 'true' }}
292302 run : |
293303 brew update
294304@@ -299,15 +309,6 @@ jobs:
299309 done
300310 brew upgrade
301311
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-
311312 - name : Build LLVM/Cling on Unix systems if the cache is invalid
312313 if : ${{ runner.os != 'windows' && steps.cache.outputs.cache-hit != 'true' }}
313314 run : |
0 commit comments