From 0aa2055ba9cd071716ec5ed9b502d34e982b4b04 Mon Sep 17 00:00:00 2001 From: tooomm Date: Sun, 11 May 2025 13:34:13 +0200 Subject: [PATCH] rework ccache --- .github/workflows/desktop-build.yml | 31 +++++++++++++++++++---------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 7fb403549..5056964fb 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -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