From 80f44bca96a18310bce2678c02176e641fe04ad4 Mon Sep 17 00:00:00 2001 From: Venkateshprasad <32921645+ven-k@users.noreply.github.com> Date: Wed, 27 Sep 2023 15:58:58 +0530 Subject: [PATCH] ci: cancel concurrent jobs for non-master branch - cancels concurrent jobs whenever a PR has subsequent pushes - jobs associated with `master` branch and `tags` are unaffected by this change i.e they run always. --- .github/workflows/Documentation.yml | 6 ++++++ .github/workflows/Downstream.yml | 6 ++++++ .github/workflows/FormatCheck.yml | 6 ++++++ .github/workflows/ci.yml | 7 +++++++ 4 files changed, 25 insertions(+) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index 36b3a74cb6..227d7cd343 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -7,6 +7,12 @@ on: tags: '*' pull_request: +concurrency: + # Skip intermediate builds: always, but for the master branch. + # Cancel intermediate builds: always, but for the master branch. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' && github.refs != 'refs/tags/*'}} + jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/Downstream.yml b/.github/workflows/Downstream.yml index 63f7a36b52..91c6d0848c 100644 --- a/.github/workflows/Downstream.yml +++ b/.github/workflows/Downstream.yml @@ -7,6 +7,12 @@ on: paths-ignore: - 'docs/**' +concurrency: + # Skip intermediate builds: always, but for the master branch and tags. + # Cancel intermediate builds: always, but for the master branch and tags. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' && github.refs != 'refs/tags/*' }} + jobs: test: name: ${{ matrix.package.repo }}/${{ matrix.package.group }}/${{ matrix.julia-version }} diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml index 55af13cc40..04b5f98566 100644 --- a/.github/workflows/FormatCheck.yml +++ b/.github/workflows/FormatCheck.yml @@ -8,6 +8,12 @@ on: tags: '*' pull_request: +concurrency: + # Skip intermediate builds: always, but for the master branch and tags. + # Cancel intermediate builds: always, but for the master branch and tags. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' && github.refs != 'refs/tags/*'}} + jobs: build: runs-on: ${{ matrix.os }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87fcbcd3c5..3f50d1cfba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,13 @@ on: - master paths-ignore: - 'docs/**' + +concurrency: + # Skip intermediate builds: always, but for the master branch. + # Cancel intermediate builds: always, but for the master branch. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} + jobs: test: runs-on: ubuntu-latest