Skip to content

Commit

Permalink
Deal with the fact that GitHub won't do automatic cache replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
dabrahams committed Mar 3, 2024
1 parent 17a6c80 commit 18bb063
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/llvm-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ jobs:

- name: Setup sccache
uses: compnerd/[email protected]
id: sccache
with:
max-size: 100M
key: ${{ matrix.os }}-build_tools
restore-keys: ${{ matrix.os }}-build_tools
variant: sccache
append-timestamp: false

Expand Down Expand Up @@ -120,6 +120,16 @@ jobs:
name: build-tools-${{ matrix.os }}
path: ${{ github.workspace }}/BinaryCache/0/tools.tar

- name: Clear old sccache
if: ${{ steps.sccache.outputs.test-cache-hit }}
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
gh extension install actions/gh-actions-cache
gh actions-cache delete ${{ matrix.os }}-build_tools --confirm
continue-on-error: true

distribution:
needs: [build_tools, create_tag]

Expand Down Expand Up @@ -279,11 +289,11 @@ jobs:
version: 1.11.1

- name: Setup sccache
id: sccache
uses: compnerd/[email protected]
with:
max-size: ${{ matrix.compile_cache_max_size }}
key: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.configuration }}-package
restore-keys: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.configuration }}-package
variant: sccache
append-timestamp: false

Expand Down Expand Up @@ -394,3 +404,13 @@ jobs:
with:
files: ${{ env.PACKAGE_NAME }}${{ matrix.package_suffix }}
tag_name: ${{ needs.create_tag.outputs.tag_name }}

- name: Clear old sccache
if: ${{ steps.sccache.outputs.test-cache-hit }}
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
gh extension install actions/gh-actions-cache
gh actions-cache delete ${{ matrix.os }}-build_tools --confirm
continue-on-error: true

0 comments on commit 18bb063

Please sign in to comment.