-
Notifications
You must be signed in to change notification settings - Fork 409
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
infrastructure: add concurrency cancellation for test/build GitHub Actions #2710
Conversation
# Conflicts: # .github/workflows/qodana.yml
@@ -2,6 +2,10 @@ name: Check | |||
|
|||
on: pull_request | |||
|
|||
concurrency: | |||
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' |
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.
Having @
and spaces around it is a bit confusing, makes me think it's also some special expression syntax that does something.
In the linked documentation example they don't use spaces and use -
instead to connect context variables, which looks more familiar to me
Is there any specific reason to using @
?
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.
No, there's no specific reason. I copied the format from this example: https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix
It just makes the string a little prettier
Canceling since a higher priority waiting request for 'Tests @ aSemy:feat/embedded_static_libs' exists
But in practice I never ever look at the computed value. The action gets cancelled, and a new one is triggered. So if you want a different format, then go ahead.
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.
It does indeed make the log messages look more readable 👍 For some reason I thought the group string was an internal thing only
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.
Thank you once again!
The GitHub Actions build queue can get 'stacked up' if there are a few smaller commits in quick succession. Since the actions take some time, some small commits can cause the GHA build queue to get congested. This adds a 'concurrency' check for GitHub actions. It means that if a newer trigger comes in (for example, if you make two commits in a row on a PR), then the first job will be cancelled, allowing for the new job to run. This helps save energy, and for faster feedback in PRs. Reference docs: https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
I see that in the GitHub Actions the build queue can get 'stacked up' if there are a few smaller commits in quick succession. Since the actions take some time, some small commits can cause the GHA build queue to get congested.
This PR adds a 'concurrency' check for GitHub actions. It means that if a newer trigger comes in (for example, I make two commits in a row on a PR), then the first job will be cancelled, allowing for the new job to run.
This helps save energy, and for faster feedback in PRs.
Docs: https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run