actions-rust-lang/setup-rust-toolchain

Option to skip using `Swatinem/rust-cache`

filips123 opened this issue · 2 comments

Problem

Currently, actions-rust-lang/setup-rust-toolchain automatically uses Swatinem/rust-cache action to configure Rust cache.

This may not work if users want to provide custom options to Swatinem/rust-cache themselves. For example, in my case, I need to provide workspaces input as my crate is in the subdirectory of a project. This causes Swatinem/rust-cache to be configured twice, which may impact performance, and also causes build warnings such as "Warning: error: could not find Cargo.toml in ...".

Proposed Solution

Add an input cache to this action (probably on by default) that determines whether Swatinem/rust-cache is configured automatically.

That sound like a good solution to the problem. I would like to have the cache enabled by default.

Add a new input to action.yml with a default. Gate the rust-cache step with an if on the new input. Document the new input in the README. Do you want to create a PR?

Yes, I can create it.