Skip to content

Commit

Permalink
feat: update readme to mention cargo-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
BD103 committed Aug 27, 2024
1 parent 4f8057c commit 9805f37
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ This is most useful if you cache the `target` directory and use `restore-keys` t

# Make sure to restore your cache before calling `cargo-sweep`.
- name: Cache build files
uses: Leafwing-Studios/cargo-cache@v2
uses: actions/cache@v4
with:
# You probably want to cache more files and use a more-detailed key. This is kept short for
# brevity's sake.
path: target
key: my-job-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
# `cargo-sweep` is only useful if you use restore keys.
restore-keys: my-job-${{ runner.os }}-

- name: Sweep cache for stale files
uses: BD103/cargo-sweep@v1
Expand All @@ -24,6 +31,8 @@ This is most useful if you cache the `target` directory and use `restore-keys` t
- run: cargo build
```
For an all-in-one caching and sweeping solution, I highly recommend [Leafwing-Studios/cargo-cache](https://github.com/Leafwing-Studios/cargo-cache), which integrates with this action directly! Set `sweep-cache: true`.

## Caching

This action, by default, caches the `cargo-sweep` binary so it does not need to build / download it again. You can disable this by setting `use-cache: false` in the inputs. Caching greatly speeds up the time of subsequent runs that do not use prebuilt binaries, but has little affect otherwise.
Expand Down

0 comments on commit 9805f37

Please sign in to comment.