Skip to content
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

avoid duplicated workflow invocations for pushes in PRs made from root repository branches #5377

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

firewave
Copy link
Collaborator

This will prevent duplicated workflows from being invoked for pushes into pull requests made from branches in the root (danmar) repository branches.

@firewave
Copy link
Collaborator Author

With these changes branches in your repo will no longer trigger CI builds if you were leveraging that.

It is possible there is a different approach but I didn't find any. I was thinking about checking if the PR branch is the same as the push branch and then dropping the push invocation but I am not sure if that is actually possible.

@danmar
Copy link
Owner

danmar commented Sep 1, 2023

@firewave Related question..
I would like to speed up our CI. I believe we can pay for extra speed. Do you know what we can do?
There is for instance the https://buildjet.com/for-github-actions does that seem interesting? Would you care to take a look?

@firewave
Copy link
Collaborator Author

firewave commented Sep 1, 2023

@firewave Related question.. I would like to speed up our CI. I believe we can pay for extra speed. Do you know what we can do? There is for instance the https://buildjet.com/for-github-actions does that seem interesting? Would you care to take a look?

I don't think we need to pay for speed - it would mainly help with the build times but those aren't our bottleneck (ccache helped a lot there), it's a lot of other things. The CI is considerably fast - a PR can be filed, reviewed and merged within 30 minutes.

There's several jobs we can shed and things still to speed up:

MinGW (#4400), Cygwin and clang-tidy are the big outliers.

I will try to file tickets about those.

@firewave firewave marked this pull request as ready for review September 1, 2023 16:22
@danmar danmar merged commit bf5e633 into danmar:main Sep 1, 2023
@firewave firewave deleted the ci-push-pr branch September 1, 2023 16:53
@firewave
Copy link
Collaborator Author

firewave commented Sep 1, 2023

Thanks. This might just be temporarily. I will monitor it and check if things are actually working as expected. I will also do some tests over the next days and try to find a more targeted approach. But give it a few days as I am still not well and will be out a bit over the weekend.

@chrchr-github
Copy link
Collaborator

Starting around this time frame, actions are no longer triggered if I push changes to a branch of my fork. Is anyone else seeing that?

@firewave
Copy link
Collaborator Author

firewave commented Sep 6, 2023

Starting around this time frame, actions are no longer triggered if I push changes to a branch of my fork. Is anyone else seeing that?

Yes, that is what this does. I was fearing people were using that in their forks (I don't)...

I was looking for a more targeted solution but it does not seems possible. I am quite baffled by that as this behavior would render repos with very long-running CI jobs totally unusable (not to speak about the extra costs we would encounter if you would pay for the runners).

@chrchr-github
Copy link
Collaborator

Is it possible to trigger the actions manually? Or do I need to create a PR just to see if the CI passes?

@firewave
Copy link
Collaborator Author

firewave commented Sep 6, 2023

Is it possible to trigger the actions manually? Or do I need to create a PR just to see if the CI passes?

Only individually (also a thing I don't understand - which is a pain if you want to test things manually or need to cancel them) and if they are configured to (workflow_dispatch).

The only way is to revert the change. That would be fine with me.

I made this change because if someone works on the main repo or files a PR from there the CI is basically clogged up for hours because each individual push as well as the pull request itself will trigger the workflows. Which is very disruptive to say the least but no one's fault.

I was looking into a different approach which would detect in the push that it is a pull request but I am very doubtful that will actually work at all.

@chrchr-github
Copy link
Collaborator

How do I trigger an action for a specific branch of mine?

danmar added a commit that referenced this pull request Sep 6, 2023
…from root repository branches (#5377)"

This reverts commit bf5e633.
@chrchr-github
Copy link
Collaborator

My fork is up to date, but still no actions after the revert: https://github.com/chrchr-github/cppcheck/actions

@firewave
Copy link
Collaborator Author

firewave commented Sep 8, 2023

This was only reverted in the 2.12.x branch and not in main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants