Skip to content

Cache the target directory based on the compiler version #738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 15, 2020

Conversation

pietroalbini
Copy link
Member

@pietroalbini pietroalbini commented Dec 14, 2020

While Travis CI dynamically updated the caches after builds finished (with a different cache for each branch), GitHub Actions identifies each cache with a key and never updates a cache with the same key, even if the contents of the cached directory changed.

Before this PR, we cached the target directory based on the hash of the Cargo.lock file, which means the cache was never updated as long as the Cargo.lock didn't change. Unfortunately this was not enough, as the existing target directory is useless after a Rust version update. We also did not cache the crates.io index nor the downloaded dependencies.

This PR changes the CI configuration to also include the Rust version in the cache key. This also adds caching for the crates.io index and the downloaded crates. This should speed up CI from 2.5 minutes to 30 seconds.

@pietroalbini pietroalbini marked this pull request as ready for review December 14, 2020 11:49
@pietroalbini pietroalbini requested a review from a team as a code owner December 14, 2020 11:49
@pietroalbini pietroalbini merged commit f1d4c73 into rust-lang:master Dec 15, 2020
@pietroalbini pietroalbini deleted the fix-ci-cache branch December 15, 2020 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants