From 7985841123177561fc935c11bf7dd07fe25d96c6 Mon Sep 17 00:00:00 2001 From: Doug Date: Fri, 5 Nov 2021 15:07:08 +0000 Subject: [PATCH 1/2] Add concurrency to GitHub workflows to auto-cancel older runs. --- .github/workflows/ci-build.yml | 5 +++++ .github/workflows/ci-tests.yml | 5 +++++ .github/workflows/release-alpha.yml | 5 +++++ changelog.d/5039.build | 1 + 4 files changed, 16 insertions(+) create mode 100644 changelog.d/5039.build diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index c86de1d80..9f2480d88 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -17,6 +17,11 @@ jobs: build: name: Build runs-on: macos-11 + + # Only allow a single run of this workflow on each branch (cancel older runs automatically) + concurrency: + group: build-${{ github.head_ref }} + cancel-in-progress: true steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 65846be15..aa9645b29 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -17,6 +17,11 @@ jobs: tests: name: Tests runs-on: macos-11 + + # Only allow a single run of this workflow on each branch (cancel older runs automatically) + concurrency: + group: tests-${{ github.head_ref }} + cancel-in-progress: true steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/release-alpha.yml b/.github/workflows/release-alpha.yml index ed175fe20..544a05e28 100644 --- a/.github/workflows/release-alpha.yml +++ b/.github/workflows/release-alpha.yml @@ -16,6 +16,11 @@ jobs: build: name: Release runs-on: macos-11 + + # Only allow a single run of this workflow on each branch (cancel older runs automatically) + concurrency: + group: alpha-${{ github.head_ref }} + cancel-in-progress: true steps: - uses: actions/checkout@v2 diff --git a/changelog.d/5039.build b/changelog.d/5039.build new file mode 100644 index 000000000..0da3a457f --- /dev/null +++ b/changelog.d/5039.build @@ -0,0 +1 @@ +Add concurrency to the GitHub workflows to auto-cancel older runs of each action. \ No newline at end of file From 0a73f6cdac6cb4220a28e31b35bf27d63014186a Mon Sep 17 00:00:00 2001 From: Doug Date: Fri, 5 Nov 2021 16:05:35 +0000 Subject: [PATCH 2/2] Remove concurrency restriction on develop. --- .github/workflows/ci-build.yml | 5 +++-- .github/workflows/ci-tests.yml | 5 +++-- .github/workflows/release-alpha.yml | 5 +++-- changelog.d/5039.build | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 9f2480d88..fd5b34876 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -18,9 +18,10 @@ jobs: name: Build runs-on: macos-11 - # Only allow a single run of this workflow on each branch (cancel older runs automatically) concurrency: - group: build-${{ github.head_ref }} + # When running on develop, use the sha to allow all runs of this workflow to run concurrently. + # Otherwise only allow a single run of this workflow on each branch, automatically cancelling older runs. + group: ${{ github.ref == 'refs/heads/develop' && format('build-develop-{0}', github.sha) || format('build-{0}', github.ref) }} cancel-in-progress: true steps: diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index aa9645b29..0fd4f4f61 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -18,9 +18,10 @@ jobs: name: Tests runs-on: macos-11 - # Only allow a single run of this workflow on each branch (cancel older runs automatically) concurrency: - group: tests-${{ github.head_ref }} + # When running on develop, use the sha to allow all runs of this workflow to run concurrently. + # Otherwise only allow a single run of this workflow on each branch, automatically cancelling older runs. + group: ${{ github.ref == 'refs/heads/develop' && format('tests-develop-{0}', github.sha) || format('tests-{0}', github.ref) }} cancel-in-progress: true steps: diff --git a/.github/workflows/release-alpha.yml b/.github/workflows/release-alpha.yml index 544a05e28..887419e26 100644 --- a/.github/workflows/release-alpha.yml +++ b/.github/workflows/release-alpha.yml @@ -17,9 +17,10 @@ jobs: name: Release runs-on: macos-11 - # Only allow a single run of this workflow on each branch (cancel older runs automatically) concurrency: - group: alpha-${{ github.head_ref }} + # When running on develop, use the sha to allow all runs of this workflow to run concurrently. + # Otherwise only allow a single run of this workflow on each branch, automatically cancelling older runs. + group: ${{ github.ref == 'refs/heads/develop' && format('alpha-develop-{0}', github.sha) || format('alpha-{0}', github.ref) }} cancel-in-progress: true steps: diff --git a/changelog.d/5039.build b/changelog.d/5039.build index 0da3a457f..f791f36fb 100644 --- a/changelog.d/5039.build +++ b/changelog.d/5039.build @@ -1 +1 @@ -Add concurrency to the GitHub workflows to auto-cancel older runs of each action. \ No newline at end of file +Add concurrency to the GitHub workflows to auto-cancel older runs of each action for PRs. \ No newline at end of file