-
Notifications
You must be signed in to change notification settings - Fork 607
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
Add skip-duplicate-actions action #1114
Add skip-duplicate-actions action #1114
Conversation
And (as before) with PRs coming from remote forks such as this one now the I will update the |
Even if I have modified only the This might be unnecessary but I think it's good practise. |
Codecov Report
@@ Coverage Diff @@
## main #1114 +/- ##
=======================================
Coverage 20.94% 20.94%
=======================================
Files 199 199
Lines 25429 25429
=======================================
Hits 5326 5326
Misses 19140 19140
Partials 963 963 Continue to review full report at Codecov.
|
In 1) you mentioned a case where it is possible to have 2 duplicate jobs on open PRs. I see that we have I'm assuming the above setting is overwritten by Thanks for such a detailed description btw! |
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.
Awesome! Thanks for adding this and the extremely detailed description
It doesn't help unfortunately. You can skip jobs that are triggered simultaneously. The solution would be to cancel the first However this is not super simple to do but I don't think this would be necessary since:
|
I think the duplicate push run when opening PR isn't worth worrying about The big value add was improving the situation for every subsequent push, as typically we fix some merge conflict before wanting to hit merge, and thats the flow breaking latency, which this PR solves! |
Closes: #1100
Description
This PR improves the
test
workflow by skipping duplicate actions.This is done using skip-duplicate-actions.
The improvements made:
1. Avoid running the
test
workflow twice onpull_request
andpush
eventsThis means that:
If Alice is working on branch
A
and commits some changes to the code, then thetest
workflow will be triggered.If Alice waits for the
test
workflow to be over (the expected behaviour) and then opens a PR to merge the branch to main, the sametest
workflow will run again.This is good because you are sure that any new PR code is always tested, and it is necessary to run a
pull_request
workflow to let codecov post the report in the comment.The "downside" of this:
If Alice is working on branch
A
and commits some changes to the code, then thetest
workflow will be triggered.If Alice doesn't wait for the
test
workflow to be over and opens the PR immediately, two duplicated jobs will run (one for thepush
event and one for thepull_request
event).This is the only case (which I am aware of) in which there will be duplicated runs of the
test
workflow.The good part:
push
event will be skipped.test
workflow is skipped again.2. Run the workflow only when go files are edited
This is a nice optimization to avoid running tests when it's not needed.
If Alice commits don't change any:
*.go
*.mod
and*.sum
, then thetest
workflow will be skipped.This is controlled by https://github.com/nikever/osmosis/blob/fix/remove-duplicate-ci-trigger/.github/workflows/test.yml#L26
Am I missing any relevant scenario where we would like to run tests?
In
pull_requests
tests will always run.3. Cancel outdated runs
This is another optimization, which is slightly more "aggressive" than the other.
Let me know if you want to keep it:
This is controlled by https://github.com/nikever/osmosis/blob/fix/remove-duplicate-ci-trigger/.github/workflows/test.yml#L23
If Alice is working on branch
A
and commits some changes to the code, then thetest
workflow will be triggered.While the workflow is running, if Alice commits another change to the same branch, the previous
test
workflow will be cancelled in favour of the newtest
workflow.Before merging
I have run multiple tests in my local repository to test different scenarios, but CIs are always tricky, and it would be great if someone from the dev team could confirm that the workflow behaves as expected.
For contributor use:
docs/
) or specification (x/<module>/spec/
)Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorer