You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #1902 - jtgeibel:ci-cache-improvements, r=jtgeibel
Improve build caching on CI
These changes started based on a discussion over on [internals](https://internals.rust-lang.org/t/evaluating-github-actions/11292/8?u=jtgeibel). Basically, on every single build we end up touching some files and invaliding the caches. This forces Travis to compress and upload a new cache on every single build.
This PR includes several changes on CI:
* Incremental compilation is disabled. It appears that incremental files can change even if nothing in the codebase changes.
* Drop the `target/.rustc_info.json` file before caching, as it can change on each build.
* Running `cargo install` for the diesel CLI acts similar to a `cargo update` causing changes to the index and some caches maintained under `$HOME/.cargo`. `cargo install` is now only run if the diesel binary is not on the path. The downside to this is that if we bump the `.diesel_version` file then Travis will not be using the exact same version as Heroku until we clear the CI cache. Since we only use this binary to run migrations and we haven't bumped versions since January, I think this change is low risk compared to the improvement.
* Add `RUSTFLAGS="-C debuginfo=0"` to disable debug info, which helps shrink the cache size.
Based on my observations while putting together this PR, it looks like disabling incremental compilation has an impact on compile times, but this is small relative to the overall win on caching behavior. Additionally, our cache size has been reduced from 3948.04MB to 2439.19MB.
0 commit comments