Skip to content

Switch to Swatinem/rust-cache #402

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

Merged
merged 3 commits into from
May 2, 2025
Merged

Switch to Swatinem/rust-cache #402

merged 3 commits into from
May 2, 2025

Conversation

BD103
Copy link
Member

@BD103 BD103 commented Apr 30, 2025

This is an experiment to see if this cache action performs better than Leafwing-Studios/cargo-cache, just like TheBevyFlock/bevy_new_2d#381. If this gets merged we can test it for a few weeks then evaluate whether it's an improvement or not.

Closes #400.

@BD103 BD103 added A-CI Related to CI and GitHub Actions C-Feature Make something new possible D-Trivial Nice and easy! A great choice to get started with Bevy CLI D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes and removed D-Trivial Nice and easy! A great choice to get started with Bevy CLI labels Apr 30, 2025
@BD103
Copy link
Member Author

BD103 commented Apr 30, 2025

There are some benefits to this change:

  1. Caches will only be saved on the main branch. This prevents our cache storage limit from being filled up too quickly when there are multiple active PRs.
  2. Action only caches dependencies, not the actual crates in the workspace. (This means things like bevy, toml, and serde will be cached, but not bevy_lint or bevy_cli.)
  3. Incremental compilation is disabled, since it's only used to rebuild workspace crates like bevy_cli and bevy_lint, takes up a lot of disk space, and can grow outdated quickly.
  4. Implements a better system than cargo-sweep that clears artifacts that have been unmodified for over a week. (cargo-sweep uses access time, but many OS's don't update access time properly for performance reasons.)

I'm curious to see how well this avoids rebuilding dependencies and reduces our cache sizes.

@BD103 BD103 added the S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged label Apr 30, 2025
Copy link
Collaborator

@DaAlbrecht DaAlbrecht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was pretty happy with our CI, the build times were really good in the end but excited to try this out!

@BD103 BD103 removed the S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged label May 2, 2025
@BD103
Copy link
Member Author

BD103 commented May 2, 2025

So far it seems like the overall runtime has decreased from around 14 minutes to 6 minutes. We'll check back in a few weeks to see if runtimes manage to stay that fast! We can use the actions performance metrics for this. I also deleted all current caches, so we're about to start fresh.

@BD103 BD103 enabled auto-merge (squash) May 2, 2025 01:01
@BD103 BD103 merged commit 5cc3047 into main May 2, 2025
10 checks passed
@BD103 BD103 deleted the rust-cache branch May 2, 2025 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CI Related to CI and GitHub Actions C-Feature Make something new possible D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch to Swatinem/rust-cache
2 participants