18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-19 22:44:59 +01:00

Merge pull request #324 from MaSzyna-EU07/fix/ci-cancel-superseded-builds

CI: cancel the builds of a commit superseded by a newer push
This commit is contained in:
maj00r
2026-11-11 14:20:48 +01:00
committed by GitHub
2 changed files with 20 additions and 0 deletions

View File

@@ -14,6 +14,14 @@ on:
permissions: {}
# A newer push to a pull request makes the run for its older commit pointless, so that run is
# cancelled (sonar.yml then marks the analysis of the older commit as skipped). A push to master
# gets a group of its own, its commit, so the runs on master are neither cancelled nor held back
# by one another.
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.sha }}
cancel-in-progress: true
jobs:
build:
name: Build under Build Wrapper

View File

@@ -27,9 +27,17 @@ jobs:
# Windows / MSVC
# ============================================================
# A newer push to the same branch or pull request cancels the build of the older commit. The
# groups are set on the build jobs rather than on the workflow, so a publish job that is already
# running is left to finish; with a build cancelled the publish job of that run is skipped. A push
# to master gets a group of its own, its commit, so the builds of master are never cancelled.
windows:
name: Windows x64 / MSVC
runs-on: windows-2022
concurrency:
group: ${{ github.workflow }}-windows-${{ github.event_name }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}
cancel-in-progress: true
steps:
- name: Checkout repository
@@ -183,6 +191,10 @@ jobs:
linux:
name: Linux x64 / GCC
runs-on: ubuntu-24.04
# see the note above the windows job
concurrency:
group: ${{ github.workflow }}-linux-${{ github.event_name }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}
cancel-in-progress: true
steps:
- name: Checkout repository