rework ccache

This commit is contained in:
tooomm 2025-05-11 13:34:13 +02:00
parent 48b6e1590c
commit 0aa2055ba9

View file

@ -142,22 +142,22 @@ jobs:
- name: Generate cache timestamp
id: cache_timestamp
shell: bash
run: echo "timestamp=$(date -u '+%Y%m%d%H%M%S')" >>"$GITHUB_OUTPUT"
- name: Restore cache
uses: actions/cache@v4
env:
timestamp: ${{steps.cache_timestamp.outputs.timestamp}}
with:
path: ${{env.CACHE}}
key: docker-${{matrix.distro}}${{matrix.version}}-cache-${{env.timestamp}}
restore-keys: |
docker-${{matrix.distro}}${{matrix.version}}-cache-
run: echo "timestamp=$(date -u '+%Y%m%d%H%M%S')" >> "$GITHUB_OUTPUT"
- name: Build ${{matrix.distro}} ${{matrix.version}} Docker image
shell: bash
run: source .ci/docker.sh --build
- name: Restore compiler cache (ccache)
id: ccache_restore
uses: actions/cache/restore@v4
env:
timestamp: ${{steps.cache_timestamp.outputs.timestamp}}
with:
path: ${{env.CACHE}}
key: ccache-${{matrix.distro}}${{matrix.version}}-${{env.timestamp}}
restore-keys: ccache-${{matrix.distro}}${{matrix.version}}-
- name: Build debug and test
if: matrix.test != 'skip'
shell: bash
@ -179,6 +179,15 @@ jobs:
--ccache "$CCACHE_SIZE" --parallel 4
.ci/name_build.sh
- name: Save compiler cache (ccache)
if: github.ref == 'refs/heads/master'
uses: actions/cache/save@v4
env:
timestamp: ${{steps.cache_timestamp.outputs.timestamp}}
with:
path: ${{env.CACHE}}
key: ${{ steps.ccache_restore.outputs.cache-primary-key }}
- name: Upload artifact
if: matrix.package != 'skip'
uses: actions/upload-artifact@v4