]> git.feebdaed.xyz Git - 0xmirror/quic-go.git/commitdiff
ci: fix cache save and restore logic for cross compile workflow (#5300)
authorMarten Seemann <martenseemann@gmail.com>
Sun, 24 Aug 2025 03:48:49 +0000 (11:48 +0800)
committerGitHub <noreply@github.com>
Sun, 24 Aug 2025 03:48:49 +0000 (05:48 +0200)
lookup-only doesn't download the cache, even if it's there. This is not what we
intended: we still want to use the cache for PRs, we just want to upload a
new cache.

.github/workflows/cross-compile.yml

index 1669d6b07f740f78e703dadb0cb98fbbe9dd0732..928d784c3909a327460a1c3294fe554dad852407 100644 (file)
@@ -13,15 +13,12 @@ jobs:
       - uses: actions/setup-go@v5
         with:
           go-version: ${{ matrix.go }}
-      - name: Load Go cache
+      - name: Load Go build cache
         id: load-go-cache
-        uses: actions/cache@v4
+        uses: actions/cache/restore@v4
         with:
           path: ~/.cache/go-build
           key: go-${{ matrix.go }}-crosscompile
-          restore-keys: go-${{ matrix.go }}-crosscompile
-          # only store cache when on master
-          lookup-only: ${{ github.event_name != 'push' || github.ref_name != 'master' }}
       - name: Install build utils
         run: |
           sudo apt-get update
@@ -31,3 +28,10 @@ jobs:
       - name: Run cross compilation
         # run in parallel on as many cores as are available on the machine
         run: go tool dist list | xargs -I % -P "$(nproc)" .github/workflows/cross-compile.sh %
+      - name: Save Go build cache
+        # only store cache when on master
+        if: github.event_name == 'push' && github.ref_name == 'master'
+        uses: actions/cache/save@v4
+        with:
+          path: ~/.cache/go-build
+          key: go-${{ matrix.go }}-crosscompile