Skip to content

Commit 270e43f

Browse files
committed
[CI] Limit concurrency of build cache update jobs.
If several merges are happening in close succession, the same number of build-cache update jobs will run (in parallel). It would be enough if only one of these were to run. Here, the update jobs for macOS are assigned to a concurrency group. This ensures that only one job runs, and only one job is pending. The pending job always gets replaced with the latest version when a merge happens. For now, this is only in effect when the workflow is triggered by a push, and only for macOS, but this could be extended. Adapted from commit 1383734
1 parent 03e4a6d commit 270e43f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/root-ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ jobs:
9292
permissions:
9393
contents: read
9494

95+
concurrency:
96+
# We need only one build cache update to run after merges to master
97+
# The group name expands to something like
98+
# "ROOT CI-20964/merge-mac26-21173435944", unless it's a build cache update, where it will be
99+
# "ROOT CI-master -mac26-update_build_cache", so only one of these jobs will run
100+
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ matrix.platform }}-${{ github.event_name == 'push' && 'update_build_cache' || github.run_id }}
101+
95102
strategy:
96103
fail-fast: false
97104
matrix:

0 commit comments

Comments
 (0)