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 <rstoyanov@fedoraproject.org>
This commit is contained in:
Radostin Stoyanov 2023-03-12 11:56:22 +00:00 committed by Andrei Vagin
parent 5c8cdceec2
commit 0c52399322
15 changed files with 75 additions and 0 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -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 }}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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