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

infrastructure: add concurrency cancellation for test/build GitHub Actions #2710

Merged
merged 3 commits into from Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/check.yml
Expand Up @@ -2,6 +2,10 @@ name: Check

on: pull_request

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
Copy link
Member

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 @?

Copy link
Contributor Author

@aSemy aSemy Jan 30, 2023

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

For example:

Canceling since a higher priority waiting request for 'Tests @ aSemy:feat/embedded_static_libs' exists

image

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.

Copy link
Member

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

cancel-in-progress: true

jobs:
validate-wrapper:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/dokka-examples.yml
Expand Up @@ -2,6 +2,10 @@ name: Build examples

on: pull_request

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
build:
strategy:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/gradle-test.pr.yml
Expand Up @@ -2,6 +2,10 @@ name: Test

on: pull_request

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
test-ubuntu:
strategy:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/qodana.yml
Expand Up @@ -7,6 +7,10 @@ on:
branches:
- master

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
inspection:
runs-on: ubuntu-latest
Expand Down