From 2841066dd46226b3f42a2b91d270e17b6b63d831 Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Sun, 19 Mar 2023 13:40:03 +0800 Subject: [PATCH] Cancel in-progress GitHub Workflow jobs when there are updates Some jobs can take a while and leaving old jobs running is wasteful. This is especially important for the documentation building jobs, which can take a long time to complete. --- .github/workflows/build-docs.yml | 5 +++++ .github/workflows/build-wheels.yml | 4 ++++ .github/workflows/linters.yml | 4 ++++ .github/workflows/tests.yml | 4 ++++ 4 files changed, 17 insertions(+) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index f13a773d2e..aa473ca4a8 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -8,6 +8,11 @@ # name: Rebuild documentation on: workflow_dispatch + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }} + cancel-in-progress: true + jobs: docs: name: Rebuild documentation diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 3b0d1f603e..956101c534 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -8,6 +8,10 @@ on: schedule: - cron: '0 0 * * sun,wed' +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }} + cancel-in-progress: true + jobs: linters: diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 05693fd252..31e585286a 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -3,6 +3,10 @@ name: Linters on: workflow_call: +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }} + cancel-in-progress: true + jobs: linters: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b176c910a8..14846379c5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,6 +5,10 @@ on: pull_request: branches: [ develop ] +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }} + cancel-in-progress: true + jobs: linters: