diff --git a/.github/workflows/create-lint-wf.yml b/.github/workflows/create-lint-wf.yml index d8f65906e4..277baf1425 100644 --- a/.github/workflows/create-lint-wf.yml +++ b/.github/workflows/create-lint-wf.yml @@ -1,6 +1,11 @@ name: Create a pipeline and run nf-core linting on: [push, pull_request] +# Cancel if a newer run is started +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + env: NXF_ANSI_LOG: false diff --git a/.github/workflows/create-test-wf.yml b/.github/workflows/create-test-wf.yml index 1f24b299e0..6b2116d2f4 100644 --- a/.github/workflows/create-test-wf.yml +++ b/.github/workflows/create-test-wf.yml @@ -1,6 +1,11 @@ name: Create a pipeline and test it on: [push, pull_request] +# Cancel if a newer run is started +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + env: NXF_ANSI_LOG: false diff --git a/.github/workflows/deploy-pypi.yml b/.github/workflows/deploy-pypi.yml index 6f52c0f50f..391a8ef94f 100644 --- a/.github/workflows/deploy-pypi.yml +++ b/.github/workflows/deploy-pypi.yml @@ -3,6 +3,11 @@ on: release: types: [published] +# Cancel if a newer run is started +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: build-n-publish: runs-on: ubuntu-latest diff --git a/.github/workflows/lint-code.yml b/.github/workflows/lint-code.yml index 52e042b5bc..af2d41aecf 100644 --- a/.github/workflows/lint-code.yml +++ b/.github/workflows/lint-code.yml @@ -1,6 +1,11 @@ name: Lint tools code formatting on: [push, pull_request] +# Cancel if a newer run is started +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: EditorConfig: runs-on: ubuntu-latest diff --git a/.github/workflows/push_dockerhub_dev.yml b/.github/workflows/push_dockerhub_dev.yml index 5ba3e7fd8f..88efe88b9d 100644 --- a/.github/workflows/push_dockerhub_dev.yml +++ b/.github/workflows/push_dockerhub_dev.yml @@ -5,6 +5,11 @@ on: push: branches: [dev] +# Cancel if a newer run is started +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: push_dockerhub: name: Push new Docker image to Docker Hub (dev) diff --git a/.github/workflows/push_dockerhub_release.yml b/.github/workflows/push_dockerhub_release.yml index c2dcf4b146..71245244d8 100644 --- a/.github/workflows/push_dockerhub_release.yml +++ b/.github/workflows/push_dockerhub_release.yml @@ -5,6 +5,11 @@ on: release: types: [published] +# Cancel if a newer run is started +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: push_dockerhub: name: Push new Docker image to Docker Hub (release) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 08b99c4c70..0828d93315 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -5,6 +5,11 @@ on: push: pull_request: +# Cancel if a newer run is started +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: pytest: runs-on: ubuntu-latest diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index dd2ed7f374..2d79807a0b 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -9,6 +9,11 @@ on: description: Only run on nf-core/testpipeline? required: true +# Cancel if a newer run is started +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: get-pipelines: runs-on: ubuntu-latest diff --git a/.github/workflows/tools-api-docs-dev.yml b/.github/workflows/tools-api-docs-dev.yml index b9c40787f8..f2ccabb02d 100644 --- a/.github/workflows/tools-api-docs-dev.yml +++ b/.github/workflows/tools-api-docs-dev.yml @@ -2,6 +2,11 @@ name: nf-core/tools dev API docs # Run on push and PR to test that docs build on: [pull_request, push] +# Cancel if a newer run is started +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: api-docs: name: Build & push Sphinx API docs diff --git a/.github/workflows/tools-api-docs-release.yml b/.github/workflows/tools-api-docs-release.yml index a10f7b9b87..17e504067e 100644 --- a/.github/workflows/tools-api-docs-release.yml +++ b/.github/workflows/tools-api-docs-release.yml @@ -3,6 +3,11 @@ on: release: types: [published] +# Cancel if a newer run is started +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: api-docs: name: Build & push Sphinx API docs diff --git a/CHANGELOG.md b/CHANGELOG.md index 091eb15b87..4611163c53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ - Move `strip_ansi_code` function in lint to `utils.py` - Simplify control flow and don't use equality comparison for `None` and booleans - Replace use of the deprecated `distutils` Version object with that from `packaging` ([#1735](https://github.com/nf-core/tools/pull/1735)) +- Add code to cancel CI run if a new run starts ([#1760](https://github.com/nf-core/tools/pull/1760)) ### Modules