Skip to content

Commit

Permalink
increment branch cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Aug 29, 2024
1 parent d7f1409 commit 538ce50
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ jobs:
fail-fast: true
env:
CACHE_DIR: ${{ github.workspace }}/.container-cache
CACHE_KEY: linux-build-test-cpp-asserts-manylinux-v2-${{ github.event.number || github.ref_name }}
# either the PR number or `branch-N` where N always increments
CACHE_KEY: linux-build-test-cpp-asserts-manylinux-v2-${{ github.event.number || format('{0}-{1}', github.ref_name, github.run_number) }}
steps:
- name: Set unified TZ
uses: szenius/[email protected]
Expand Down Expand Up @@ -104,6 +105,7 @@ jobs:
# required to run gh with privileges
GH_TOKEN: ${{ github.token }}
run: |
ccache -s
gh extension install actions/gh-actions-cache
gh actions-cache delete ${{ env.CACHE_KEY }} --confirm -R ${{ github.repository }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
runs-on: [macos-12, macos-14]
env:
CACHE_DIR: ${{ github.workspace }}/.container-cache
CACHE_KEY: ${{ matrix.runs-on }}-build-test-cpp-asserts-v1-${{ github.event.number || github.ref_name }}
CACHE_KEY: ${{ matrix.runs-on }}-build-test-cpp-asserts-v1-${{ github.event.number || format('{0}-{1}', github.ref_name, github.run_number) }}
steps:
- name: Set unified TZ
uses: szenius/[email protected]
Expand Down Expand Up @@ -94,6 +94,7 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
ccache -s
gh extension install actions/gh-actions-cache
gh actions-cache delete ${{ env.CACHE_KEY }} --confirm -R ${{ github.repository }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
fail-fast: true
env:
CACHE_DIR: ${{ github.workspace }}/.container-cache
CACHE_KEY: windows-build-test-cpp-asserts-v1-${{ github.event.number || github.ref_name }}
CACHE_KEY: windows-build-test-cpp-asserts-v1-${{ github.event.number || format('{0}-{1}', github.ref_name, github.run_number) }}
steps:
- name: Set unified TZ
uses: szenius/[email protected]
Expand Down Expand Up @@ -100,6 +100,7 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
ccache -s
gh extension install actions/gh-actions-cache
gh actions-cache delete ${{ env.CACHE_KEY }} --confirm -R ${{ github.repository }}
Expand Down

0 comments on commit 538ce50

Please sign in to comment.