ci: cancel previous jobs on ref update

Let's save the environment (and reduce the number of jobs in GH Actions
queues) by cancelling old jobs on a ref update (force push).

See: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency
This commit is contained in:
Frantisek Sumsal
2021-11-10 16:45:12 +01:00
parent 46573ee131
commit 3884837610
5 changed files with 15 additions and 0 deletions

View File

@@ -15,6 +15,9 @@ on:
jobs:
build:
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ matrix.env.COMPILER }}-${{ matrix.env.COMPILER_VERSION }}-${{ github.ref }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:

View File

@@ -20,6 +20,9 @@ jobs:
Fuzzing:
runs-on: ubuntu-latest
if: github.repository == 'systemd/systemd'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:

View File

@@ -13,6 +13,9 @@ jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Repo checkout

View File

@@ -15,6 +15,9 @@ on:
jobs:
ci:
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ matrix.distro }}-${{ github.ref }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:

View File

@@ -11,6 +11,9 @@ on:
jobs:
build:
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ matrix.run_phase }}-${{ github.ref }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix: