CI: add concurrency limits for pr test
authorChristian Marangi <ansuelsmth@gmail.com>
Wed, 11 Jan 2023 12:52:38 +0000 (13:52 +0100)
committerChristian Marangi <ansuelsmth@gmail.com>
Wed, 11 Jan 2023 13:31:57 +0000 (14:31 +0100)
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 <ansuelsmth@gmail.com>
.github/workflows/kernel.yml
.github/workflows/packages.yml
.github/workflows/toolchain.yml
.github/workflows/tools.yml

index 6cff102091e27a71f8b2e7cb7321f66d9ead87c4..bc39eb359c55b429b7a50917b8c07fd0be054a06 100644 (file)
@@ -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
index 7bcaa2b3d335664ef2b12240779241f445dcc7bc..340ee0c20446c559970c1b1703fe149412f7e003 100644 (file)
@@ -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
index d6abab4dec4372484b7010c3648ba754d3d0c9f8..2a24d82e30ff9a75fe3f3fade335e8c2cfe77b3b 100644 (file)
@@ -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
index 69ee456bce94ffc01659c8f29c809aad35d23934..19c11f03a6237cfd6cf27e901ae13e2c85cbae35 100644 (file)
@@ -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