diff --git a/.github/workflows/os-check.yml b/.github/workflows/os-check.yml index 10aa21d26b..5efd8954d0 100644 --- a/.github/workflows/os-check.yml +++ b/.github/workflows/os-check.yml @@ -75,6 +75,12 @@ jobs: - name: Allow unprivileged user namespaces (for bwrap) run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 || true + # ccache's default cache dir (XDG ~/.cache/ccache) is what the + # actions/cache step below saves; pin it explicitly so the two + # cannot drift apart (e.g. if a later change sets CCACHE_DIR). + - name: Pin ccache directory + run: echo "CCACHE_DIR=$HOME/.cache/ccache" >> "$GITHUB_ENV" + - name: Restore ccache uses: actions/cache@v4 with: diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 3ab7bf6ab5..ec3c764f99 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -98,6 +98,13 @@ jobs: if: steps.merge_check.outputs.skip != 'true' run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 || true + # ccache's default cache dir (XDG ~/.cache/ccache) is what the + # actions/cache step below saves; pin it explicitly so the two + # cannot drift apart (e.g. if a later change sets CCACHE_DIR). + - name: Pin ccache directory + if: steps.merge_check.outputs.skip != 'true' + run: echo "CCACHE_DIR=$HOME/.cache/ccache" >> "$GITHUB_ENV" + - name: Restore ccache if: steps.merge_check.outputs.skip != 'true' uses: actions/cache@v4