-
Notifications
You must be signed in to change notification settings - Fork 566
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
WIP: Attempt to speed up CI by caching cargo dependencies #1086
Conversation
cool, work on this stuff is definitely appreciated! |
This Pull request at the "official example" repository might have some additional info and help. |
I am pretty new to rust and github. So i hope my writing makes sense and that i'm doing it in the correct format. :) I looked into the examples of the pull request linked above and read a bit more into how it worked. We can lower the size of the cache by only caching ~/.cargo/registry/index and ~/.cargo/registry/cache instead of the whole ~/.cargo/registry directory. |
@justinmoon where did this work end up? |
If you are having trouble getting it to work then i could try and take a swing at it in a separate PR. If you wouldn't mind :). Been doing a lot of reading and some testing with the CI and i think i have something that should work. |
So i pulled down my own PR again that only handled the downloaded dependency crates and crates.io index, because over time i wasn't too happy with the modest improvement. Sometimes it actually took a bit longer because restoring a Github cache seems to fluctuate between a few seconds to several minutes, even for the same small cache. Tho i do think there is proper gains to be had from caching the build target. My first attempt was to keep incremental compilation off and then clean only the druid artifacts with Cargo clean -p and or Powershell. The next attempt was to enable incremental and then just optimize the build target for size. Sorry for the long ramble! Just wanted to share some findings. Edit: |
Just read through this pinned issue over on the GitHub cache repository. I think we should maybe put this on hold a bit until at least the cache restore times are more consistent. |
@Blisto91 that pinned issue has been updated - v2.1.0 of the cache action has been released, which should resolve the inconsistent cache restore times. (v2 has already been updated to point to v2.1.0) |
@CleanCut ye I saw and I've seen much more consistant restore times in my tests since then. Now I just want windows to use Zstd and the new rust feature resolver to get stabilized and then I'm a satisfied man 😁 Edit: Saw this on the new github roadmap. |
That would be really cool. 👍 |
@justinmoon What's the status here? Do you think it's worth merging? |
@cmyr I think there is a good chance the CI will fail on subsequent runs after the cache have been saved. I have toyed a bit with sccache and i think that might work fine. |
@Blisto91 be my guest, it would certainly be nice to get this sped up. Another option of course is to just break up the work into more separate jobs, that ultimately leads to more maintenance though so it's a tricky tradeoff 😒 |
I'm attempting to adapt an "official example". This same technique worked for my project which uses Druid (7 minute build -> 2 minute build), but it doesn't speed things up here.
I suspect the problem might be that Cargo.lock isn't checked in -- as discussed in this thread.
Perhaps druid being a "workspace" also interferes somehow?
Note about CI in cargo book.