Skip to content

Commit f6a3495

Browse files
committed
ci: cancel superseded runs on every workflow, keyed on branch
Seven workflows had no concurrency group at all, so successive pushes to a dev branch stacked up full matrix builds. Keying on head_ref/ref_name rather than github.ref also stops a branch with an open pull request from running two sets of jobs.
1 parent a6647ea commit f6a3495

10 files changed

Lines changed: 95 additions & 12 deletions

.github/workflows/ci-deb.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ on:
1111
schedule:
1212
- cron: '0 20 * * *'
1313

14+
#
15+
# Cancel any in-flight or queued run of this workflow on the same branch
16+
# when a new commit lands, so only the newest commit gets tested. head_ref
17+
# names the source branch on pull_request events and ref_name covers push
18+
# events, so keying on either rather than on github.ref stops a branch with
19+
# an open pull request from running two full sets of jobs.
20+
#
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
23+
cancel-in-progress: true
24+
1425
env:
1526
DEBIAN_FRONTEND: noninteractive
1627

.github/workflows/ci-freebsd.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ on:
99
- debug-fuzzer-**
1010
pull_request:
1111

12+
#
13+
# Cancel any in-flight or queued run of this workflow on the same branch
14+
# when a new commit lands, so only the newest commit gets tested. head_ref
15+
# names the source branch on pull_request events and ref_name covers push
16+
# events, so keying on either rather than on github.ref stops a branch with
17+
# an open pull request from running two full sets of jobs.
18+
#
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
21+
cancel-in-progress: true
22+
1223
env:
1324
HOSTAPD_BUILD_DIR: eapol_test.ci
1425
HOSTAPD_GIT_TAG: hostap_2_11

.github/workflows/ci-macos.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ on:
1010
pull_request:
1111

1212
#
13-
# Cancel any in-flight or queued run of this workflow on the same
14-
# ref when a new commit lands. Replaces fkirc/skip-duplicate-actions
15-
# for the "don't waste CI on a stale push" use case.
13+
# Cancel any in-flight or queued run of this workflow on the same branch
14+
# when a new commit lands, so only the newest commit gets tested. head_ref
15+
# names the source branch on pull_request events and ref_name covers push
16+
# events, so keying on either rather than on github.ref stops a branch with
17+
# an open pull request from running two full sets of jobs.
1618
#
1719
concurrency:
18-
group: ${{ github.workflow }}-${{ github.ref }}
20+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
1921
cancel-in-progress: true
2022

2123
env:

.github/workflows/ci-multi-server-tests.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ on:
3131
# Daily at 2pm EST (7pm UTC) - full test set, not just CI subset.
3232
- cron: '0 19 * * *'
3333

34+
#
35+
# Cancel any in-flight or queued run of this workflow on the same branch
36+
# when a new commit lands, so only the newest commit gets tested. head_ref
37+
# names the source branch on pull_request events and ref_name covers push
38+
# events, so keying on either rather than on github.ref stops a branch with
39+
# an open pull request from running two full sets of jobs.
40+
#
41+
concurrency:
42+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
43+
cancel-in-progress: true
44+
3445
jobs:
3546
multi-server-tests:
3647
runs-on: self-hosted

.github/workflows/ci-rpm.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ on:
1111
schedule:
1212
- cron: '0 20 * * *'
1313

14+
#
15+
# Cancel any in-flight or queued run of this workflow on the same branch
16+
# when a new commit lands, so only the newest commit gets tested. head_ref
17+
# names the source branch on pull_request events and ref_name covers push
18+
# events, so keying on either rather than on github.ref stops a branch with
19+
# an open pull request from running two full sets of jobs.
20+
#
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
23+
cancel-in-progress: true
24+
1425
jobs:
1526

1627
#

.github/workflows/ci-sanitizers.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ on:
1010
pull_request:
1111

1212
#
13-
# Cancel any in-flight or queued run of this workflow on the same
14-
# ref when a new commit lands. Replaces fkirc/skip-duplicate-actions
15-
# for the "don't waste CI on a stale push" use case.
13+
# Cancel any in-flight or queued run of this workflow on the same branch
14+
# when a new commit lands, so only the newest commit gets tested. head_ref
15+
# names the source branch on pull_request events and ref_name covers push
16+
# events, so keying on either rather than on github.ref stops a branch with
17+
# an open pull request from running two full sets of jobs.
1618
#
1719
concurrency:
18-
group: ${{ github.workflow }}-${{ github.ref }}
20+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
1921
cancel-in-progress: true
2022

2123
env:

.github/workflows/ci.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ on:
1010
pull_request:
1111

1212
#
13-
# Cancel any in-flight or queued run of this workflow on the same
14-
# ref when a new commit lands. Replaces fkirc/skip-duplicate-actions
15-
# for the "don't waste CI on a stale push" use case.
13+
# Cancel any in-flight or queued run of this workflow on the same branch
14+
# when a new commit lands, so only the newest commit gets tested. head_ref
15+
# names the source branch on pull_request events and ref_name covers push
16+
# events, so keying on either rather than on github.ref stops a branch with
17+
# an open pull request from running two full sets of jobs.
1618
#
1719
concurrency:
18-
group: ${{ github.workflow }}-${{ github.ref }}
20+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
1921
cancel-in-progress: true
2022

2123
env:

.github/workflows/docker-crossbuild.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ on:
66
- coverity_scan
77
workflow_dispatch:
88

9+
#
10+
# Cancel any in-flight or queued run of this workflow on the same branch
11+
# when a new commit lands, so only the newest commit gets tested. head_ref
12+
# names the source branch on pull_request events and ref_name covers push
13+
# events, so keying on either rather than on github.ref stops a branch with
14+
# an open pull request from running two full sets of jobs.
15+
#
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
18+
cancel-in-progress: true
19+
920
env:
1021
CI: 1
1122
GH_ACTIONS: 1

.github/workflows/docker-service.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ on:
66
- coverity_scan
77
workflow_dispatch:
88

9+
#
10+
# Cancel any in-flight or queued run of this workflow on the same branch
11+
# when a new commit lands, so only the newest commit gets tested. head_ref
12+
# names the source branch on pull_request events and ref_name covers push
13+
# events, so keying on either rather than on github.ref stops a branch with
14+
# an open pull request from running two full sets of jobs.
15+
#
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
18+
cancel-in-progress: true
19+
920
env:
1021
CI: 1
1122
GH_ACTIONS: 1

.github/workflows/documentation.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ on:
2323
schedule:
2424
- cron: '1 20 * * *'
2525

26+
#
27+
# Cancel any in-flight or queued run of this workflow on the same branch
28+
# when a new commit lands, so only the newest commit gets tested. head_ref
29+
# names the source branch on pull_request events and ref_name covers push
30+
# events, so keying on either rather than on github.ref stops a branch with
31+
# an open pull request from running two full sets of jobs.
32+
#
33+
concurrency:
34+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
35+
cancel-in-progress: true
36+
2637
jobs:
2738
build-docs:
2839
if: github.repository_owner == 'FreeRADIUS'

0 commit comments

Comments
 (0)