GHA: let GitHub cancel redundant jobs

This will also cancel not yet finished master builds, but that's not too bad.
This commit is contained in:
Alexander A. Klimov 2023-01-19 10:47:14 +01:00
parent f59f361f09
commit 1d8cffe9b9
5 changed files with 20 additions and 28 deletions

View File

@ -7,6 +7,10 @@ on:
- 'support/*'
pull_request: {}
concurrency:
group: deb-${{ github.ref }}
cancel-in-progress: true
jobs:
deb:
name: .deb
@ -31,13 +35,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Cancel previous jobs for the same PR
if: "github.event_name == 'pull_request'"
uses: styfle/cancel-workflow-action@89f242ee29e10c53a841bfe71cc0ce7b2f065abc
with:
workflow_id: deb.yml,docker.yml,raspbian.yml,rpm.yml,windows.yml
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout HEAD
uses: actions/checkout@v1

View File

@ -10,18 +10,15 @@ on:
types:
- published
concurrency:
group: docker-${{ github.ref }}
cancel-in-progress: true
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Cancel previous jobs for the same PR
if: "github.event_name == 'pull_request'"
uses: styfle/cancel-workflow-action@89f242ee29e10c53a841bfe71cc0ce7b2f065abc
with:
workflow_id: deb.yml,docker.yml,raspbian.yml,rpm.yml,windows.yml
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Docker image
uses: Icinga/docker-icinga2@master
env:

View File

@ -7,6 +7,10 @@ on:
- 'support/*'
pull_request: {}
concurrency:
group: raspbian-${{ github.ref }}
cancel-in-progress: true
jobs:
raspbian:
name: Raspbian
@ -21,13 +25,6 @@ jobs:
runs-on: ubuntu-22.04 # revert back to ubuntu-latest once that is 22.04 or later
steps:
- name: Cancel previous jobs for the same PR
if: "github.event_name == 'pull_request'"
uses: styfle/cancel-workflow-action@89f242ee29e10c53a841bfe71cc0ce7b2f065abc
with:
workflow_id: deb.yml,docker.yml,raspbian.yml,rpm.yml,windows.yml
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout HEAD
uses: actions/checkout@v1

View File

@ -7,6 +7,10 @@ on:
- 'support/*'
pull_request: {}
concurrency:
group: rpm-${{ github.ref }}
cancel-in-progress: true
jobs:
rpm:
name: .rpm (${{ matrix.distro.name }}, ${{ matrix.distro.release }})
@ -52,13 +56,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Cancel previous jobs for the same PR
if: "github.event_name == 'pull_request'"
uses: styfle/cancel-workflow-action@89f242ee29e10c53a841bfe71cc0ce7b2f065abc
with:
workflow_id: deb.yml,docker.yml,raspbian.yml,rpm.yml,windows.yml
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Vars
id: vars
env:

View File

@ -7,6 +7,10 @@ on:
- 'support/*'
pull_request: {}
concurrency:
group: windows-${{ github.ref }}
cancel-in-progress: true
jobs:
windows:
name: Windows