Skip to content

Commit 3d0e70a

Browse files
committed
Merge branch 'jc/ci-skip-same-commit'
Tweak GitHub Actions CI so that pushing the same commit to multiple branch tips at the same time will not waste building and testing the same thing twice. * jc/ci-skip-same-commit: ci: avoid building from the same commit in parallel
2 parents 19cb1fc + 99fe06c commit 3d0e70a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/main.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ on: [push, pull_request]
55
env:
66
DEVELOPER: 1
77

8+
# If more than one workflow run is triggered for the very same commit hash
9+
# (which happens when multiple branches pointing to the same commit), only
10+
# the first one is allowed to run, the second will be kept in the "queued"
11+
# state. This allows a successful completion of the first run to be reused
12+
# in the second run via the `skip-if-redundant` logic in the `config` job.
13+
#
14+
# The only caveat is that if a workflow run is triggered for the same commit
15+
# hash that another run is already being held, that latter run will be
16+
# canceled. For more details about the `concurrency` attribute, see:
17+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
18+
concurrency:
19+
group: ${{ github.sha }}
20+
821
jobs:
922
ci-config:
1023
name: config

0 commit comments

Comments
 (0)