From 8505c48a34436b11e7cf3230fb281bef53f662eb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 21 Feb 2023 14:58:57 +0100 Subject: [PATCH] Cancel in progress builds of PRs when a new one starts Add a snippet based on the example in https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow to all CI workflows to cancel the currently running build when a new one starts. This should ensure that we don't keep building the old version of the PR after a new one has been pushed. --- .github/workflows/ci.yml | 4 ++++ .github/workflows/ci_cmake.yml | 4 ++++ .github/workflows/ci_mac.yml | 4 ++++ .github/workflows/ci_mac_xcode.yml | 4 ++++ .github/workflows/ci_msw.yml | 4 ++++ .github/workflows/ci_msw_cross.yml | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9baf826ed4..2ca3b7ca04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,6 +56,10 @@ on: required: false default: false +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + permissions: contents: read diff --git a/.github/workflows/ci_cmake.yml b/.github/workflows/ci_cmake.yml index 0239e2c1e3..99ee30b7a0 100644 --- a/.github/workflows/ci_cmake.yml +++ b/.github/workflows/ci_cmake.yml @@ -45,6 +45,10 @@ on: - '*.yml' - 'wxwidgets.props' +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + permissions: contents: read diff --git a/.github/workflows/ci_mac.yml b/.github/workflows/ci_mac.yml index 53ac3fa002..455dcca932 100644 --- a/.github/workflows/ci_mac.yml +++ b/.github/workflows/ci_mac.yml @@ -59,6 +59,10 @@ on: - 'CMakeLists.txt' - 'wxwidgets.props' +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + permissions: contents: read diff --git a/.github/workflows/ci_mac_xcode.yml b/.github/workflows/ci_mac_xcode.yml index 3315053d4a..594f6d4896 100644 --- a/.github/workflows/ci_mac_xcode.yml +++ b/.github/workflows/ci_mac_xcode.yml @@ -59,6 +59,10 @@ on: - 'CMakeLists.txt' - 'wxwidgets.props' +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + permissions: contents: read diff --git a/.github/workflows/ci_msw.yml b/.github/workflows/ci_msw.yml index dc449add8c..541d9a5ed2 100644 --- a/.github/workflows/ci_msw.yml +++ b/.github/workflows/ci_msw.yml @@ -49,6 +49,10 @@ on: - '*.yml' - 'CMakeLists.txt' +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + permissions: contents: read diff --git a/.github/workflows/ci_msw_cross.yml b/.github/workflows/ci_msw_cross.yml index 098c152930..03cdf88cc9 100644 --- a/.github/workflows/ci_msw_cross.yml +++ b/.github/workflows/ci_msw_cross.yml @@ -53,6 +53,10 @@ on: - 'wxwidgets.props' - 'CMakeLists.txt' +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + permissions: contents: read