From 7eb8aff09200135fc6f11871b1ad54d2c3a8cbc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Tue, 24 Oct 2023 16:32:41 +0200 Subject: [PATCH] Cancel in progress CI jobs for PRs --- .github/workflows/docs.yml | 7 +++++++ .github/workflows/test.yml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e3789a7f..cfcc32b3 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,6 +8,13 @@ on: pull_request: workflow_dispatch: +concurrency: + # group by workflow and ref; the last slightly strange component ensures that for pull + # requests, we limit to 1 concurrent job, but for the master branch we don't + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }} + # Cancel intermediate builds, but only if it is a pull request build. + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + jobs: Documenter: runs-on: ubuntu-latest diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8b8c2a96..b8e64378 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,13 @@ on: pull_request: workflow_dispatch: +concurrency: + # group by workflow and ref; the last slightly strange component ensures that for pull + # requests, we limit to 1 concurrent job, but for the master branch we don't + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }} + # Cancel intermediate builds, but only if it is a pull request build. + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + jobs: test: runs-on: ${{ matrix.os }}