From: Marten Seemann Date: Sun, 24 Aug 2025 03:48:49 +0000 (+0800) Subject: ci: fix cache save and restore logic for cross compile workflow (#5300) X-Git-Url: https://git.feebdaed.xyz/?a=commitdiff_plain;h=ade68c8e0f38291aa44a698224a398cdc053cb80;p=0xmirror%2Fquic-go.git ci: fix cache save and restore logic for cross compile workflow (#5300) 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. --- diff --git a/.github/workflows/cross-compile.yml b/.github/workflows/cross-compile.yml index 1669d6b0..928d784c 100644 --- a/.github/workflows/cross-compile.yml +++ b/.github/workflows/cross-compile.yml @@ -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