mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 07:39:08 +01:00
Merge bitcoin/bitcoin#33905: ci: Consistenly only cache on the default branch
fa411f938eci: Consistenly only cache on the default branch (MarcoFalke) Pull request description: Fixes https://github.com/bitcoin/bitcoin/issues/33685 The general idea for caches is to only save them on pushes to the default branch, because the cache is limited in size and time that the only benefit of the cache can be to speed up pull requests against the default branch. Backport pull requests to older branches don't benefit from caches, because usually they will be running into a cache miss anyway. Also, they would cause the cache size to overflow and lead to cache misses down the line. So fix it by consistently applying cache saves only on the default branch. For reference, the same is already done for the composite action in this repo:2444488f6a/.github/actions/save-caches/action.yml (L15)ACKs for top commit: hebasto: ACKfa411f938e. willcl-ark: ACKfa411f938eTree-SHA512: 59d3de4201b596e5f7eb1915c4bd5ded80bcd4df217f8f5d62d92fa8977a77e2c4c8602b17755b33ff0dfa87f2896e7c1c8f4da8e6a77c111f2a42ec9cf78ffd
This commit is contained in:
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -196,7 +196,7 @@ jobs:
|
||||
|
||||
- name: Save Ccache cache
|
||||
uses: actions/cache/save@v4
|
||||
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
|
||||
if: github.event_name != 'pull_request' && github.ref_name == github.event.repository.default_branch && steps.ccache-cache.outputs.cache-hit != 'true'
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
|
||||
@@ -276,7 +276,7 @@ jobs:
|
||||
|
||||
- name: Save vcpkg binary cache
|
||||
uses: actions/cache/save@v4
|
||||
if: github.event_name != 'pull_request' && steps.vcpkg-binary-cache.outputs.cache-hit != 'true' && matrix.job-type == 'standard'
|
||||
if: github.event_name != 'pull_request' && github.ref_name == github.event.repository.default_branch && steps.vcpkg-binary-cache.outputs.cache-hit != 'true' && matrix.job-type == 'standard'
|
||||
with:
|
||||
path: ~/AppData/Local/vcpkg/archives
|
||||
key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('cmake_version', 'msbuild_version', 'toolset_version', 'vcpkg.json') }}
|
||||
|
||||
Reference in New Issue
Block a user