openscanhub icon indicating copy to clipboard operation
openscanhub copied to clipboard

ci: Avoid duplicate runs of workflows

Open siteshwar opened this issue 2 years ago • 5 comments

GitHub Actions CI is configured to run on push and pull_request events on the main branch. This causes duplicated runs of the workflows when a PR gets merged. We should avoid duplicating workflow runs in such scenarios.

siteshwar avatar Jun 21 '23 13:06 siteshwar

This isn't the right thing to do. Why would you want to accomplish such a behavior?

I can recall quite a few moments when CI on PR passed, and once PR got merged, it failed for various reasons (the PR branch was missing some commits from the main, etc.).

A good example is tests and test coverage. You generally want to run tests and upload test coverage on pull_request to measure changes in coverage with changes from PR. Once merged, you want to run it again to measure and update the overall test coverage of the project.

But if you want to accomplish this thing. The only option is to run workflows only on pull_request or push events.

jamacku avatar Jun 27 '23 08:06 jamacku

I think @siteshwar meant the case where both branches point to the same commit object, which is the most common case in this project. I fully agree that it makes sense to re-run the tests if main refers to a different commit (or even a different tree) after the merge.

kdudka avatar Jun 27 '23 10:06 kdudka

@siteshwar Do you have any updates?

lzaoral avatar Oct 12 '23 10:10 lzaoral

@siteshwar Ping?

lzaoral avatar Oct 30 '23 08:10 lzaoral

@siteshwar Ping?

Sorry, I have not taken a look at this issue and its not my priority for now.

siteshwar avatar Oct 30 '23 11:10 siteshwar