Skip to content

Commit c3cd3e5

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 (cherry picked from commit 270e43f)
1 parent 7ac680e commit c3cd3e5

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
@@ -88,6 +88,13 @@ jobs:
8888
permissions:
8989
contents: read
9090

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

0 commit comments

Comments
 (0)