Skip to content

Commit

Permalink
CI: no cancelling of jobs on main (#2893)
Browse files Browse the repository at this point in the history
Avoids cancelling of "pending jobs" on main. Previous solution only avoids
cancelling on "jobs in progress".
  • Loading branch information
nilason committed Mar 17, 2023
1 parent 5ccff03 commit 22c800d
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/additional_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ on:
- releasebranch_*

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
additional-checks:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:
- releasebranch_*

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
run-black:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/centos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:
- releasebranch_*

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
- main
- releasebranch_*
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
formatting-check:
name: Formatting Check
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:
- releasebranch_*

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
flake8:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ jobs:
name: ${{ matrix.c }} & ${{ matrix.cpp }}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}-${{ matrix.c }}-${{ matrix.cpp }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}-${{
matrix.c }}-${{ matrix.cpp }}
cancel-in-progress: true

runs-on: ubuntu-22.04
strategy:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ on:
env:
CACHE_NUMBER: 0
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
macos_build:
name: macOS build
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/osgeo4w.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ jobs:
name: ${{ matrix.os }} build and tests

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}-${{ matrix.os }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}-${{
matrix.os }}
cancel-in-progress: true

runs-on: ${{ matrix.os }}
strategy:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ jobs:
name: Pylint ${{ matrix.pylint-version }}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}-${{ matrix.pylint-version }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}-${{
matrix.pylint-version }}
cancel-in-progress: true

# Using matrix just to get variables which are not environmental variables
# and also to sync with other workflows which use matrix.
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ on:
jobs:
pytest:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}-${{ matrix.os }}-${{ matrix.python-version }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}-${{
matrix.os }}-${{ matrix.python-version }}
cancel-in-progress: true

strategy:
matrix:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:
- releasebranch_*

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
super-linter:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ jobs:
name: ${{ matrix.name }} tests

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}-${{ matrix.name }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}-${{
matrix.name }}
cancel-in-progress: true

runs-on: ${{ matrix.os }}
strategy:
Expand Down

0 comments on commit 22c800d

Please sign in to comment.