Use rust-cache
instead of actions/cache
for better CI performance
#60
+4
−28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replace
actions/cache
withrust-cache
Motivation and Context
rust-cache (https://github.com/Swatinem/rust-cache) not only caches necessary files and directories such as
~/.cargo
andtarget
, but also removes unused dependencies before caching. Additionally, it disables incremental compilationCARGO_INCREMENTAL=0
, which is unnecessary for CI environments.rust-cache is used in large Rust open-source software projects such as axum and others.
ref: https://github.com/tokio-rs/axum/blob/cd2d5e1417e82b6fdc69c84847e438d9b37cd6a2/.github/workflows/CI.yml#L21
I confirmed that rust-cache works in an empty commit, which was removed.
With caching, the execution time of the "Rust tests" job has been reduced from 1m 54s (without cache) to 1m 16s (with cache).
How Has This Been Tested?
Breaking Changes
Types of changes
Checklist
Additional context