-
Notifications
You must be signed in to change notification settings - Fork 360
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
feat(ci): add script to validate each commit in PR #1955
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Meet Soni <[email protected]>
Hey @daemon1024! |
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.
Hey, thanks for the PR. I have a few suggestions.
Also, did you test these changes anywhere?
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.23 |
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.
Consider using go-version-file: KubeArmor/go.mod
for defining go version
cd KubeArmor | ||
echo "Building KubeArmor for commit $commit..." | ||
if make build; then | ||
echo "✅ Commit $commit compiled successfully." |
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.
I would also recommend showing the error in the logs
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.
GitHub Actions captures all logs from make build
, do we need to add manual logs?
for example, here's the log from GH action when i was testing manually:
Error: ./main.go:40:68: syntax error: unexpected newline in argument list; possibly missing comma or )
Error: ./main.go:41:4: syntax error: unexpected return at end of statement
make: *** [Makefile:26: build] Error 1
❌ Commit e52b12d577936188e5b7aea2c9ddb30fb6b60b17 failed to compile!
=========================================
Error: Process completed with exit code 1.
Thanks for reviewing!
I'm not sure whether there should be a test for this? |
Signed-off-by: Meet Soni <[email protected]>
Purpose of PR?:
Implement feature that ensures that each commit of PR is separately compiles.
Closes: #616
If the changes in this PR are manually verified, list down the scenarios covered::
Manually tested in fork, with both appropriate commits that should and does compile as well as invalid commits that should and does fail.
Checklist:
<type>(<scope>): <subject>