From 9805f37d893f199ba25387e2dc595e4057dc32a9 Mon Sep 17 00:00:00 2001 From: BD103 <59022059+BD103@users.noreply.github.com> Date: Tue, 27 Aug 2024 13:58:01 -0400 Subject: [PATCH] feat: update readme to mention `cargo-cache` --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 882d3e5..31fc443 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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.