Skip to content

Commit

Permalink
CI: cancel ongoing jobs on PR update (#1091)
Browse files Browse the repository at this point in the history
* Fix spelling

* CI: cancel ongoing jobs on PR update

This cancels the running CI jobs
when a PR gets updated, so the CI
runners aren't occupied on testing
something that is no longer relevant.

(cherry picked from commit cc4e4f6)
  • Loading branch information
pjonsson authored and SpacemanPaul committed Dec 20, 2024
1 parent afe0f83 commit 048bb05
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/complementary-config-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ env:
ORG: opendatacube
IMAGE: ows

# When a PR is updated, cancel the jobs from the previous version. Merges
# do not define head_ref, so use run_id to never cancel those jobs.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
dea-config:
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ env:
ORG: opendatacube
IMAGE: ows

# When a PR is updated, cancel the jobs from the previous version. Merges
# do not define head_ref, so use run_id to never cancel those jobs.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
docker:
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/dockerfile-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ on:
- '.github/workflows/dockerfile-lint.yml'


# When a PR is updated, cancel the jobs from the previous version. Merges
# do not define head_ref, so use run_id to never cancel those jobs.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
dockerfile-lint:
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/docpreview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ on:
permissions:
pull-requests: write

# When a PR is updated, cancel the jobs from the previous version. Merges
# do not define head_ref, so use run_id to never cancel those jobs.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:

documentation-preview:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ on:
- '!.github/**'
- '.github/workflows/lint.yml'

# When a PR is updated, cancel the jobs from the previous version. Merges
# do not define head_ref, so use run_id to never cancel those jobs.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
pylint:
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/pyspy-profiling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ on:
- '!.github/**'
- '.github/workflows/pyspy-profiling.yaml'

# When a PR is updated, cancel the jobs from the previous version. Merges
# do not define head_ref, so use run_id to never cancel those jobs.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ on:
env:
IMAGE_NAME: opendatacube/ows

# When a PR is updated, cancel the jobs from the previous version. Merges
# do not define head_ref, so use run_id to never cancel those jobs.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
cve-scanner:
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/spellcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ on:
- '*.md'
- '.github/workflows/spellcheck.yaml'

# When a PR is updated, cancel the jobs from the previous version. Merges
# do not define head_ref, so use run_id to never cancel those jobs.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:

pyspellcheck:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/test-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ env:
ORG: opendatacube
IMAGE: ows

# When a PR is updated, cancel the jobs from the previous version. Merges
# do not define head_ref, so use run_id to never cancel those jobs.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
prod-docker-compose-tests:
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ env:
ORG: opendatacube
IMAGE: ows

# When a PR is updated, cancel the jobs from the previous version. Merges
# do not define head_ref, so use run_id to never cancel those jobs.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
unit-integration-performance-tests:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 048bb05

Please sign in to comment.