Skip to content

Commit

Permalink
Use concurrency to cancel previous runs (#2589)
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Jun 29, 2023
1 parent f3cad34 commit 4452b5c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 30 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/ci_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ on:
types:
- published

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
docs:
name: ${{ matrix.os }}
Expand All @@ -52,12 +56,6 @@ jobs:
shell: bash -l {0}

steps:
# Cancel previous runs that are not completed
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

# Checkout current git repository
- name: Checkout
uses: actions/checkout@v3.5.3
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/ci_doctests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
schedule:
- cron: '0 0 * * 0'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
test:
name: ${{ matrix.os }}
Expand All @@ -27,12 +31,6 @@ jobs:
shell: bash -l {0}

steps:
# Cancel previous runs that are not completed
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

# Checkout current git repository
- name: Checkout
uses: actions/checkout@v3.5.3
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/ci_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ on:
schedule:
- cron: '0 0 * * *'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
test:
name: ${{ matrix.os }} - Python ${{ matrix.python-version }} / NumPy ${{ matrix.numpy-version }}
Expand Down Expand Up @@ -81,12 +85,6 @@ jobs:
NUMPY: ${{ matrix.numpy-version }}

steps:
# Cancel previous runs that are not completed
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

# Checkout current git repository
- name: Checkout
uses: actions/checkout@v3.5.3
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/ci_tests_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ on:
schedule:
- cron: '0 0 * * 1,3,5'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
test_gmt_dev:
name: ${{ matrix.os }} - GMT ${{ matrix.gmt_git_ref }}
Expand All @@ -46,12 +50,6 @@ jobs:
shell: bash -l {0}

steps:
# Cancel previous runs that are not completed
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

# Checkout current git repository
- name: Checkout
uses: actions/checkout@v3.5.3
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/ci_tests_legacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ on:
schedule:
- cron: '0 0 * * 2'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
test:
name: ${{ matrix.os }} - GMT ${{ matrix.gmt_version }}
Expand All @@ -39,12 +43,6 @@ jobs:
shell: bash -l {0}

steps:
# Cancel previous runs that are not completed
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

# Checkout current git repository
- name: Checkout
uses: actions/checkout@v3.5.3
Expand Down

0 comments on commit 4452b5c

Please sign in to comment.