actions-rust-lang / setup-rust-toolchain

Setup a specific Rust toolchain with extra features like problem matchers
MIT License
180 stars 32 forks source link

Option to skip using `Swatinem/rust-cache` #3

Closed filips123 closed 2 years ago

filips123 commented 2 years ago

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.

jonasbb commented 2 years ago

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?

filips123 commented 2 years ago

Yes, I can create it.