From 0c52399322429d430db14061879e860471c3ab15 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Sun, 12 Mar 2023 11:56:22 +0000 Subject: [PATCH] ci: cancel preceding workflows run This patch adds concurrency groups to the CI workflows to automatically cancel any in-progress workflows when a pull request has been updated. A `concurrency` group allows to ensure that a single job or workflow will run at a time. For example, when a pull request is updated with a force-push, the GiHub CI workflows currently in-progress will be automatically cancelled, and the CI would run only with the updated commits. https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency Signed-off-by: Radostin Stoyanov --- .github/workflows/alpine-test.yml | 5 +++++ .github/workflows/archlinux-test.yml | 5 +++++ .github/workflows/codeql.yml | 5 +++++ .github/workflows/compat-test.yml | 5 +++++ .github/workflows/cross-compile.yml | 5 +++++ .github/workflows/docker-test.yml | 5 +++++ .github/workflows/fedora-asan-test.yml | 5 +++++ .github/workflows/fedora-rawhide-test.yml | 5 +++++ .github/workflows/gcov-test.yml | 5 +++++ .github/workflows/java-test.yml | 5 +++++ .github/workflows/lint.yml | 5 +++++ .github/workflows/podman-test.yml | 5 +++++ .github/workflows/stream-test.yml | 5 +++++ .github/workflows/x86-64-clang-test.yml | 5 +++++ .github/workflows/x86-64-gcc-test.yml | 5 +++++ 15 files changed, 75 insertions(+) diff --git a/.github/workflows/alpine-test.yml b/.github/workflows/alpine-test.yml index 6fc546ff5..06f466c51 100644 --- a/.github/workflows/alpine-test.yml +++ b/.github/workflows/alpine-test.yml @@ -2,6 +2,11 @@ name: Alpine Test on: [push, pull_request] +# Cancel any preceding run on the pull request. +concurrency: + group: alpine-test-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/criu-dev' }} + jobs: build: runs-on: ubuntu-20.04 diff --git a/.github/workflows/archlinux-test.yml b/.github/workflows/archlinux-test.yml index bb98623a8..328cc9d0f 100644 --- a/.github/workflows/archlinux-test.yml +++ b/.github/workflows/archlinux-test.yml @@ -2,6 +2,11 @@ name: Arch Linux Test on: [push, pull_request] +# Cancel any preceding run on the pull request. +concurrency: + group: archlinux-test-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/criu-dev' }} + jobs: build: runs-on: ubuntu-20.04 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 2d1039a0e..518d9b8ae 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -8,6 +8,11 @@ on: schedule: - cron: "11 6 * * 3" +# Cancel any preceding run on the pull request. +concurrency: + group: codeql-test-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/criu-dev' }} + jobs: analyze: name: Analyze diff --git a/.github/workflows/compat-test.yml b/.github/workflows/compat-test.yml index 5ae25fb73..79f8f0010 100644 --- a/.github/workflows/compat-test.yml +++ b/.github/workflows/compat-test.yml @@ -2,6 +2,11 @@ name: Compat Tests on: [push, pull_request] +# Cancel any preceding run on the pull request. +concurrency: + group: compat-test-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/criu-dev' }} + jobs: build: runs-on: ubuntu-20.04 diff --git a/.github/workflows/cross-compile.yml b/.github/workflows/cross-compile.yml index be8e7f09c..4da5d397c 100644 --- a/.github/workflows/cross-compile.yml +++ b/.github/workflows/cross-compile.yml @@ -2,6 +2,11 @@ name: Cross Compile Tests on: [push, pull_request] +# Cancel any preceding run on the pull request. +concurrency: + group: cross-compile-test-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/criu-dev' }} + jobs: build: diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index 564691449..fabf399fd 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -2,6 +2,11 @@ name: Docker Test on: [push, pull_request] +# Cancel any preceding run on the pull request. +concurrency: + group: docker-test-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/criu-dev' }} + jobs: build: runs-on: ${{ matrix.os }} diff --git a/.github/workflows/fedora-asan-test.yml b/.github/workflows/fedora-asan-test.yml index 44b0f16d6..8b1bfcf32 100644 --- a/.github/workflows/fedora-asan-test.yml +++ b/.github/workflows/fedora-asan-test.yml @@ -2,6 +2,11 @@ name: Fedora ASAN Test on: [push, pull_request] +# Cancel any preceding run on the pull request. +concurrency: + group: fedora-asan-test-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/criu-dev' }} + jobs: build: runs-on: ubuntu-20.04 diff --git a/.github/workflows/fedora-rawhide-test.yml b/.github/workflows/fedora-rawhide-test.yml index b6d94d23e..5355aa192 100644 --- a/.github/workflows/fedora-rawhide-test.yml +++ b/.github/workflows/fedora-rawhide-test.yml @@ -2,6 +2,11 @@ name: Fedora Rawhide Test on: [push, pull_request] +# Cancel any preceding run on the pull request. +concurrency: + group: fedora-rawhide-test-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/criu-dev' }} + jobs: build: runs-on: ubuntu-20.04 diff --git a/.github/workflows/gcov-test.yml b/.github/workflows/gcov-test.yml index f782c5b9d..fcab47837 100644 --- a/.github/workflows/gcov-test.yml +++ b/.github/workflows/gcov-test.yml @@ -2,6 +2,11 @@ name: Coverage Tests on: [push, pull_request] +# Cancel any preceding run on the pull request. +concurrency: + group: gcov-test-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/criu-dev' }} + jobs: build: runs-on: ubuntu-20.04 diff --git a/.github/workflows/java-test.yml b/.github/workflows/java-test.yml index 211953495..abed793bf 100644 --- a/.github/workflows/java-test.yml +++ b/.github/workflows/java-test.yml @@ -2,6 +2,11 @@ name: Java Test on: [push, pull_request] +# Cancel any preceding run on the pull request. +concurrency: + group: java-test-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/criu-dev' }} + jobs: build: runs-on: ubuntu-20.04 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a501af30e..e18f921f3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,6 +2,11 @@ name: Run code linter on: [push, pull_request] +# Cancel any preceding run on the pull request. +concurrency: + group: lint-test-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/criu-dev' }} + jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/podman-test.yml b/.github/workflows/podman-test.yml index 447cbf0b6..a7013a216 100644 --- a/.github/workflows/podman-test.yml +++ b/.github/workflows/podman-test.yml @@ -2,6 +2,11 @@ name: Podman Test on: [push, pull_request] +# Cancel any preceding run on the pull request. +concurrency: + group: podman-test-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/criu-dev' }} + jobs: build: runs-on: ubuntu-20.04 diff --git a/.github/workflows/stream-test.yml b/.github/workflows/stream-test.yml index ecdd81e0a..0f5b307db 100644 --- a/.github/workflows/stream-test.yml +++ b/.github/workflows/stream-test.yml @@ -2,6 +2,11 @@ name: CRIU Image Streamer Test on: [push, pull_request] +# Cancel any preceding run on the pull request. +concurrency: + group: stream-test-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/criu-dev' }} + jobs: build: runs-on: ubuntu-20.04 diff --git a/.github/workflows/x86-64-clang-test.yml b/.github/workflows/x86-64-clang-test.yml index e6e84ef52..b3b50829a 100644 --- a/.github/workflows/x86-64-clang-test.yml +++ b/.github/workflows/x86-64-clang-test.yml @@ -2,6 +2,11 @@ name: X86_64 CLANG Test on: [push, pull_request] +# Cancel any preceding run on the pull request. +concurrency: + group: clang-test-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/criu-dev' }} + jobs: build: runs-on: ubuntu-20.04 diff --git a/.github/workflows/x86-64-gcc-test.yml b/.github/workflows/x86-64-gcc-test.yml index b8b81ef15..ec70b61fb 100644 --- a/.github/workflows/x86-64-gcc-test.yml +++ b/.github/workflows/x86-64-gcc-test.yml @@ -2,6 +2,11 @@ name: X86_64 GCC Test on: [push, pull_request] +# Cancel any preceding run on the pull request. +concurrency: + group: gcc-test-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/criu-dev' }} + jobs: build: runs-on: ubuntu-20.04