From 154e04b41ee811a302faf2bef86e86e3ce856888 Mon Sep 17 00:00:00 2001 From: Gereon Kremer Date: Wed, 16 Mar 2022 21:54:12 +0100 Subject: [PATCH] Use native cancellation mechanism (#8311) Github actions have a native mechanism to cancel previous runs of the same workflow now, much like the cancel workflow we have. --- .github/workflows/cancel.yml | 15 --------------- .github/workflows/ci.yml | 5 +++++ 2 files changed, 5 insertions(+), 15 deletions(-) delete mode 100644 .github/workflows/cancel.yml diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index 9691fe2a4..000000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,15 +0,0 @@ - -name: Cancel -on: - workflow_run: - workflows: ["CI"] - types: - - requested - -jobs: - cancel: - runs-on: ubuntu-latest - steps: - - uses: styfle/cancel-workflow-action@0.9.1 - with: - workflow_id: ${{ github.event.workflow.id }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 543641042..f4a8b7242 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,6 +54,11 @@ jobs: name: ${{ matrix.name }} runs-on: ${{ matrix.os }} + # cancel already running jobs for the same branch/pr/tag + concurrency: + group: build-${{ github.ref }}-${{ matrix.name }} + cancel-in-progress: true + steps: - uses: actions/checkout@v2 -- 2.30.2