From a6c667b99fbeb9f408cadf460f988e6faef9eb69 Mon Sep 17 00:00:00 2001 From: mc2eqe <77665447+mc2eqe@users.noreply.github.com> Date: Fri, 22 Sep 2023 16:08:54 +0200 Subject: [PATCH] Added concurrency for cancel previous runs --- .github/workflows/base_checks.yaml | 14 ++++---------- .github/workflows/coverage.yaml | 14 ++++---------- .github/workflows/static-analysis.yml | 14 ++++---------- .github/workflows/tests.yaml | 14 ++++---------- 4 files changed, 16 insertions(+), 40 deletions(-) diff --git a/.github/workflows/base_checks.yaml b/.github/workflows/base_checks.yaml index 2e7283dc8..89c36530d 100644 --- a/.github/workflows/base_checks.yaml +++ b/.github/workflows/base_checks.yaml @@ -6,17 +6,11 @@ on: tags-ignore: - v[0-9]+.[0-9]+.[0-9]+* workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} + jobs: - clean-up-actions: - runs-on: ubuntu-latest - steps: - - name: Cancel Previous Runs - # Only cancel non-master branch runs - if: ${{ github.ref != 'refs/heads/master' }} - uses: styfle/cancel-workflow-action@0.11.0 - with: - access_token: ${{ github.token }} - compile-and-check: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 0c71ebad4..c029940d6 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -3,17 +3,11 @@ on: pull_request: types: [opened, reopened, synchronize, ready_for_review] workflow_dispatch: -jobs: - clean-up-actions: - runs-on: ubuntu-latest - steps: - - name: Cancel Previous Runs - # Only cancel non-master branch runs - if: ${{ github.ref != 'refs/heads/master' }} - uses: styfle/cancel-workflow-action@0.11.0 - with: - access_token: ${{ github.token }} +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} +jobs: coverage: if: github.event.pull_request.draft == false runs-on: ubuntu-latest diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index fef5cba5d..b63af2558 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -1,16 +1,10 @@ name: Static Analysis on: [push, workflow_dispatch] -jobs: - clean-up-actions: - runs-on: ubuntu-latest - steps: - - name: Cancel Previous Runs - # Only cancel non-master branch runs - if: ${{ github.ref != 'refs/heads/master' }} - uses: styfle/cancel-workflow-action@0.11.0 - with: - access_token: ${{ github.token }} +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} +jobs: fmt: if: github.event.pull_request.draft == false runs-on: [self-hosted, Linux, X64] diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 6218f3d9d..10fe04f9b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -6,17 +6,11 @@ on: tags-ignore: - v[0-9]+.[0-9]+.[0-9]+* workflow_dispatch: -jobs: - clean-up-actions: - runs-on: ubuntu-latest - steps: - - name: Cancel Previous Runs - # Only cancel non-master branch runs - if: ${{ github.ref != 'refs/heads/master' }} - uses: styfle/cancel-workflow-action@0.11.0 - with: - access_token: ${{ github.token }} +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} +jobs: test-runtimes: runs-on: ubuntu-latest steps: