From 7fbcbb35a67d3b14f1fc9466941a8b87f8373777 Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Wed, 11 Dec 2024 07:51:46 +0100 Subject: [PATCH] ENH: GHA: cancel in progress builds for pull requests Based on InsightSoftwareConsortium/ITK#5019. --- .github/workflows/build-test-cxx-cuda.yml | 4 ++++ .github/workflows/build-test-package-python-cuda.yml | 4 ++++ .github/workflows/build-test-package.yml | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/.github/workflows/build-test-cxx-cuda.yml b/.github/workflows/build-test-cxx-cuda.yml index 61287e213..2c0fc07ef 100644 --- a/.github/workflows/build-test-cxx-cuda.yml +++ b/.github/workflows/build-test-cxx-cuda.yml @@ -6,6 +6,10 @@ env: itk-git-tag: "v5.4.0" itk-module-deps: "CudaCommon@cae7c93c2f6d4c5b3cb5f6e5ce4a97686e626bf7" +concurrency: + group: '${{ github.workflow }}@${{ github.head_ref || github.run_id }}' + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: build-test-cxx: runs-on: ${{ matrix.os }} diff --git a/.github/workflows/build-test-package-python-cuda.yml b/.github/workflows/build-test-package-python-cuda.yml index 8e8b370c2..e890255c2 100644 --- a/.github/workflows/build-test-package-python-cuda.yml +++ b/.github/workflows/build-test-package-python-cuda.yml @@ -8,6 +8,10 @@ env: itk-python-package-org: 'SimonRit' itk-module-deps: "RTKConsortium/ITKCudaCommon@cae7c93c2f6d4c5b3cb5f6e5ce4a97686e626bf7" +concurrency: + group: '${{ github.workflow }}@${{ github.head_ref || github.run_id }}' + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: build-linux-cuda-python-packages: runs-on: self-hosted-linux diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 2546d8797..fb7cc7ec0 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -2,6 +2,10 @@ name: Build, test, package on: [push,pull_request] +concurrency: + group: '${{ github.workflow }}@${{ github.head_ref || github.run_id }}' + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: cxx-build-workflow: uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@v5.4.0