CI/GitHub: Keep ccache size as small as possible by evicting entries not accessed by current build instead

This commit is contained in:
Shauren
2025-11-27 00:10:51 +01:00
parent 15f1c8e395
commit 6160d75889

View File

@@ -29,6 +29,7 @@ jobs:
id: strings
shell: bash
run: |
echo "build-start=$EPOCHSECONDS" >> "$GITHUB_OUTPUT"
echo "build-output-dir=${{ github.workspace }}/bin" >> "$GITHUB_OUTPUT"
echo "ccache-key-prefix=ubuntu-${{ matrix.cc }}-${{ github.base_ref || github.ref_name }}" >> "$GITHUB_OUTPUT"
- name: Dependencies
@@ -65,6 +66,7 @@ jobs:
ccache -z
cmake --build ${{ steps.strings.outputs.build-output-dir }}
ccache -s
ccache --evict-older-than $(($EPOCHSECONDS - ${{ steps.strings.outputs.build-start }}))s
- name: Unit tests
run: |
cmake --build ${{ steps.strings.outputs.build-output-dir }} --target test