quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.85k stars 394 forks source link

Cache dependencies for CI #1222

Closed Ralith closed 3 years ago

Ralith commented 3 years ago

https://github.com/marketplace/actions/rust-cache

djc commented 3 years ago

Looking at the action's docs, it seems to discuss using the top-level Cargo.toml and Cargo.lock in the cache key. We don't have a Cargo.lock but we actually only reference dependencies from the crates' Cargo.toml files. I wonder if the cache key works correctly in this particular situation?

Ralith commented 3 years ago

Comparing the two commits in this PR, it looks like it's consistently saving about a minute in the build stage, and indeed not recompiling most dependencies. I think the cache key will be fine so long as we're usually running CI on the same branch, since it looks like it gets rewritten every run anyway; backports PRs might trash it, but those should be infrequent, and could be mitigated if there's a way we can add the branch to the cache key.

Link to cache-accelerated run for posterity once I reset away the test commit: https://github.com/quinn-rs/quinn/runs/4109545662