3939 with :
4040 path : |
4141 /var/cache/apt/archives
42- key : ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/check .yml') }}
42+ key : ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/push .yml') }}
4343
4444 # Install system dependencies
4545 - name : Install apt dependencies
@@ -68,12 +68,19 @@ jobs:
6868 cd bext
6969 echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
7070
71+ - name : Compute bext cache discriminator
72+ id : cachekey
73+ shell : bash
74+ run : |
75+ info="${{ steps.bext-sha.outputs.sha }}-$(uname -s)-$(uname -r)-$(gcc --version | head -n 1)"
76+ echo "hash=$(echo -n "$info" | sha1sum | awk '{print $1}')" >> $GITHUB_OUTPUT
77+
7178 - name : Cache bext build outputs
7279 id : cache-bext
7380 uses : actions/cache@v4
7481 with :
7582 path : ${{ github.workspace }}/bext_output
76- key : ${{ runner.os }}-bext-${{ steps.bext-sha .outputs.sha }}
83+ key : ${{ runner.os }}-bext-${{ steps.cachekey .outputs.hash }}
7784
7885 - name : Build bext (if cache miss)
7986 if : steps.cache-bext.outputs.cache-hit != 'true'
@@ -135,7 +142,7 @@ jobs:
135142 with :
136143 path : |
137144 /var/cache/apt/archives
138- key : ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/check .yml') }}
145+ key : ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/push .yml') }}
139146
140147 - name : Setup - System
141148 run : |
@@ -157,12 +164,19 @@ jobs:
157164 cd bext
158165 echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
159166
167+ - name : Compute bext cache discriminator
168+ id : cachekey
169+ shell : bash
170+ run : |
171+ info="${{ steps.bext-sha.outputs.sha }}-$(uname -s)-$(uname -r)-$(gcc --version | head -n 1)"
172+ echo "hash=$(echo -n "$info" | sha1sum | awk '{print $1}')" >> $GITHUB_OUTPUT
173+
160174 - name : Cache bext build outputs
161175 id : cache-bext
162176 uses : actions/cache@v4
163177 with :
164178 path : ${{ github.workspace }}/bext_output
165- key : ${{ runner.os }}-bext-${{ steps.bext-sha .outputs.sha }}
179+ key : ${{ runner.os }}-bext-${{ steps.cachekey .outputs.hash }}
166180
167181 - name : Build bext (if cache miss)
168182 if : steps.cache-bext.outputs.cache-hit != 'true'
@@ -186,7 +200,6 @@ jobs:
186200
187201 windows :
188202 name : MSVC - Ninja
189- # needs: [linux]
190203 runs-on : windows-latest
191204 strategy :
192205 fail-fast : true
@@ -221,12 +234,23 @@ jobs:
221234 cd bext
222235 echo "sha=$(git rev-parse HEAD)" >> $env:GITHUB_OUTPUT
223236
237+ - name : Compute bext cache discriminator
238+ id : cachekey
239+ shell : bash
240+ run : |
241+ clver=""
242+ if command -v cl.exe &> /dev/null; then
243+ clver="$(cl.exe 2>&1 | head -n 1)"
244+ fi
245+ info="${{ steps.bext-sha.outputs.sha }}-$(uname -s)-$(uname -r)-$clver"
246+ echo "hash=$(echo -n "$info" | sha1sum | awk '{print $1}')" >> $GITHUB_OUTPUT
247+
224248 - name : Cache bext build outputs
225249 id : cache-bext
226250 uses : actions/cache@v4
227251 with :
228252 path : ${{ github.workspace }}\bext_output
229- key : windows-bext-${{ steps.bext-sha .outputs.sha }}
253+ key : windows-bext-${{ steps.cachekey .outputs.hash }}
230254
231255 - name : Build bext (if cache miss)
232256 if : steps.cache-bext.outputs.cache-hit != 'true'
@@ -313,12 +337,23 @@ jobs:
313337 cd bext
314338 echo "sha=$(git rev-parse HEAD)" >> $env:GITHUB_OUTPUT
315339
340+ - name : Compute bext cache discriminator
341+ id : cachekey
342+ shell : bash
343+ run : |
344+ clver=""
345+ if command -v cl.exe &> /dev/null; then
346+ clver="$(cl.exe 2>&1 | head -n 1)"
347+ fi
348+ info="${{ steps.bext-sha.outputs.sha }}-$(uname -s)-$(uname -r)-$clver"
349+ echo "hash=$(echo -n "$info" | sha1sum | awk '{print $1}')" >> $GITHUB_OUTPUT
350+
316351 - name : Cache bext build outputs
317352 id : cache-bext
318353 uses : actions/cache@v4
319354 with :
320355 path : ${{ github.workspace }}\bext_output
321- key : windows-bext-${{ steps.bext-sha .outputs.sha }}
356+ key : windows-bext-${{ steps.cachekey .outputs.hash }}
322357
323358 - name : Build bext (if cache miss)
324359 # Note - most of windows_std_tools builds using cmd and avoids ninja,
@@ -401,12 +436,21 @@ jobs:
401436 cd bext
402437 echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
403438
439+ - name : Compute bext cache discriminator
440+ id : cachekey
441+ shell : bash
442+ run : |
443+ xcodever="$(xcodebuild -version | head -n 1 | awk '{print $2}')"
444+ clangver="$(clang --version | head -n 1)"
445+ info="${{ steps.bext-sha.outputs.sha }}-$(uname -s)-$(uname -r)-$xcodever-$clangver"
446+ echo "hash=$(echo -n "$info" | sha1sum | awk '{print $1}')" >> $GITHUB_OUTPUT
447+
404448 - name : Cache bext build outputs
405449 id : cache-bext
406450 uses : actions/cache@v4
407451 with :
408452 path : ${{ github.workspace }}/bext_output
409- key : macos-bext-${{ steps.bext-sha .outputs.sha }}
453+ key : macos-bext-${{ steps.cachekey .outputs.hash }}
410454
411455 - name : Build bext (if cache miss)
412456 if : steps.cache-bext.outputs.cache-hit != 'true'
0 commit comments