From daa5f9294ae8d30cf200bd97baed5bb8e205b040 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sat, 26 Nov 2022 17:46:40 -0500 Subject: [PATCH] CI: cancel old PR builds when new commits are pushed to a PR branch (#414) Co-authored-by: Curtis Vogt --- .github/workflows/CI.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 482c6a8f6..8df0b611a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -8,6 +8,11 @@ on: tags: "*" schedule: - cron: "0 2 * * *" # Daily at 2 AM UTC (8 PM CST) +# Skip/cancel execution of queued/running jobs from outdated commits. Jobs run on the +# `master` branch are not subject to these restrictions and are always executed. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}