Skip to content

Commit 69505ab

Browse files
authored
Fix older-than shell math for the msvc build ccache eviction (#83733)
Co-authored-by: Andrew Krieger <[email protected]>
1 parent 03d00e0 commit 69505ab

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

.github/workflows/msvc-full-features.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -141,24 +141,19 @@ jobs:
141141
run: |
142142
msbuild -m -p:Configuration=Release -p:Platform=x64 "-target:Cataclysm-vcpkg-static;Cataclysm-test-vcpkg-static;JsonFormatter-vcpkg-static;zzip" msvc-full-features/Cataclysm-vcpkg-static.sln
143143
144-
- name: Get ccache cache age cutoff
145-
id: get-cache-age
144+
- name: Post-build ccache manipulation
145+
if: ${{ !failure() }}
146146
run: |
147+
'${{ env.CDDA_CCACHE_PATH }}ccache.exe' -s -v
147148
NOW=`/bin/date +%s`
148149
DELTA=$(( $NOW - ${{ steps.get-vars.outputs.datetime-seconds }} ))
149-
echo "ccache-age=$(( $NOW - ${{ steps.get-vars.outputs.datetime-seconds }} ))" >> $GITHUB_OUTPUT
150+
'${{ env.CDDA_CCACHE_PATH }}ccache.exe' --evict-older-than ${DELTA}s
151+
'${{ env.CDDA_CCACHE_PATH }}ccache.exe' -s -v
152+
'${{ env.CDDA_CCACHE_PATH }}ccache.exe' -M ${{ env.CCACHE_LIMIT }}
153+
'${{ env.CDDA_CCACHE_PATH }}ccache.exe' -c
154+
'${{ env.CDDA_CCACHE_PATH }}ccache.exe' -s -v
150155
shell: bash
151156

152-
- name: Post-build ccache manipulation
153-
if: ${{ !failure() }}
154-
run: |
155-
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -s -v
156-
${{ env.CDDA_CCACHE_PATH }}\ccache.exe --evict-older-than ${{ steps.get-ccache-age.outputs.ccache-age }}
157-
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -s -v
158-
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -M ${{ env.CCACHE_LIMIT }}
159-
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -c
160-
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -s -v
161-
162157
- name: clear ccache on PRs
163158
if: ${{ github.ref_name != 'master' }}
164159
run: |

0 commit comments

Comments
 (0)