Skip to content

Updated the GitHub Actions script to include caching #680

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 4 commits into from
Apr 6, 2020

Conversation

Kixiron
Copy link
Member

@Kixiron Kixiron commented Apr 1, 2020

  • Added caching to the Actions flow
    • Caches the cargo registry at ~/.cargo/registry
    • Caches cargo binaries at ~/.cargo/bin
    • Caches cargo git at ~/.cargo/git
    • Caches /target build artifacts
    • Caches based off of the hash of the Cargo.lock, so changes that alter it will require full rebuilds
    • Will hopefully provide faster CI build/test times

@jyn514
Copy link
Member

jyn514 commented Apr 1, 2020

r? @pietroalbini

@pietroalbini
Copy link
Member

I don't think this is effective in the long term: GitHub Actions's cache is immutable, and the same key won't be reuploaded if the files on disk change. Files in target/ are regenerated after rustc updates, so we'll need to include the rustc version in the cache key.

You can see how crates.io does it.

@pietroalbini pietroalbini self-assigned this Apr 3, 2020
@Kixiron
Copy link
Member Author

Kixiron commented Apr 3, 2020

Anything that speeds up builds is a plus in my books, do you prefer cargo's caching for build artifacts + caching cargo artifacts?

@pietroalbini
Copy link
Member

I think this PR is fine if the rustc version is added to the cache keys. Otherwise once a new stable version is released we'd lose all the performance boost of caches.

@pietroalbini
Copy link
Member

Great, thanks!

@pietroalbini pietroalbini merged commit 4c704dc into rust-lang:master Apr 6, 2020
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