From 755d128addd57ec1d26ff8bd186bed597fabfc6a Mon Sep 17 00:00:00 2001 From: starr-openai Date: Thu, 7 May 2026 17:11:16 -0700 Subject: [PATCH] Shard Windows arm64 nextest runs Add a dynamic rust-ci-full test matrix so workflow_dispatch or shard-specific full-ci branch names can split the Windows arm64 nextest lane across 2 or 4 hosts while leaving the default push behavior unchanged. Co-authored-by: Codex --- .github/workflows/rust-ci-full.yml | 167 ++++++++++++++++++++++------- 1 file changed, 131 insertions(+), 36 deletions(-) diff --git a/.github/workflows/rust-ci-full.yml b/.github/workflows/rust-ci-full.yml index ef1bbca42a..c66c9f9bef 100644 --- a/.github/workflows/rust-ci-full.yml +++ b/.github/workflows/rust-ci-full.yml @@ -2,7 +2,9 @@ name: rust-ci-full run-name: >- rust-ci-full${{ github.event_name == 'workflow_dispatch' && - format(' windows-nextest-{0}', inputs.windows_nextest_threads) || + format(' windows-nextest-{0} arm64-shards-{1}', inputs.windows_nextest_threads || 'default', inputs.windows_arm64_partitions || '1') || + contains(github.ref_name, 'arm64-shards-4') && ' arm64-shards-4' || + contains(github.ref_name, 'arm64-shards-2') && ' arm64-shards-2' || '' }} on: @@ -16,6 +18,15 @@ on: description: "Optional nextest --test-threads override for Windows test jobs" required: false type: string + windows_arm64_partitions: + description: "Number of Windows arm64 nextest partitions" + required: false + default: "1" + type: choice + options: + - "1" + - "2" + - "4" # CI builds in debug (dev) for faster signal. @@ -543,8 +554,114 @@ jobs: /var/cache/apt key: apt-${{ matrix.runner }}-${{ matrix.target }}-v1 + test_matrix: + name: Select test matrix + runs-on: ubuntu-24.04 + outputs: + matrix: ${{ steps.matrix.outputs.matrix }} + env: + WINDOWS_ARM64_PARTITIONS: >- + ${{ + github.event_name == 'workflow_dispatch' && inputs.windows_arm64_partitions || + contains(github.ref_name, 'arm64-shards-4') && '4' || + contains(github.ref_name, 'arm64-shards-2') && '2' || + '1' + }} + steps: + - name: Build test matrix + id: matrix + shell: bash + run: | + set -euo pipefail + case "${WINDOWS_ARM64_PARTITIONS}" in + 1|2|4) ;; + *) + echo "Unsupported WINDOWS_ARM64_PARTITIONS=${WINDOWS_ARM64_PARTITIONS}" >&2 + exit 1 + ;; + esac + + python3 - <<'PY' >> "$GITHUB_OUTPUT" + import json + import os + + windows_arm64_partitions = int(os.environ["WINDOWS_ARM64_PARTITIONS"]) + + def row(runner, target, profile, *, timeout_minutes=None, remote_env=None, runs_on=None, partition_index=None): + partition_suffix = "" + partition_name = "" + nextest_partition = "" + if partition_index is not None and windows_arm64_partitions > 1: + partition_suffix = f"-part-{partition_index}-of-{windows_arm64_partitions}" + partition_name = f" (part {partition_index}/{windows_arm64_partitions})" + nextest_partition = f"hash:{partition_index}/{windows_arm64_partitions}" + + entry = { + "runner": runner, + "target": target, + "profile": profile, + "partition_suffix": partition_suffix, + "partition_name": partition_name, + "nextest_partition": nextest_partition, + } + if timeout_minutes is not None: + entry["timeout_minutes"] = timeout_minutes + if remote_env is not None: + entry["remote_env"] = remote_env + if runs_on is not None: + entry["runs_on"] = runs_on + return entry + + codex_runners = { + "linux-x64": {"group": "codex-runners", "labels": "codex-linux-x64"}, + "linux-arm64": {"group": "codex-runners", "labels": "codex-linux-arm64"}, + "windows-x64": {"group": "codex-runners", "labels": "codex-windows-x64"}, + "windows-arm64": {"group": "codex-runners", "labels": "codex-windows-arm64"}, + } + + include = [ + row("macos-15-xlarge", "aarch64-apple-darwin", "dev"), + row( + "ubuntu-24.04", + "x86_64-unknown-linux-gnu", + "dev", + remote_env="true", + runs_on=codex_runners["linux-x64"], + ), + row( + "ubuntu-24.04-arm", + "aarch64-unknown-linux-gnu", + "dev", + runs_on=codex_runners["linux-arm64"], + ), + row( + "windows-x64", + "x86_64-pc-windows-msvc", + "dev", + runs_on=codex_runners["windows-x64"], + ), + ] + + for partition_index in range(1, windows_arm64_partitions + 1): + include.append( + row( + "windows-arm64", + "aarch64-pc-windows-msvc", + "dev", + timeout_minutes=75, + runs_on=codex_runners["windows-arm64"], + partition_index=partition_index, + ) + ) + + print("matrix<