-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ci: improve github workflows #1460
base: master
Are you sure you want to change the base?
Conversation
Centralise the CI in main.yml making it easier for contributors to understand the requirements avoid them to view non-standard script files. Fix detection of new files so that broken changes are detected by CI. Eliminate duplicate test run to reduce the time needed to run. Add check for go mod tidy to ensure that go mod is clean before it's allowed to be merged. Update to action/setup-go@v4 which enables caching by default improving the performance of all workflows.
ba2ff69
to
83b38eb
Compare
run: | | ||
go mod tidy | ||
(cd _codegen && go mod tidy) | ||
git --no-pager diff && [[ -z $(git status -s) ]] |
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.
We can use --exit-code
parameter here and below:
git --no-pager diff && [[ -z $(git status -s) ]] | |
git --no-pager diff --exit-code |
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.
That wouldn't handle the case where there are new files generated unfortunately., which is what git status -s
catches.
The separate scripts allow the maintainers and the contributor to run the checks offline on their local machine without depending on GitHub Actions. This is a feature, not a bug! GitHub Action checkout v4 is already #1408. Please review it. |
Please split this MR in multiple ones:
Also drop the merge of |
Summary
Centralise the CI in GitHub workflow, fix detection missing changes and improve performance.
Changes
main.yml
action/setup-go@v4
Motivation
Make it easier for contributors to understand the requirements by avoiding them having to view and understand non-standard script files.
Ensure that missing changes / clean are detected before merges, to improve quality.
Speed up actions by removing duplicate actions and using caching.