From da537c9810fe0aa2e980cc90924a538a62c144da Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Sun, 11 Oct 2026 23:16:26 +0800 Subject: [PATCH] Give the macOS Admission Jobs Fixed Names A skipped job is listed under its unevaluated name, so every Linux and Windows leg showed the label expression. Split the waiting job into a normal and a priority job with fixed names, sharing their steps through a YAML anchor. --- .github/workflows/build_check_cache.yml | 32 ++++++++++++++++++------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_check_cache.yml b/.github/workflows/build_check_cache.yml index f9ba63a3e6..0da6c2b7b4 100644 --- a/.github/workflows/build_check_cache.yml +++ b/.github/workflows/build_check_cache.yml @@ -134,22 +134,20 @@ jobs: # Hosted macOS runners are scarce, so a pull request's macOS build waits until # one is free that push and nightly builds do not need. See the script. macos_admission: - # The macos-priority label, when the run starts, puts a pull request in its own - # line, which the normal one yields to. The script matches both names. - name: ${{ contains(github.event.pull_request.labels.*.name, 'macos-priority') && 'Wait for a macOS runner (priority)' || 'Wait for a macOS runner' }} + name: Wait for a macOS runner needs: [check_cache, wait_for_deps] - if: ${{ !cancelled() && needs.check_cache.result == 'success' && startsWith(inputs.os, 'macos-') && github.event_name == 'pull_request' }} + if: ${{ !cancelled() && needs.check_cache.result == 'success' && startsWith(inputs.os, 'macos-') && github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'macos-priority') }} runs-on: ubuntu-24.04 env: WAIT_MINUTES: 240 - PRIORITY: ${{ contains(github.event.pull_request.labels.*.name, 'macos-priority') }} + PRIORITY: false # Must exceed WAIT_MINUTES. timeout-minutes: 250 # One line for every arch of every pull request, and only its first job polls. concurrency: - group: ${{ contains(github.event.pull_request.labels.*.name, 'macos-priority') && 'macos-admission-priority' || 'macos-admission' }} + group: macos-admission queue: max - steps: + steps: &macos_admission_steps - name: Checkout uses: actions/checkout@v7 with: @@ -163,9 +161,27 @@ jobs: # -u, or the log shows nothing until the wait ends. run: python3 -u scripts/ci_macos_admission.py + # The macos-priority label, when the run starts, puts a pull request in its own + # line, which the normal one yields to. The names are fixed, because a skipped + # job is listed under its unevaluated name, and the script matches both. + macos_admission_priority: + name: Wait for a macOS runner (priority) + needs: [check_cache, wait_for_deps] + if: ${{ !cancelled() && needs.check_cache.result == 'success' && startsWith(inputs.os, 'macos-') && github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'macos-priority') }} + runs-on: ubuntu-24.04 + env: + WAIT_MINUTES: 240 + PRIORITY: true + # Must exceed WAIT_MINUTES. + timeout-minutes: 250 + concurrency: + group: macos-admission-priority + queue: max + steps: *macos_admission_steps + build_deps: # call next step name: Build Deps - needs: [check_cache, wait_for_deps, macos_admission] + needs: [check_cache, wait_for_deps, macos_admission, macos_admission_priority] # A failed wait counts as no cache, so the deps are built here. A failed # admission still builds rather than skip macOS. if: ${{ !cancelled() && needs.check_cache.result == 'success' }}