Skip to content

Commit ded6873

Browse files
committed
Merge bitcoin/bitcoin#28292: ci: Disable cache save for pull requests in GitHub Actions
241d6ca ci: Disable cache save for pull requests in GitHub Actions (Hennadii Stepanov) Pull request description: This PR disable cache save for pull requests in GitHub Actions. Otherwise, multiple pull requests fill GitHub Actions cache quota shortly. See a discussion [here](bitcoin/bitcoin#28187 (comment)). --- **NOTE** for the maintainers with "owner" permissions. This PR needs the `actions/cache/restore@*` and `actions/cache/save@*` acrions to be explicitly allowed in the repository's Actions permissions. ACKs for top commit: MarcoFalke: lgtm ACK 241d6ca Tree-SHA512: a7786c7ec99bfa6991bf6ae08fd7ed3546e8c5d083a1b2bae7638f6f31e77fdf2cf4fc69d85834faf87f98db1f4a82026ce1dc5fc1bc6650e8bf1c09bf7e90f5
2 parents 723f1c6 + 241d6ca commit ded6873

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,20 @@ jobs:
5151
- name: Set Ccache directory
5252
run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV"
5353

54-
- name: Ccache cache
55-
uses: actions/cache@v3
54+
- name: Restore Ccache cache
55+
uses: actions/cache/restore@v3
5656
with:
5757
path: ${{ env.CCACHE_DIR }}
58-
key: ${{ github.job }}-ccache-cache-${{ github.run_id }}
59-
restore-keys: ${{ github.job }}-ccache-cache
58+
key: ${{ github.job }}-ccache-${{ github.run_id }}
59+
restore-keys: ${{ github.job }}-ccache-
6060

6161
- name: CI script
6262
run: ./ci/test_run_all.sh
63+
64+
- name: Save Ccache cache
65+
uses: actions/cache/save@v3
66+
if: github.event_name != 'pull_request'
67+
with:
68+
path: ${{ env.CCACHE_DIR }}
69+
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
70+
key: ${{ github.job }}-ccache-${{ github.run_id }}

0 commit comments

Comments
 (0)