Skip to content

Commit

Permalink
Enable cache sweeping in CI (#289)
Browse files Browse the repository at this point in the history
Addresses part of #212.

I recently merged a feature into
[Leafwing-Studios/cargo-cache](https://github.com/Leafwing-Studios/cargo-cache)
v2.3.0 that automatically deletes unused build artifacts before creating
a new cache, to prevent cache sizes from snowballing.

It's disabled by default due to backward compatibility reasons, so this
PR enables it. Cache sweeping should keep cache sizes small and workflow
runs fast.

(As an side, should a cache be used at all in the release build? Caching
prevents builds from being reproducible, and can introduce the
occasional issue when building.)
  • Loading branch information
BD103 authored Aug 28, 2024
1 parent 57ca4be commit fe7a01f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:

- name: Populate target directory from cache
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true

- name: Run tests
run: |
Expand All @@ -55,6 +57,8 @@ jobs:

- name: Populate target directory from cache
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true

- name: Run clippy lints
run: cargo clippy --workspace --all-targets --all-features -- --deny warnings
Expand Down Expand Up @@ -93,6 +97,8 @@ jobs:

- name: Populate target directory from cache
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true

- name: Check documentation
run: cargo doc --workspace --all-features --document-private-items --no-deps
2 changes: 2 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ jobs:

- name: Populate cargo cache
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true

- name: Install dependencies (Linux)
if: ${{ matrix.platform == 'linux' }}
Expand Down

0 comments on commit fe7a01f

Please sign in to comment.