From d9f3d265dd16a423cb7fbf501a04cb45faa3e5b3 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 23 Sep 2024 16:35:14 -0700 Subject: [PATCH] CI: cancel workflows when PRs are updated For zloop, zfs-qemu, and codeql workflows cancel in-progress jobs when the PR is updated. We always let the style checker run since it only takes a few minutes to complete. Relevant GitHub Actions documentation: The following concurrency group cancels in-progress jobs or run on pull_request events only; if github.head_ref is undefined, the concurrency group will fallback to the run ID, which is guaranteed to be both unique and defined for the run. https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value Signed-off-by: Brian Behlendorf Issue #16562 --- .github/workflows/codeql.yml | 4 ++++ .github/workflows/zfs-qemu.yml | 5 ++++- .github/workflows/zloop.yml | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f70f6bf86ea8..2656a20fea0d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -4,6 +4,10 @@ on: push: pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: analyze: name: Analyze diff --git a/.github/workflows/zfs-qemu.yml b/.github/workflows/zfs-qemu.yml index 18004c489479..67d915adfef5 100644 --- a/.github/workflows/zfs-qemu.yml +++ b/.github/workflows/zfs-qemu.yml @@ -4,8 +4,11 @@ on: push: pull_request: -jobs: +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true +jobs: qemu-vm: name: qemu-x86 strategy: diff --git a/.github/workflows/zloop.yml b/.github/workflows/zloop.yml index bf0762ff9ac3..35d8cc977af0 100644 --- a/.github/workflows/zloop.yml +++ b/.github/workflows/zloop.yml @@ -4,6 +4,10 @@ on: push: pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: zloop: runs-on: ubuntu-24.04