olafurw / poke-fighting-rust

Application that simulates a large grid of Pokémon types fighting each other.
24 stars 3 forks source link

Use the standard GitHub cache action #15

Closed palant closed 2 years ago

palant commented 2 years ago

Call me paranoid but I don’t like depending on third-party stuff for the build infrastructure. So I looked into whether there is a more canonical caching solution for Github actions. Turns out there is: https://github.com/actions/cache/blob/main/examples.md#rust---cargo. It works well for my repo.

One has to commit the Cargo.lock file however. That’s probably recommendable either way.

olafurw commented 2 years ago

Sure, seems fine. I just picked some from google.

palant commented 2 years ago

There is one more difference: the way I understood, the action you used cannot clean up the cache for release builds. The cache key doesn’t change when dependencies change, so it just keeps adding to the existing cache. With action/cache on the other hand each dependency change results in a cache key change and a clean rebuild of all dependencies.

olafurw commented 2 years ago

Good call.