Skip to content

Commit bc8365d

Browse files
committed
feat: add concurrency control to cancel running workflows on new push
- Cancel in-progress workflows when pushing to the same branch - Keep PR workflows running (only cancel for push events) - Applies to all workflows: CI, GeniusBridge, SlowCI, JupyterNotebooks, PyPI, Documentation - Grouping by workflow name and ref/PR number ensures proper isolation
1 parent 2f30026 commit bc8365d

File tree

6 files changed

+18
-0
lines changed

6 files changed

+18
-0
lines changed

.github/workflows/SlowCI.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
branches: ["*"]
55
pull_request:
66
branches: ["*"]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref }}
9+
cancel-in-progress: ${{ github.event_name == 'push' }}
710
jobs:
811
tests:
912
name: "Python ${{ matrix.python-version }}"

.github/workflows/doc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
branches: ["main"]
55
pull_request:
66
branches: ["main"]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref }}
9+
cancel-in-progress: ${{ github.event_name == 'push' }}
710
jobs:
811
docs:
912
name: "Build Documentation"

.github/workflows/pypi.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: PyPI
22
on: push
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
36
jobs:
47
build-n-publish:
58
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
branches: ["*"]
55
pull_request:
66
branches: ["*"]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref }}
9+
cancel-in-progress: ${{ github.event_name == 'push' }}
710
jobs:
811
tests:
912
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}"

.github/workflows/test_jupyter_notebooks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
branches: ["*"]
55
pull_request:
66
branches: ["*"]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref }}
9+
cancel-in-progress: ${{ github.event_name == 'push' }}
710
jobs:
811
tests:
912
name: "Python ${{ matrix.python-version }}"

.github/workflows/test_with_java.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
branches: ["*"]
55
pull_request:
66
branches: ["*"]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref }}
9+
cancel-in-progress: ${{ github.event_name == 'push' }}
710
jobs:
811
tests:
912
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}"

0 commit comments

Comments
 (0)