TheBevyFlock / bevy_new_2d

This template is a great way to get started on a new 2D Bevy game!
https://the-bevy-flock.itch.io/bevy-new-2d
MIT License
186 stars 30 forks source link

Enable cache sweeping in CI #289

Closed BD103 closed 2 months ago

BD103 commented 2 months ago

Addresses part of #212.

I recently merged a feature into Leafwing-Studios/cargo-cache v2.3.0 that automatically deletes unused build artifacts before creating a new cache, to prevent cache sizes from snowballing.

It's disabled by default due to backward compatibility reasons, so this PR enables it. Cache sweeping should keep cache sizes small and workflow runs fast.

(As an side, should a cache be used at all in the release build? Caching prevents builds from being reproducible, and can introduce the occasional issue when building.)

BD103 commented 2 months ago

I made a temporary commit (7188e2c623e4b4fc97cd9abad3d55c3ae364544d) that updates some dependencies, which will make some build artifacts stale. After looking at the run, it removed 365 MiB on the Clippy and Docs jobs and removed a whopping 3.68 GiB on the Tests job.

These savings will only occur when a fallback key is used (typically when Cargo.lock or Cargo.toml is changed), but are quite significant. The only downside is an ~2 second overhead in the cache action from downloading cargo-sweep.

janhohenheim commented 2 months ago

That's really impressive :D Good work!