From e4fe243c70e347b77abd52e2eec79f6aa2319ba9 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 19 May 2026 20:56:16 +0900 Subject: [PATCH] Cache ~/.rustup/toolchains in CI to fix clippy missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, jdx/mise-action cached only ~/.local/share/mise, which stores a symlink to the actual rustup toolchain in ~/.rustup. On a cache hit, mise saw the symlink and skipped reinstallation, leaving ~/.rustup empty. rustup then lazily installed only 3 minimal components (rustc, rust-std, cargo) when cargo first ran, omitting clippy — causing `cargo clippy` to fail. The fix adds an actions/cache@v5 step to also cache ~/.rustup/toolchains, keyed on the OS and a hash of mise.toml. On a warm cache the full toolchain (including clippy) is restored before mise-action runs, so mise finds both its symlink and the real files intact. To force-invalidate the rustup cache, bump the key prefix from rustup-v1 to rustup-v2. For the mise cache, pass cache_key_prefix: mise-v2 to jdx/mise-action, or use: gh cache delete --all --repo fedify-dev/feder Assisted-by: Claude Code:claude-sonnet-4-6 --- .github/workflows/main.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e8db0fe..0b0c314 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -11,5 +11,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 + # Work around jdx/mise-action not caching ~/.rustup alongside + # ~/.local/share/mise, which causes Rust components (e.g. clippy) to go + # missing on cache hits. See: https://github.com/jdx/mise-action/issues/215 + - uses: actions/cache@v5 + with: + path: ~/.rustup/toolchains + key: rustup-v1-${{ runner.os }}-${{ hashFiles('mise.toml') }} - uses: jdx/mise-action@v4 - run: mise run check