Skip to content

Commit 3c3b3ba

Browse files
authored
Cancel the workflows in progress in newer build is about to start (#32)
1 parent 69a6d8b commit 3c3b3ba

File tree

6 files changed

+35
-0
lines changed

6 files changed

+35
-0
lines changed

templates/github/workflows/bench.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ on:
1212
description: 'New Ref'
1313
required: true
1414

15+
# Cancel the workflow in progress in newer build is about to start.
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
1520
env:
1621
GO111MODULE: "on"
1722
CACHE_BENCHMARK: "off" # Enables benchmark result reuse between runs, may skew latency results.

templates/github/workflows/cloc.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
name: cloc
33
on:
44
pull_request:
5+
6+
# Cancel the workflow in progress in newer build is about to start.
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
9+
cancel-in-progress: true
10+
511
jobs:
612
cloc:
713
runs-on: ubuntu-latest

templates/github/workflows/golangci-lint.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ on:
88
- master
99
- main
1010
pull_request:
11+
12+
# Cancel the workflow in progress in newer build is about to start.
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
1117
jobs:
1218
golangci:
1319
name: golangci-lint

templates/github/workflows/gorelease.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
name: gorelease
33
on:
44
pull_request:
5+
6+
# Cancel the workflow in progress in newer build is about to start.
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
9+
cancel-in-progress: true
10+
511
env:
612
GO_VERSION: 1.17.x
713
jobs:

templates/github/workflows/test-integration.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ on:
66
- master
77
- main
88
pull_request:
9+
10+
# Cancel the workflow in progress in newer build is about to start.
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
915
env:
1016
GO111MODULE: "on"
1117
RUN_BASE_COVERAGE: "on" # Runs test for PR base in case base test coverage is missing.

templates/github/workflows/test-unit.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ on:
66
- master
77
- main
88
pull_request:
9+
10+
# Cancel the workflow in progress in newer build is about to start.
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
915
env:
1016
GO111MODULE: "on"
1117
RUN_BASE_COVERAGE: "on" # Runs test for PR base in case base test coverage is missing.

0 commit comments

Comments
 (0)