From a59fec0091f51770bfd361dbc7490b80a01c9498 Mon Sep 17 00:00:00 2001 From: Jacob Weinstock Date: Mon, 9 Mar 2026 13:04:30 -0600 Subject: [PATCH] compute kernel cache key before build: The kernel build writes .config.resolved into kernel.configs/, which changes the hashFiles('kernel.configs/*', ...) result between cache restore and save, producing mismatched keys and failed saves. Signed-off-by: Jacob Weinstock --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f7ac28..99730a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -130,13 +130,17 @@ jobs: docker tag "${{ env.BUILDER_IMAGE }}:${HASH}" "${REMOTE}:${HASH}-${{ matrix.arch }}" docker push "${REMOTE}:${HASH}-${{ matrix.arch }}" + - name: Compute kernel cache key + id: kernel-cache-key + run: echo "key=kernel-${{ matrix.arch }}-${{ env.KERNEL_VERSION }}-${{ hashFiles('kernel.configs/*', 'Dockerfile') }}" >> "$GITHUB_OUTPUT" + - name: Restore kernel cache id: kernel-cache uses: actions/cache/restore@v4 with: path: | mkosi.output/kernel/${{ env.KERNEL_VERSION }}/${{ matrix.arch }} - key: kernel-${{ matrix.arch }}-${{ env.KERNEL_VERSION }}-${{ hashFiles('kernel.configs/*', 'Dockerfile') }} + key: ${{ steps.kernel-cache-key.outputs.key }} - name: Install Python dependencies run: pip install -r requirements.txt @@ -153,7 +157,7 @@ jobs: with: path: | mkosi.output/kernel/${{ env.KERNEL_VERSION }}/${{ matrix.arch }} - key: kernel-${{ matrix.arch }}-${{ env.KERNEL_VERSION }}-${{ hashFiles('kernel.configs/*', 'Dockerfile') }} + key: ${{ steps.kernel-cache-key.outputs.key }} - name: Upload kernel artifacts uses: actions/upload-artifact@v4