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

chore(ci): adding concurrency option to pr-check #8997

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

axel7083
Copy link
Contributor

What does this PR do?

Adding the concurrency option to pr-check, making Github cancel previous github actions for a given branch if new one are started (E.g. new commits, rebase etc.)

Screenshot / video of UI

N/A

What issues does this PR fix or reference?

Fixes #8811

How to test this PR?

  • Tests are covering the bug fix or the new feature

Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
@axel7083 axel7083 requested review from benoitf and a team as code owners September 20, 2024 12:10
@axel7083 axel7083 requested review from cdrage, deboer-tim and lstocchi and removed request for a team September 20, 2024 12:10
@@ -411,7 +415,7 @@ jobs:
always()
steps:
- name: Evaluate the Windows Update test results
run: |
run: |
echo "Windows updater result: ${{ needs.run-update-e2e-test.result }}"
if [ "${{ needs.run-update-e2e-test.result }}" = "failure" ]; then
echo "Windows udpater test failed..."
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the linter did the changes

pull_request:
types: [labeled, synchronize, opened, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like sometimes the pattern is

${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did you find this ? Because I was reading opencv/ci-gha-workflow#78 and it does not seems to work.

The github documentation recommend ${{ github.workflow }}-${{ github.ref }}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, you can use the concurrency keyword immediately after where trigger conditions are defined to limit the concurrency of entire workflow runs for a specific branch ref https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-using-concurrency-and-the-default-behavior

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be the difference compare to the value given in the github documentation ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can change the branch of the PR I guess ?

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.

Using the concurrency option in github workflows
2 participants