From cb679adf184d30261368707cd2b4f6cc7cf2a686 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Wed, 11 Jan 2023 13:52:38 +0100 Subject: [PATCH] CI: add concurrency limits for pr test Add concurrency limits for pull request test so that on pull request refresh old jobs are cancelled. The group is created based on the github ref + workflow name and the workflow is cancelled only it it comes from a pull_request event. Push events are not affected by this limit. Signed-off-by: Christian Marangi --- .github/workflows/kernel.yml | 4 ++++ .github/workflows/packages.yml | 4 ++++ .github/workflows/toolchain.yml | 4 ++++ .github/workflows/tools.yml | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 6cff102091..bc39eb359c 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -21,6 +21,10 @@ on: permissions: contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: determine_targets: name: Set targets diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 7bcaa2b3d3..340ee0c204 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -23,6 +23,10 @@ on: permissions: contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: build: name: Build Packages with external toolchain diff --git a/.github/workflows/toolchain.yml b/.github/workflows/toolchain.yml index d6abab4dec..2a24d82e30 100644 --- a/.github/workflows/toolchain.yml +++ b/.github/workflows/toolchain.yml @@ -15,6 +15,10 @@ on: permissions: contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: determine_targets: name: Set targets diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 69ee456bce..19c11f03a6 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -15,6 +15,10 @@ on: permissions: contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: build-macos-latest: name: Build tools with macos latest -- 2.30.2