Skip to content

Commit aa708e0

Browse files
authored
Cancel running / queue jobs when a new change was pushed to branch (#103)
Motivation: We should cancel any running / queued job when a new change was pushed to the affected branch. This will ensure we not tie up resources. Modifications: Add new concurrency config to workflows Result: Cancel jobs that are not useful anymore
1 parent 0c62405 commit aa708e0

7 files changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/ci-build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ on:
2828
env:
2929
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240
3030

31+
# Cancel running jobs when a new push happens to the same branch as otherwise it will
32+
# tie up too many resources without providing much value.
33+
concurrency:
34+
group: ${{ github.workflow }}-${{ github.ref }}
35+
cancel-in-progress: true
36+
3137
jobs:
3238
build-linux-x86_64:
3339
runs-on: ubuntu-latest

.github/workflows/ci-deploy.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ on:
2828
env:
2929
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240
3030

31+
# Cancel running jobs when a new push happens to the same branch as otherwise it will
32+
# tie up too many resources without providing much value.
33+
concurrency:
34+
group: ${{ github.workflow }}-${{ github.ref }}
35+
cancel-in-progress: true
36+
3137
jobs:
3238
stage-snapshot-linux:
3339
runs-on: ubuntu-latest

.github/workflows/ci-pr-reports.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ env:
2626
permissions:
2727
contents: read
2828

29+
# Cancel running jobs when a new push happens to the same branch as otherwise it will
30+
# tie up too many resources without providing much value.
31+
concurrency:
32+
group: ${{ github.workflow }}-${{ github.ref }}
33+
cancel-in-progress: true
34+
2935
jobs:
3036
tests:
3137
permissions:

.github/workflows/ci-pr.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ on:
2525
env:
2626
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240
2727

28+
# Cancel running jobs when a new push happens to the same branch as otherwise it will
29+
# tie up too many resources without providing much value.
30+
concurrency:
31+
group: ${{ github.workflow }}-${{ github.ref }}
32+
cancel-in-progress: true
33+
2834
jobs:
2935
build-pr:
3036
strategy:

.github/workflows/ci-release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ on:
2222
env:
2323
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240
2424

25+
# Cancel running jobs when a new push happens to the same branch as otherwise it will
26+
# tie up too many resources without providing much value.
27+
concurrency:
28+
group: ${{ github.workflow }}-${{ github.ref }}
29+
cancel-in-progress: true
30+
2531
jobs:
2632
prepare-release:
2733
runs-on: ubuntu-latest

.github/workflows/ci-verify-load.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ on:
2828
env:
2929
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240
3030

31+
# Cancel running jobs when a new push happens to the same branch as otherwise it will
32+
# tie up too many resources without providing much value.
33+
concurrency:
34+
group: ${{ github.workflow }}-${{ github.ref }}
35+
cancel-in-progress: true
36+
3137
jobs:
3238
install-jars-linux-aarch64:
3339
runs-on: ubuntu-latest

.github/workflows/codeql-analysis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ on:
2727
env:
2828
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240
2929

30+
# Cancel running jobs when a new push happens to the same branch as otherwise it will
31+
# tie up too many resources without providing much value.
32+
concurrency:
33+
group: ${{ github.workflow }}-${{ github.ref }}
34+
cancel-in-progress: true
35+
3036
jobs:
3137
analyze:
3238
name: Analyze

0 commit comments

Comments
 (0)