Skip to content

Commit

Permalink
feat: add section to readme on caching
Browse files Browse the repository at this point in the history
  • Loading branch information
BD103 committed Aug 24, 2024
1 parent 6400e6c commit 4f8057c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,20 @@ This is most useful if you cache the `target` directory and use `restore-keys` t

- name: Sweep cache for stale files
uses: BD103/cargo-sweep@v1
with:
use-prebuilt: true

# Any artifacts used between `cargo-sweep` and the end of the job will be kept, the rest will be
# discarded.
- run: cargo build
```
## 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.

## Prebuilt binaries

This repository automatically builds and hosts binaries of `cargo-sweep`, which you can inspect in [`build-cargo-sweep.yml`](.github/workflows/build-cargo-sweep.yml). You can opt-in to downloading these binaries by setting `use-prebuilt: true`, which may drastically speed up runtimes. These binaries are built weekly for `ubuntu-latest`, `windows-latest`, and `macos-latest`, so you may not be able to use them on other platforms.
This repository automatically builds and hosts binaries of `cargo-sweep`, which you can inspect in [`build-cargo-sweep.yml`](.github/workflows/build-cargo-sweep.yml). You can opt-in to downloading these binaries by setting `use-prebuilt: true`, which may drastically speed up runtimes compared to a clean `cargo install`. These binaries are built weekly for `ubuntu-latest`, `windows-latest`, and `macos-latest`, so you may not be able to use them on other platforms.

This was originally introduced when caching was not implemented, but as of [v1.3] it has much less benefit. If your project is constantly running past Github's cache quota then you may want to enable prebuilt binaries, but in all other cases it is safer and nearly as fast to use caching instead.

[v1.3]: https://github.com/BD103/cargo-sweep/releases/tag/v1.3.0

0 comments on commit 4f8057c

Please sign in to comment.