Skip to content

Commit bc51619

Browse files
authored
[CI] Cancel GH Action job if a newer commit is published (dmlc#10088)
1 parent 23a37dc commit bc51619

File tree

7 files changed

+28
-0
lines changed

7 files changed

+28
-0
lines changed

.github/workflows/i386.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on: [push, pull_request]
55
permissions:
66
contents: read # to fetch code (actions/checkout)
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
812
jobs:
913
build-32bit:
1014
name: Build 32-bit

.github/workflows/jvm_tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on: [push, pull_request]
55
permissions:
66
contents: read # to fetch code (actions/checkout)
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
812
jobs:
913
test-with-jvm:
1014
name: Test JVM on OS ${{ matrix.os }}

.github/workflows/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on: [push, pull_request]
99
permissions:
1010
contents: read # to fetch code (actions/checkout)
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
14+
cancel-in-progress: true
15+
1216
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1317
jobs:
1418
gtest-cpu:

.github/workflows/python_tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ defaults:
99
run:
1010
shell: bash -l {0}
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
14+
cancel-in-progress: true
15+
1216
jobs:
1317
python-mypy-lint:
1418
runs-on: ubuntu-latest

.github/workflows/python_wheels.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on: [push, pull_request]
55
permissions:
66
contents: read # to fetch code (actions/checkout)
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
812
jobs:
913
python-wheels:
1014
name: Build wheel for ${{ matrix.platform_id }}

.github/workflows/r_nold.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
permissions:
1111
contents: read # to fetch code (actions/checkout)
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
test-R-noLD:
1519
if: github.event.comment.body == '/gha run r-nold-test' && contains('OWNER,MEMBER,COLLABORATOR', github.event.comment.author_association)

.github/workflows/r_tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ env:
88
permissions:
99
contents: read # to fetch code (actions/checkout)
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
1115
jobs:
1216
lintr:
1317
runs-on: ${{ matrix.config.os }}

0 commit comments

Comments
 (0)