From 2913e34e8bee23ab427a0cfec3609c1fa824ee4f Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Mon, 6 Jul 2026 17:17:56 +0100 Subject: [PATCH] Fix cache key for native modules build --- .github/workflows/ci.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cba6a1add9..dc8c77d4a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -325,6 +325,7 @@ jobs: contents: read # For checkout outputs: cache-hit: ${{ steps.marker.outputs.cache-hit }} + key: ${{ steps.cache-key.outputs.key }} steps: - name: Checkout files used for cache key uses: actions/checkout@v6 @@ -333,12 +334,17 @@ jobs: bin/build-cmu-nav-natives dimos/navigation/cmu_nav/modules sparse-checkout-cone-mode: false + - name: Compute cache key + # Recomputing the key in cmu-nav-natives after build breaks the key. + # Save here so it can be reused verbatim. + id: cache-key + run: echo "key=cmu-nav-natives-${{ hashFiles('bin/build-cmu-nav-natives', 'dimos/navigation/cmu_nav/modules/**') }}" >> "$GITHUB_OUTPUT" - name: Look up marker cache id: marker uses: actions/cache/restore@v4 with: path: /tmp/cmu-nav-natives-marker - key: cmu-nav-natives-${{ hashFiles('bin/build-cmu-nav-natives', 'dimos/navigation/cmu_nav/modules/**') }} + key: ${{ steps.cache-key.outputs.key }} lookup-only: true cmu-nav-natives: @@ -409,7 +415,7 @@ jobs: uses: actions/cache/save@v4 with: path: /tmp/cmu-nav-natives-marker - key: cmu-nav-natives-${{ hashFiles('bin/build-cmu-nav-natives', 'dimos/navigation/cmu_nav/modules/**') }} + key: ${{ needs.cmu-nav-natives-marker.outputs.key }} self-hosted-tests: # Skip on PRs from forks which would expose the self-hosted runner to untrusted code from external contributors.