Skip to content
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

fix(build): Always run tests on main to create reusable caches #279

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

cstepanian
Copy link
Contributor

@cstepanian cstepanian commented Aug 14, 2024

Pull Request #264 changed the build settings so that tests would not be run on all pushes to the main branch.
Unfortunately, while it seems wasteful to do redundant builds, this has the consequence of preventing re-use of build caches.

The reason is that build caches created for Pull Requests are isolated from other PRs (except those based on that PR) and the main branch. Build caches created for main can be re-used in PR builds, which is what we want.

GitHub Actions docs on re-use of build caches

The good news is that this should save build time overall. It should also reduce churn in the storage of caches: Most of the time, caches made for main can be reused in PR builds, which means that no new caches need to be created at all for PRs that don't change Cargo.toml or Cargo.lock.

@cstepanian cstepanian requested review from alilleybrinker and a team August 14, 2024 16:52
@alilleybrinker alilleybrinker merged commit 51bcf77 into main Aug 14, 2024
6 checks passed
@cstepanian cstepanian deleted the cstepanian/fix_main_build_cache branch August 14, 2024 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants