From 5b7b770f8010c29274b33081172cd1748b2b5d19 Mon Sep 17 00:00:00 2001 From: forbes Date: Sun, 1 Feb 2026 05:01:14 -0600 Subject: [PATCH] fix(ci): use fixed path for ccache dir to survive workspace changes The Gitea runner assigns a different workspace directory hash on each run (e.g. /var/lib/gitea-runner/.cache/act//hostexecutor/). When CCACHE_DIR was set to ${{ github.workspace }}/.ccache, the actions/cache save and restore operated on a path that changed every run, making the restored cache land in the wrong location. This caused 0% hit rate on the second build despite the cache being saved successfully. Fix by using a fixed path (/tmp/ccache-kindred-create) for CCACHE_DIR and the cache action path. CCACHE_BASEDIR remains set to the workspace so ccache stores relative source paths, making cache entries portable across different workspace directories. --- .gitea/workflows/build.yml | 6 +++--- .gitea/workflows/release.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 43d7c6df5f..3092707df7 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -13,7 +13,7 @@ jobs: runs-on: app-builder env: - CCACHE_DIR: ${{ github.workspace }}/.ccache + CCACHE_DIR: /tmp/ccache-kindred-create CCACHE_COMPRESS: "true" CCACHE_COMPRESSLEVEL: "6" CCACHE_MAXSIZE: "4G" @@ -69,7 +69,7 @@ jobs: id: ccache-restore uses: https://github.com/actions/cache/restore@v4 with: - path: ${{ github.workspace }}/.ccache + path: /tmp/ccache-kindred-create key: ccache-build-${{ github.ref_name }}-${{ github.sha }} restore-keys: | ccache-build-${{ github.ref_name }}- @@ -107,7 +107,7 @@ jobs: if: always() uses: https://github.com/actions/cache/save@v4 with: - path: ${{ github.workspace }}/.ccache + path: /tmp/ccache-kindred-create key: ccache-build-${{ github.ref_name }}-${{ github.sha }} - name: Run C++ unit tests diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 72792bd6a9..969ad80c75 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -16,7 +16,7 @@ jobs: runs-on: app-builder env: - CCACHE_DIR: ${{ github.workspace }}/.ccache + CCACHE_DIR: /tmp/ccache-kindred-create CCACHE_COMPRESS: "true" CCACHE_COMPRESSLEVEL: "6" CCACHE_MAXSIZE: "4G" @@ -77,7 +77,7 @@ jobs: id: ccache-restore uses: https://github.com/actions/cache/restore@v4 with: - path: ${{ github.workspace }}/.ccache + path: /tmp/ccache-kindred-create key: ccache-release-${{ github.ref_name }}-${{ github.sha }} restore-keys: | ccache-release- @@ -116,7 +116,7 @@ jobs: if: always() uses: https://github.com/actions/cache/save@v4 with: - path: ${{ github.workspace }}/.ccache + path: /tmp/ccache-kindred-create key: ccache-release-${{ github.ref_name }}-${{ github.sha }} - name: Build .deb package