rojo icon indicating copy to clipboard operation
rojo copied to clipboard

added caching to ci builds to reduce build times

Open blake-mealey opened this issue 3 years ago • 2 comments

This adds caching to the CI workflow which should improve build times quite a bit. I used the recommended cache parameters from here: https://github.com/actions/cache/blob/main/examples.md#rust---cargo

I tried this approach in my project and it took build times from ~1min to ~10s:

  • before: https://github.com/blake-mealey/rocat/runs/3999515438?check_suite_focus=true
  • after: https://github.com/blake-mealey/rocat/runs/4015757268?check_suite_focus=true

Note that I haven't added caching to the release workflow. We could do this as well but I don't think it'll give you any benefit since whenever you run that workflow your Cargo.toml has changed (bumped version number) and therefore it will always have a cache miss.

blake-mealey avatar Oct 26 '21 23:10 blake-mealey

IMHO--caches in CI are kind of spooky, CI times on GitHub Actions aren't bad enough to warrant them, and if they cache when they shouldn't you can get some nasty to debug problems.

Kampfkarren avatar Oct 26 '21 23:10 Kampfkarren

This is neat, but @Kampfkarren's concerns about cache spookiness resonate with me. I don't think our CI is quite slow enough for me to want to take this on yet!

I'd like to keep this PR open for future reference.

LPGhatguy avatar Nov 20 '21 22:11 LPGhatguy