-
-
Notifications
You must be signed in to change notification settings - Fork 98
Add github actions #145
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
base: master
Are you sure you want to change the base?
Add github actions #145
Conversation
@@ -0,0 +1,38 @@ | |||
name: Tests | |||
|
|||
on: [push] |
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.
should this be on: [push, merge_requests]
?
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'm not really sure, but in my experience adding both will result in the tests running twice, as you can see on a test PR I made here (tests failing can be ignored, just for demonstrating).
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 is correct. by using the merge request option it runs one set of actions on the branch and one more set of actions on the potential merge commit that would be originated if the merge request is merged.
the last part is important for the case in which your local branch is not up to date with the latest main/master branch.
this is the user case:
- you create a new branch starting from
main
, you start adding commits there, and the build is green - in the mean time someone adds a bunch of commits to
main
(as example making other merge requests or pushing directly to the branch) and the build is also green, but the changes are not compatible with the changes you did in your branch (even if there are no git conflicts) - at this point both branches have a green build, but if you merge your branch, the resulting pipeline will be broken
with the merge request builds you reduce the possibility of failure. in reality the merge request approach does not give you the guarantee that the merged result will still be green. there are mainly two popular approaches to have the build always green.
- run the merge request actions after pressing the merge request button, and cancel the merge if the actions build fails
- enforce that the merge request branch is always in sync with the latest main branch
both this approaches have advantages and downsides, but is are one of the most common approaches to ensure a green build
No description provided.