Swatinem / rust-cache

A GitHub Action that implements smart caching for rust/cargo projects
GNU Lesser General Public License v3.0
1.31k stars 107 forks source link

Support custom cargo profiles #56

Closed vorporeal closed 2 years ago

vorporeal commented 2 years ago

https://github.com/Swatinem/rust-cache/commit/74e8e24b6d304f00f8f8036ea7288528ba43f722 added support for the default release profile, in addition to debug. We define a custom profile for some of our builds (release-lto) - would there be a way for the action to support custom cargo profiles?

Our build artifacts end up in target/release-lto instead of target/release.

Cargo custom profile docs: https://doc.rust-lang.org/cargo/reference/profiles.html#custom-profiles

Swatinem commented 2 years ago

Absolutely! I wanted to overhaul the way that the root of the target directory is being cleaned, to also better support cargo-llvm-cov, which saves the coverage profiles there as well, which should be cleaned.

Swatinem commented 2 years ago

This should now work with v2.