-
Notifications
You must be signed in to change notification settings - Fork 107
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
Improve GitHub Actions for faster checks and better readability #3377
Conversation
Lint on push to all branches, except for main, as this action will be required to merge. Just run the lint action when a Rust file is changed, as it won't make sense to run it on other scenarios. DRY with uneeded jobs
Codecov Report
@@ Coverage Diff @@
## main #3377 +/- ##
==========================================
- Coverage 78.34% 78.26% -0.08%
==========================================
Files 267 267
Lines 31526 31526
==========================================
- Hits 24698 24675 -23
- Misses 6828 6851 +23 |
I wonder which tests we want to run when tagging a new release, e.g PR #3256 These PRs typically change:
On the one hand it would be nice to run the whole test suite, on the other hand it doesn't really seem necessary and can delay tagging the release sometimes... @ZcashFoundation/zebra-team any thoughts? |
I don't think there's any way to avoid running the full test suite for changes to these files:
Since cargo lock can change dependency versions, we need to run the full test suite on any changes to these files. We could automate updating the user agent in the zebra network constants, but that wouldn't actually change the overall risk of tagging a release. Instead, if our tests are running too slowly, we should consider paying for a bigger machine to run tests on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a useful change, but the path inclusions could be quite risky.
How do we know that we haven't accidentally missed some paths that should be checked?
How will we make sure we keep the list of paths up to date as we make changes to Zebra?
Can we exclude paths that we are sure aren't needed, rather than trying to track all of the paths that are needed?
Using an exclude list is less risky, because if we forget to exclude some files, then CI just becomes a bit slower. But if we forget to include some files, we can merge bugs into the zebra main branch.
I also wonder about the GitHub CI cache limit. We are already hitting that limit, and adding more jobs will increase our cache usage. So we should check that this new set of jobs is actually faster, particularly after the caches have been populated.
Also refactor this to use a more redable and change prone cargo-deny-action. And move this actions out of the clippy-deps job, as this are more related to CI than linting.
Add advisories checks in a different PR
At least for the most critical workflows (CI, Coverage, Lint, and Test), we're covering over 99% of the codebase with:
And considering most critical changes with:
|
Ok, that seems fine for now. If some bugs get through CI, we can fix it then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for splitting out the functionality changes into a separate PR.
I just have a few questions about when jobs need to run.
@gustavovalverde this PR splits a CI job that is required to merge. So we need to add the new (The dependency checks are important, so they should be required to merge.) |
If we only run CI on branches that are going to merge to main, then PR series become a lot harder to test. (Because each PR is based on the previous PR, not main.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, but maybe we should get @dconnolly to do a review as well.
Motivation
All GitHub Actions workflows that are triggered by an event, are being run independently of the files or folder changed. Making all PRs take the same amount of CI time and going through the whole test suite.
Depending on the files being changed, specific workflows must run, not all of them if not needed.
Related to: #3359
Depends-On: #3386
Solution
book/
folder is changed or any firebase configuration.book/
folder.Review
The whole @ZcashFoundation/zebra-team should review this.
Follow Up Work
Add
Check deny.toml crate dependencies and validate licenses
to the list of required checks for each PR, in the Zebra GitHub repository settings.Another PR will include better use of GitHub variables, removing not-needed steps, using major versions on actions, and allowing automatic bug fixes. It will also improve overall readability and secret management.
Edit: Moving
pull-request (zealous-zebra)
to a GitHub Action.