Merge pull request #5101 from vector-im/doug/5039_workflow_concurrency

Add concurrency to GitHub workflows to auto-cancel older runs.
This commit is contained in:
Doug 2021-11-05 16:35:34 +00:00 committed by GitHub
commit 93e402afcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 0 deletions

View file

@ -17,6 +17,12 @@ jobs:
build:
name: Build
runs-on: macos-11
concurrency:
# 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:
- uses: actions/checkout@v2

View file

@ -17,6 +17,12 @@ jobs:
tests:
name: Tests
runs-on: macos-11
concurrency:
# 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:
- uses: actions/checkout@v2

View file

@ -16,6 +16,12 @@ jobs:
build:
name: Release
runs-on: macos-11
concurrency:
# 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:
- uses: actions/checkout@v2

1
changelog.d/5039.build Normal file
View file

@ -0,0 +1 @@
Add concurrency to the GitHub workflows to auto-cancel older runs of each action for PRs.