From 8ee1e70d84e90a141653405e47678750b041cac7 Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Tue, 19 Nov 2024 10:05:00 +0100 Subject: [PATCH 1/3] Cancel stale CI executions when CI is retriggered in the same branch/PR --- .github/workflows/ci.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 19405db61066..2effbcd6b757 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,6 +26,14 @@ on: - cron: '0 3 * * *' # Every day at 3 AM workflow_dispatch: +# Cancels any in-progress runs within the same group identified by workflow name and GH reference (branch or tag) +# For example it would: +# - terminate previous PR CI execution after pushing more changes to the same PR branch +# - terminate previous on-push CI run after merging new PR to main +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: DOTTY_CI_RUN: true DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} From 949dbdf32e002493b3da1e7065e795234d22363d Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Tue, 19 Nov 2024 10:15:50 +0100 Subject: [PATCH 2/3] Retrigger CI From b680736f9253bd861c21acb2bba85d82058d081f Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Thu, 21 Nov 2024 11:07:59 +0100 Subject: [PATCH 3/3] Don't cancel in progress CI runs on main Co-authored-by: Tomasz Godzik --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2effbcd6b757..3b29d38fe8e1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,7 +32,7 @@ on: # - terminate previous on-push CI run after merging new PR to main concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} env: DOTTY_CI_RUN: true