This is the first release of cargo-ci-precache, a tool for minimizing the cache size for CI runs. See README for github actions setup.
The main advantage of this tool over other options is the ability to detect which features are enabled, and which version of each dependency is used. This allows restoring a cache made with old dependencies or features and then removing anything not used by the current build.
$CARGO_HOMEof unused dependencies. (specifically
- Cleans the target folder of unused build files, specifically:
- Local packages
- Unused packages
- Outdated packages
- Packages with outdated features
- Anything which depends on the above
- Filtering based on the target platform
- Setting which features are enabled
Still to do:
- Allow multiple feature combinations. Currently only one is allowed.
- For workspaces, allow per package features. Currently limited by what can be set on
- A better way to detect changes to enabled features. Currently done by hashing
Cargo.toml, but this is a little over zealous.