Cancel running CI jobs when new changes are pushed to a PR

The `group` expression ensures that the cancel-in-progress
behavior is to only cancel if a new commit is pushed to the PR for
which the job is running, not other PRs.

This is a fairly standard snippet, used also in CI jobs for NumPy
and other projects.
This commit is contained in:
Ralf Gommers 2023-11-10 16:05:52 +01:00
parent 1d4ed20c2f
commit 2418a20f1f
6 changed files with 24 additions and 0 deletions

View File

@ -2,6 +2,10 @@ name: arm64 graviton cirun
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)

View File

@ -2,6 +2,10 @@ name: c910v qemu test
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)

View File

@ -2,6 +2,10 @@ name: continuous build
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)

View File

@ -2,6 +2,10 @@ name: loongarch64 qemu test
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
TEST:
if: "github.repository == 'OpenMathLib/OpenBLAS'"

View File

@ -2,6 +2,10 @@ name: mips64 qemu test
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)

View File

@ -18,6 +18,10 @@ on:
name: Nightly-Homebrew-Build
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)