Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Make sure that cargo-nextest is cached as well #70

Merged
merged 1 commit into from
May 5, 2023

Conversation

elasticdog
Copy link
Member

The order matters here since rust-cache cleans out any files in ~/.cargo/bin that were present before the action ran, which means we'll want to install nextest after running the cache job. The install-action job will check for newer versions appropriately.

The one thing I'm not sure about is if rust-cache will key based off of the contents of the ~/.cargo/bin directory, or if it's just saving that into the cache. If it does key off of the contents, we may need to always install nextest even if it's not going to be used (for check/ format/lint jobs) so we can maintain cache efficiency.

See:

The order matters here since rust-cache cleans out any files in
`~/.cargo/bin` that were present **before the action ran**, which means
we'll want to install nextest **after** running the cache job. The
install-action job will check for newer versions appropriately.

The one thing I'm not sure about is if rust-cache will key based off
of the contents of the `~/.cargo/bin` directory, or if it's just saving
that into the cache. If it does key off of the contents, we may need
to always install nextest even if it's not going to be used (for check/
format/lint jobs) so we can maintain cache efficiency.

See:
- https://github.com/Swatinem/rust-cache#cache-details
- taiki-e/install-action#66
@elasticdog elasticdog added this pull request to the merge queue May 5, 2023
Merged via the queue into main with commit e9bf03a May 5, 2023
@elasticdog elasticdog deleted the push-kkxrvqqqvwkx branch May 5, 2023 16:44
@elasticdog
Copy link
Member Author

Note that the contents of ~/.cargo/bin are not part of the cache key, so adding tools won't automatically get picked up in the cache unless we manually remove the old caches (or the main branch cache's haven't been hit for a week), but that also means that we don't have to install all of the tools as part of every job that uses Rust. Maybe we should tweak the scheduled job to only preload the cache every 8 days, so we don't accidentally keep an old one warm.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant