Skip to content

Commit 1ea9851

Browse files
committed
ci: add concurrency groups to all pr triggered workflows
Add concurrency groups to all pr triggered workflows. ```${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}``` In case of PR trigger the above translates to: - ```'Zephyr-pull_request-refs/pull/{pr_number}/merge'``` In any other case it translates to: - ```'Zephyr-workflow_dispatch-62137'``` - ```'Zephyr-push-62138'``` This allows to group and cancel only PR runs that can clog the CI and skips the dispatched or pushed workflows. Signed-off-by: Mateusz Redzynia <mateuszx.redzynia@intel.com>
1 parent 1a0edd5 commit 1ea9851

17 files changed

Lines changed: 76 additions & 11 deletions

‎.github/workflows/build_all.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on: [pull_request, workflow_dispatch, workflow_call]
1111
permissions:
1212
contents: read
1313

14+
# Group workflows together to cancel outdated runs, do not cancel manual runs
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
17+
cancel-in-progress: true
18+
1419
jobs:
1520

1621
stub-build:

‎.github/workflows/codeql.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ on:
99
permissions:
1010
contents: read
1111

12-
# Specifies group name that stops previous workflows if the name matches
12+
# Group workflows together to cancel outdated runs
1313
concurrency:
14-
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
14+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
1515
cancel-in-progress: true
1616

1717
jobs:

‎.github/workflows/codestyle.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ on: [pull_request, workflow_call, workflow_dispatch]
1717
permissions:
1818
contents: read
1919

20+
# Group workflows together to cancel outdated runs, do not cancel manual runs
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
23+
cancel-in-progress: true
24+
2025
jobs:
2126
yamllint:
2227
runs-on: ubuntu-latest

‎.github/workflows/ipc_fuzzer.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ on:
2525
permissions:
2626
contents: read
2727

28+
# Group workflows together to cancel outdated runs, do not cancel manual runs
29+
concurrency:
30+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
31+
cancel-in-progress: true
32+
2833
jobs:
2934

3035
simple-IPC-fuzz_sh:

‎.github/workflows/llext.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ defaults:
1414
permissions:
1515
contents: read
1616

17+
# Group workflows together to cancel outdated runs
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
20+
cancel-in-progress: true
21+
1722
jobs:
1823
build:
1924
runs-on: ubuntu-24.04

‎.github/workflows/pull-request.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ on:
3434
permissions:
3535
contents: read
3636

37+
# Group workflows together to cancel outdated runs, do not cancel manual runs
38+
concurrency:
39+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
40+
cancel-in-progress: true
41+
3742
jobs:
3843

3944
doxygen:

‎.github/workflows/repro-build.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ on: [pull_request, workflow_dispatch, workflow_call]
1717
permissions:
1818
contents: read
1919

20+
# Group workflows together to cancel outdated runs, do not cancel manual runs
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
23+
cancel-in-progress: true
24+
2025
jobs:
2126
main:
2227
runs-on: ubuntu-24.04

‎.github/workflows/rimage.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ on:
2525
permissions:
2626
contents: read
2727

28+
# Group workflows together to cancel outdated runs, do not cancel manual runs
29+
concurrency:
30+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
31+
cancel-in-progress: true
32+
2833
jobs:
2934

3035
# Basic build test

‎.github/workflows/sof-docs.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ on:
2020
permissions:
2121
contents: read
2222

23+
# Group workflows together to cancel outdated runs, do not cancel manual runs
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
26+
cancel-in-progress: true
27+
2328
jobs:
2429

2530
# This is unfortunately a mix of sof-docs/.github/ + pull-request.yml#doxygen

‎.github/workflows/sparse-zephyr.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ defaults:
1414
permissions:
1515
contents: read
1616

17+
# Group workflows together to cancel outdated runs, do not cancel manual runs
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
20+
cancel-in-progress: true
21+
1722
jobs:
1823
# As of sparse commit ce1a6720f69e / Sept 2022, the exit status of
1924
# sparse.c is an unusable mess and always zero in practice. Moreover

0 commit comments

Comments
 (0)