[CI] Split the CI control labels into four axes and resolve them live (#40527)

This commit is contained in:
Liangsheng Yin
2026-09-21 15:37:28 -07:00
committed by GitHub
parent 66f19f5c46
commit a5c2cc517c
22 changed files with 251 additions and 346 deletions
+17 -11
View File
@@ -136,15 +136,24 @@ jobs:
- "test/registered/rust/**"
- ".github/workflows/_pr-test-*.yml"
- name: Resolve CI labels
id: ci-labels
if: github.event_name == 'pull_request'
uses: actions/github-script@v8
with:
script: |
const { resolveCiLabels } = require(
`${process.env.GITHUB_WORKSPACE}/.github/scripts/ci-labels.cjs`
);
const axes = await resolveCiLabels(github, context);
core.info(`CI labels: [${axes.labels.join(', ')}]`);
core.setOutput('max_concurrency', String(axes.maxConcurrency));
- name: Determine full-parallel mode
id: parallel-mode
run: |
# `full=true` lifts the matrix-fanout throttle so each suite's
# max_parallel = size. Conditions:
# 1. Scheduled cron run.
# 2. run_all_tests run (manual full dispatch / release) -- a full
# run should mirror the cron's parallelism, not just its test set.
# 3. pull_request event with the `high priority` label.
# max_parallel = size.
FULL=false
if [[ "${{ github.event_name }}" == "schedule" ]]; then
FULL=true
@@ -152,9 +161,9 @@ jobs:
elif [[ "${{ inputs.run_all_tests }}" == "true" ]]; then
FULL=true
echo "run_all_tests -> full parallelism"
elif [[ "${{ github.event_name }}" == "pull_request" && "${{ contains(github.event.pull_request.labels.*.name, 'high priority') }}" == "true" ]]; then
elif [[ "${{ steps.ci-labels.outputs.max_concurrency }}" == "true" ]]; then
FULL=true
echo "high priority PR -> full parallelism"
echo "max-concurrency PR -> full parallelism"
fi
echo "full=$FULL" >> "$GITHUB_OUTPUT"
@@ -189,10 +198,7 @@ jobs:
id: partitions
run: |
# Emit a single JSON output `partitions` keyed by suite name with
# {size, arr, max_parallel} fields per suite. Replaces the prior
# full/low max-parallel presets; `--full-parallel` keeps the
# `high priority` PR / scheduled cron escape hatch.
# See scripts/ci/utils/compute_partitions.py.
# {size, arr, max_parallel} fields per suite.
python3 scripts/ci/utils/compute_partitions.py \
--full-parallel ${{ steps.parallel-mode.outputs.full }} \
--partition-model-file /tmp/partition-model.json \