-
-
Notifications
You must be signed in to change notification settings - Fork 62
fix(cache): exclude rust from mise cache #474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,6 +94,30 @@ You can also extend the default cache key: | |
|
|
||
| This gives you full control over cache invalidation based on the specific aspects that matter to your workflow. | ||
|
|
||
| ### Rust and Cargo Caches | ||
|
|
||
| This action caches mise's own data, but it does not save Rust toolchains. | ||
| According to [mise's Rust documentation](https://mise.jdx.dev/lang/rust.html), | ||
| Rust is managed by rustup, uses `RUSTUP_HOME` and `CARGO_HOME`, and does not live | ||
| under mise's `installs` directory. For Rust projects, cache Cargo dependencies, | ||
| build artifacts, and Cargo-installed tools explicitly. | ||
|
|
||
| The usual setup is to run `Swatinem/rust-cache` after `mise-action`, so the cache | ||
| key can include the Rust/Cargo environment and Cargo lockfiles: | ||
|
|
||
| ```yaml | ||
| - uses: jdx/mise-action@v4 | ||
| with: | ||
| install: true | ||
|
|
||
| - uses: Swatinem/rust-cache@v2 | ||
| ``` | ||
|
|
||
| `Swatinem/rust-cache` caches `~/.cargo` and `target` by default, including | ||
| `~/.cargo/bin` for tools installed during the workflow. If your workflow uses a | ||
| custom `CARGO_HOME`, or installs Cargo tools somewhere else, add that directory | ||
| to your cache configuration manually. | ||
|
Comment on lines
+116
to
+119
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is more accurate to state that |
||
|
|
||
| ## GitHub API Rate Limits | ||
|
|
||
| When installing tools hosted on GitHub (like `gh`, `node`, `bun`, etc.), mise needs to make API calls to GitHub's releases API. Without authentication, these calls are subject to GitHub's rate limit of 60 requests per hour, which can cause installation failures. | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~/.cargodescription is a slight over-simplification.Swatinem/rust-cachedoes not cache the entire~/.cargotree — it caches specific subdirectories (registry/index,registry/cache,git/db) plus~/.cargo/bin(whencache-bin: true, the default) and thetargetdirectory. Notably,~/.cargo/registry/srcis explicitly not cached because cargo recreates it from the compressed archives. Saying "caches~/.cargoandtarget" may lead users to assume all cargo data is persisted when it isn't.