Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,47 @@ 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 Toolchain Caches

Rust is managed differently from most mise tools. mise wraps `rustup`, so the
mise cache can restore the `installs/rust` entry while the actual rustup
toolchain and components still live in `RUSTUP_HOME` and Cargo/rustup proxy
binaries live in `CARGO_HOME`. If those homes are not restored with the mise
cache, `mise install` can skip Rust and later `cargo fmt` or `cargo clippy`
can fail with missing `rustfmt` or `clippy` components. See
[jdx/mise-action#215](https://github.com/jdx/mise-action/issues/215).

If `mise-action` installs Rust and you keep the mise cache enabled, configure
mise's Rust homes under the mise data directory before running this action, and
change the cache key so older Rust-marker-only caches are not reused:

```yaml
- name: Configure mise Rust homes
shell: bash
run: |
Comment on lines +112 to +114
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The shell command group syntax { ... } and the use of ${HOME} are specific to POSIX-compliant shells (like bash or sh). This step will fail on Windows runners where the default shell is PowerShell. To ensure this example works across all platforms supported by mise-action, it is recommended to explicitly specify the shell.

Suggested change
- name: Configure mise Rust homes
run: |
- name: Configure mise Rust homes
shell: bash
run: |

{
echo "MISE_RUSTUP_HOME=${HOME}/.local/share/mise/rustup"
echo "MISE_CARGO_HOME=${HOME}/.local/share/mise/cargo"
Comment on lines +116 to +117
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The paths ${HOME}/.local/share/mise/rustup and ${HOME}/.local/share/mise/cargo assume the default mise data directory. If a user has customized their installation using the mise_dir input, MISE_DATA_DIR, or XDG_DATA_HOME, these paths will be outside the directory cached by mise-action, and the workaround will not function. It is worth adding a note that these paths must be subdirectories of the actual mise data directory being cached.

} >> "${GITHUB_ENV}"
Comment thread
greptile-apps[bot] marked this conversation as resolved.

- uses: jdx/mise-action@v4
with:
install: true
cache_key: "{{default}}-rustup-cargo-home-v2"

- uses: Swatinem/rust-cache@v2
with:
cache-bin: "false"
Comment on lines +125 to +127
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The cache-bin input is not a valid option for Swatinem/rust-cache@v2. Additionally, rust-cache does not cache the Cargo binary directory (~/.cargo/bin) by default, so this setting is unnecessary. Including it will result in a warning from GitHub Actions regarding an unknown input.

Suggested change
- uses: Swatinem/rust-cache@v2
with:
cache-bin: "false"
- uses: Swatinem/rust-cache@v2

```

`MISE_RUSTUP_HOME` and `MISE_CARGO_HOME` make mise place rustup toolchains,
rustup metadata, and Cargo/rustup proxy binaries inside the directory saved by
the mise cache. If you set `mise_dir`, `MISE_DATA_DIR`, or `XDG_DATA_HOME`,
adjust these paths so they stay under the mise data directory that this action
caches. `Swatinem/rust-cache` can still be used after `mise-action` for Cargo
registry, git dependency, and `target` build caches; `cache-bin: "false"` keeps
Cargo binaries owned by the mise cache instead of both caches.

## 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.
Expand Down
Loading