Skip to content

ci(cache): only save caches on master branch#3249

Merged
mergify[bot] merged 4 commits into
libp2p:masterfrom
thomaseizinger:fix/ci/only-save-on-master
Dec 17, 2022
Merged

ci(cache): only save caches on master branch#3249
mergify[bot] merged 4 commits into
libp2p:masterfrom
thomaseizinger:fix/ci/only-save-on-master

Conversation

@thomaseizinger
Copy link
Copy Markdown
Contributor

@thomaseizinger thomaseizinger commented Dec 15, 2022

Description

Previously, we would always save certain smaller caches like clippy etc on each PR. This still amounts to a lot of caches. With this patch, we conditionally only save them when the workflow is run on the master branch. This gives most pull requests a good base to work with to speed them up significantly without us keeping around a lot of caches and have GitHub invalidate them constantly.

On master, the condition evaluates to true which saves the cache: https://github.com/thomaseizinger/rust-libp2p/actions/runs/3699904381/jobs/6267774899#step:5:3
On pull-requests, the condition evaluates to false which skips saving it: https://github.com/thomaseizinger/rust-libp2p/actions/runs/3700055536/jobs/6268096357#step:4:3

Notes

Draft until I confirm this works as expected in my fork. Confirmed that it works.

Links to any relevant issues

Open Questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

Copy link
Copy Markdown
Member

@jxs jxs left a comment

Choose a reason for hiding this comment

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

Makes sense, thanks for this Thomas!

@thomaseizinger
Copy link
Copy Markdown
Contributor Author

Blocked from merging by #3252.

@mergify mergify Bot merged commit 56398cb into libp2p:master Dec 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants