From 52ab50f2c07a5416e17a7f98ca93cbaf54ca7a72 Mon Sep 17 00:00:00 2001 From: zaniebot <242828183+zaniebot@users.noreply.github.com> Date: Thu, 29 Oct 2026 22:09:21 +0000 Subject: [PATCH 1/3] Add shared runner selection --- .github/workflows/test-select-runners.yml | 52 +++++++++ README.md | 2 + plan-release-signing/README.md | 9 +- plan-release-signing/action.yml | 4 + plan-release-signing/plan.py | 44 ++++++-- plan-release-signing/test_plan.py | 44 +++++++- select-runners/README.md | 74 +++++++++++++ select-runners/action.yml | 20 ++++ select-runners/main.cjs | 122 ++++++++++++++++++++++ select-runners/main.test.cjs | 119 +++++++++++++++++++++ select-runners/runners.json | 60 +++++++++++ 11 files changed, 540 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/test-select-runners.yml create mode 100644 select-runners/README.md create mode 100644 select-runners/action.yml create mode 100644 select-runners/main.cjs create mode 100644 select-runners/main.test.cjs create mode 100644 select-runners/runners.json diff --git a/.github/workflows/test-select-runners.yml b/.github/workflows/test-select-runners.yml new file mode 100644 index 0000000..94504ae --- /dev/null +++ b/.github/workflows/test-select-runners.yml @@ -0,0 +1,52 @@ +name: Test runner selection + +on: + pull_request: + paths: + - select-runners/** + - plan-release-signing/** + - .github/workflows/test-select-runners.yml + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-24.04 + timeout-minutes: 5 + outputs: + runners: ${{ steps.runners.outputs.runners }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 + with: + node-version: "24" + package-manager-cache: false + - run: node --test select-runners/main.test.cjs + - run: python3 -m unittest discover -s plan-release-signing + - uses: ./select-runners + id: runners + with: + free-only: "true" + required: ubuntu-x86_64-16 ubuntu-aarch64-4 windows-x86_64-16 + + selected-runner: + needs: test + runs-on: ${{ fromJSON(needs.test.outputs.runners).ubuntu-x86_64-16 }} + timeout-minutes: 5 + steps: + - run: echo "Scheduled on the selected free runner" + + unavailable-runner: + needs: test + if: ${{ fromJSON(needs.test.outputs.runners).ubuntu-x86_64-codspeed != '' }} + runs-on: ${{ fromJSON(needs.test.outputs.runners).ubuntu-x86_64-codspeed }} + steps: + - run: exit 1 diff --git a/README.md b/README.md index 8bb4422..0ab1ec3 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Shared GitHub Actions for Astral projects. +- [Select runners](select-runners/): resolve shared runner roles with free + GitHub-hosted alternatives for forks. - [Simple token service](simple-token-service/): exchange GitHub Actions OIDC tokens for scoped GitHub App installation tokens. - [Key-value store](key-value-store/): share workflow state within a GitHub Actions diff --git a/plan-release-signing/README.md b/plan-release-signing/README.md index 0b3c7b8..58886a9 100644 --- a/plan-release-signing/README.md +++ b/plan-release-signing/README.md @@ -36,6 +36,9 @@ The action provides four JSON outputs: - `macos`: macOS artifact declarations with native runner and Python architecture. - `windows`: Windows artifact declarations with native runner and Python architecture. -The native matrices use Astral's macOS runners, Astral's x86 Windows runner, -and GitHub's ARM64 Windows runner. An unknown native target fails planning so a -new release target cannot bypass signing or verification. +Pass the `runners` JSON output from [Select runners](../select-runners/) to use +the same selection as the rest of the workflow. The native matrices require +`macos-aarch64-8`, `windows-x86_64-16`, and `windows-aarch64-8` for the corresponding +targets. If `runners` is omitted, the action uses the preferred candidates from +the shared catalog. Missing required runners and unknown native targets fail +planning so a new release target cannot bypass signing or verification. diff --git a/plan-release-signing/action.yml b/plan-release-signing/action.yml index 47a0bb5..2c2afe4 100644 --- a/plan-release-signing/action.yml +++ b/plan-release-signing/action.yml @@ -20,6 +20,9 @@ inputs: description: "Directory containing cargo-dist GitHub release archives." required: false default: "github-archives" + runners: + description: "Resolved JSON runner map from select-runners. Defaults to the catalog's preferred candidates." + required: false outputs: targets: @@ -54,4 +57,5 @@ runs: RELEASE_WORKSPACE: ${{ inputs.workspace }} RELEASE_WHEELS_DIRECTORY: ${{ inputs.wheels-directory }} RELEASE_GITHUB_ARCHIVES_DIRECTORY: ${{ inputs.github-archives-directory }} + RELEASE_RUNNERS: ${{ inputs.runners }} run: uv run --locked "$ACTION_PATH/plan.py" >> "$GITHUB_OUTPUT" diff --git a/plan-release-signing/plan.py b/plan-release-signing/plan.py index 21326d2..35391c0 100644 --- a/plan-release-signing/plan.py +++ b/plan-release-signing/plan.py @@ -15,20 +15,20 @@ PLATFORMS = { "macos": { - "aarch64-apple-darwin": ("namespace-profile-macos-15", "arm64"), - "x86_64-apple-darwin": ("namespace-profile-macos-15", "x64"), + "aarch64-apple-darwin": ("macos-aarch64-8", "arm64"), + "x86_64-apple-darwin": ("macos-aarch64-8", "x64"), }, "windows": { "aarch64-pc-windows-msvc": ( - "github-windows-11-aarch64-8", + "windows-aarch64-8", "arm64", ), "i686-pc-windows-msvc": ( - "namespace-profile-windows-2022-x86-64-16x32", + "windows-x86_64-16", "x86", ), "x86_64-pc-windows-msvc": ( - "namespace-profile-windows-2022-x86-64-16x32", + "windows-x86_64-16", "x64", ), }, @@ -37,6 +37,26 @@ SIGNED_TARGET_SUFFIXES = ("-apple-darwin", "-pc-windows-msvc") +def runner_labels(value: str = "") -> dict[str, str]: + """Read resolved labels, or the preferred catalog candidates for callers without a map.""" + if value: + runners = json.loads(value) + else: + catalog_path = Path(__file__).parents[1] / "select-runners" / "runners.json" + catalog = json.loads(catalog_path.read_text(encoding="utf-8")) + runners = {role: candidates[0]["label"] for role, candidates in catalog.items()} + if not isinstance(runners, dict) or not all( + isinstance(role, str) + and isinstance(label, str) + and label + and label.strip() == label + and not any(ord(char) < 32 or ord(char) == 127 for char in label) + for role, label in runners.items() + ): + raise ValueError("runners must map roles to non-empty runner labels") + return runners + + def release_targets(workspace: Path) -> list[str]: """Read and validate the target inventory used by cargo-dist.""" targets = tomllib.loads(workspace.read_text(encoding="utf-8"))["dist"]["targets"] @@ -122,12 +142,23 @@ def signing_plan( archive_package: str, wheels_directory: PurePosixPath, github_archives_directory: PurePosixPath, + runners: dict[str, str] | None = None, ) -> dict[str, list[dict]]: """Require every macOS and Windows target to have a native verifier.""" expected = {target for target in targets if target.endswith(SIGNED_TARGET_SUFFIXES)} configured = {target for platforms in PLATFORMS.values() for target in platforms} if unsupported := expected - configured: raise ValueError(f"Unsupported release signing targets: {sorted(unsupported)}") + if runners is None: + runners = runner_labels() + required_roles = { + role + for platforms in PLATFORMS.values() + for target, (role, _) in platforms.items() + if target in expected + } + if missing := required_roles - runners.keys(): + raise ValueError(f"Missing release signing runners: {sorted(missing)}") plan = {} for system, platforms in PLATFORMS.items(): @@ -137,7 +168,7 @@ def signing_plan( plan[system] = [ { "target": target, - "runner": platforms[target][0], + "runner": runners[platforms[target][0]], "python-architecture": platforms[target][1], **artifact_inputs( system, @@ -163,6 +194,7 @@ def main() -> None: os.environ["RELEASE_ARCHIVE_PACKAGE"], PurePosixPath(os.environ["RELEASE_WHEELS_DIRECTORY"]), PurePosixPath(os.environ["RELEASE_GITHUB_ARCHIVES_DIRECTORY"]), + runner_labels(os.environ.get("RELEASE_RUNNERS", "")), ) print(f"targets={json.dumps(targets, separators=(',', ':'))}") diff --git a/plan-release-signing/test_plan.py b/plan-release-signing/test_plan.py index f615260..672fb43 100644 --- a/plan-release-signing/test_plan.py +++ b/plan-release-signing/test_plan.py @@ -5,7 +5,7 @@ sys.path.insert(0, str(Path(__file__).parent)) -from plan import package_inventories, signing_plan +from plan import package_inventories, runner_labels, signing_plan TARGETS = [ "aarch64-apple-darwin", @@ -112,6 +112,48 @@ def test_rejects_duplicate_executables(self) -> None: with self.assertRaisesRegex(ValueError, "executables must be distinct"): package_inventories(json.dumps(packages)) + def test_uses_resolved_free_runners(self) -> None: + runners = { + "macos-aarch64-8": "macos-15", + "windows-x86_64-16": "windows-2025", + "windows-aarch64-8": "windows-11-arm", + } + plan = signing_plan( + TARGETS, + package_inventories(json.dumps(UV_PACKAGES)), + "uv", + PurePosixPath("wheels"), + PurePosixPath("github-archives"), + runner_labels(json.dumps(runners)), + ) + self.assertEqual( + [target["runner"] for target in plan["macos"]], ["macos-15"] * 2 + ) + self.assertEqual( + [target["runner"] for target in plan["windows"]], + ["windows-11-arm", "windows-2025", "windows-2025"], + ) + + def test_rejects_missing_runner_in_supplied_map(self) -> None: + with self.assertRaisesRegex(ValueError, "Missing release signing runners"): + signing_plan( + TARGETS, + package_inventories(json.dumps(UV_PACKAGES)), + "uv", + PurePosixPath("wheels"), + PurePosixPath("github-archives"), + {}, + ) + + def test_preferred_catalog_candidates(self) -> None: + plan = self.plan(UV_PACKAGES, "uv") + self.assertEqual(plan["macos"][0]["runner"], "namespace-profile-macos-15") + self.assertEqual(plan["windows"][0]["runner"], "github-windows-11-aarch64-8") + self.assertEqual( + plan["windows"][1]["runner"], + "namespace-profile-windows-2022-x86-64-16x32", + ) + if __name__ == "__main__": unittest.main() diff --git a/select-runners/README.md b/select-runners/README.md new file mode 100644 index 0000000..669e1ad --- /dev/null +++ b/select-runners/README.md @@ -0,0 +1,74 @@ +# Select runners + +Resolve logical runner roles from the shared [catalog](runners.json). The action +uses its bundled catalog and needs neither a checkout nor a GitHub token. + +Each role contains an ordered list of candidates. Selection uses the first +candidate, or the first candidate marked `free` when `free-only` is enabled. +By default, workflows outside the `astral-sh` organization use only free +candidates. This uses the workflow repository owner: a contributor's pull request +to an Astral repository still runs on Astral's runners, while a workflow in the +contributor's fork uses GitHub-hosted alternatives. Astral repositories must have +access to the configured runner pools. + +Pin the action to a full commit SHA so the resolver and catalog change together. +Runner selection is configuration, not a probe of runner capacity or provider +availability; an unavailable provider does not trigger another selection. + +## Usage + +Run selection in an existing setup or planning job, then pass the `runners` JSON +output to dependent jobs or reusable workflows. The initial job needs a fixed +runner because its steps execute after GitHub schedules it. + +```yaml +jobs: + plan: + runs-on: ubuntu-24.04 + outputs: + runners: ${{ steps.runners.outputs.runners }} + free-only: ${{ steps.runners.outputs.free-only }} + steps: + - uses: astral-sh/github-actions/select-runners@ + id: runners + with: + required: ubuntu-x86_64-16 windows-x86_64-16 + + test: + needs: plan + runs-on: ${{ fromJSON(needs.plan.outputs.runners).ubuntu-x86_64-16 }} + steps: + - run: echo "Run tests" +``` + +Reusable workflows can accept a single required `runners` string input and use +`${{ fromJSON(inputs.runners).ubuntu-x86_64-16 }}`. The caller remains responsible +for job permissions, conditions, timeouts, and workload settings. + +## Inputs and outputs + +| Input | Meaning | +| ----------- | ------------------------------------------------------------------------------------------ | +| `free-only` | Optional `true` or `false` override. Defaults to `true` outside `astral-sh`. | +| `required` | Whitespace-separated roles that must resolve. Unknown or unavailable roles fail selection. | + +| Output | Meaning | +| ----------- | ------------------------------------------------------------------ | +| `runners` | Compact JSON object mapping available roles to runner labels. | +| `free-only` | `true` when only free candidates were eligible; otherwise `false`. | + +Sizes in ordinary role names describe the preferred runner. Free fallbacks may +have fewer CPUs and less memory, so callers may need longer timeouts or less +parallelism. The `free` flag describes the public-repository runner tier, not a +billing guarantee for private repositories. + +Specialized roles are omitted when no eligible candidate exists: + +- `ubuntu-aarch64-pgo` requires the native 64 GB ARM runner used for release PGO. + A caller may instead use `ubuntu-aarch64-4` with PGO disabled. +- `ubuntu-x86_64-codspeed` requires CodSpeed's walltime benchmark runner. Guard + the benchmark job with an `if` checking that this role is present. + +The `-github` variants retain the GitHub runner image where a workload uses it; +the corresponding ordinary Linux build roles use Depot's runner and cache. +The `-slim` role permits the constrained `ubuntu-slim` image as its free fallback. diff --git a/select-runners/action.yml b/select-runners/action.yml new file mode 100644 index 0000000..387e589 --- /dev/null +++ b/select-runners/action.yml @@ -0,0 +1,20 @@ +name: "Select runners" +description: "Resolve shared runner roles, with GitHub-hosted fallbacks outside Astral." + +inputs: + free-only: + description: "Select only free candidates. Defaults to true outside the astral-sh organization." + required: false + required: + description: "Runner roles that must be available, separated by whitespace." + required: false + +outputs: + runners: + description: "JSON object mapping available runner roles to labels." + free-only: + description: "Whether selection was restricted to free candidates." + +runs: + using: node24 + main: main.cjs diff --git a/select-runners/main.cjs b/select-runners/main.cjs new file mode 100644 index 0000000..a46f2e3 --- /dev/null +++ b/select-runners/main.cjs @@ -0,0 +1,122 @@ +"use strict"; + +const fs = require("node:fs"); +const path = require("node:path"); + +function validateCatalog(catalog) { + if ( + !catalog || + typeof catalog !== "object" || + Array.isArray(catalog) || + Object.keys(catalog).length === 0 + ) { + throw new Error("Runner catalog must be a non-empty object"); + } + + for (const [role, candidates] of Object.entries(catalog)) { + if (!/^[a-z][a-z0-9_]*(?:-[a-z0-9_]+)*$/.test(role)) { + throw new Error(`Invalid runner role: ${role}`); + } + if (!Array.isArray(candidates) || candidates.length === 0) { + throw new Error(`Runner role ${role} must have at least one candidate`); + } + const labels = new Set(); + for (const candidate of candidates) { + if ( + !candidate || + typeof candidate !== "object" || + Array.isArray(candidate) || + Object.keys(candidate).sort().join(",") !== "free,label" + ) { + throw new Error( + `Runner candidates for ${role} must contain label and free`, + ); + } + if ( + typeof candidate.label !== "string" || + candidate.label.trim() !== candidate.label || + candidate.label.length === 0 || + /[\x00-\x1f\x7f]/.test(candidate.label) + ) { + throw new Error(`Invalid runner label for ${role}`); + } + if (typeof candidate.free !== "boolean") { + throw new Error( + `Runner candidate for ${role} must have a boolean free field`, + ); + } + if (labels.has(candidate.label)) { + throw new Error(`Runner role ${role} repeats label ${candidate.label}`); + } + labels.add(candidate.label); + } + } + return catalog; +} + +function freeOnlyPolicy(input, owner) { + if (input === "") { + if (!owner) { + throw new Error( + "GITHUB_REPOSITORY_OWNER is required for automatic selection", + ); + } + return owner.toLowerCase() !== "astral-sh"; + } + if (input === "true") return true; + if (input === "false") return false; + throw new Error("free-only must be true or false"); +} + +function resolveRunners(catalog, { freeOnly, required = [] }) { + validateCatalog(catalog); + const runners = Object.fromEntries( + Object.entries(catalog).flatMap(([role, candidates]) => { + const candidate = candidates.find( + (candidate) => !freeOnly || candidate.free, + ); + return candidate ? [[role, candidate.label]] : []; + }), + ); + + for (const role of required) { + if (!Object.hasOwn(catalog, role)) { + throw new Error(`Unknown required runner role: ${role}`); + } + if (!Object.hasOwn(runners, role)) { + throw new Error(`No eligible runner for required role: ${role}`); + } + } + return runners; +} + +function run({ env = process.env } = {}) { + const freeOnly = freeOnlyPolicy( + env["INPUT_FREE-ONLY"] || "", + env.GITHUB_REPOSITORY_OWNER, + ); + const required = (env.INPUT_REQUIRED || "").split(/\s+/).filter(Boolean); + const catalog = JSON.parse( + fs.readFileSync(path.join(__dirname, "runners.json"), "utf8"), + ); + const runners = resolveRunners(catalog, { freeOnly, required }); + if (!env.GITHUB_OUTPUT) { + throw new Error("GITHUB_OUTPUT is required"); + } + fs.appendFileSync( + env.GITHUB_OUTPUT, + `runners=${JSON.stringify(runners)}\nfree-only=${freeOnly}\n`, + "utf8", + ); +} + +module.exports = { freeOnlyPolicy, resolveRunners, run, validateCatalog }; + +if (require.main === module) { + try { + run(); + } catch (error) { + console.error(error.message); + process.exitCode = 1; + } +} diff --git a/select-runners/main.test.cjs b/select-runners/main.test.cjs new file mode 100644 index 0000000..a2a162b --- /dev/null +++ b/select-runners/main.test.cjs @@ -0,0 +1,119 @@ +"use strict"; + +const assert = require("node:assert/strict"); +const fs = require("node:fs"); +const os = require("node:os"); +const path = require("node:path"); +const test = require("node:test"); +const { + freeOnlyPolicy, + resolveRunners, + run, + validateCatalog, +} = require("./main.cjs"); +const catalog = require("./runners.json"); + +test("selects the first eligible candidate for each role", () => { + const candidates = { + linux: [ + { label: "preferred", free: false }, + { label: "fallback", free: true }, + { label: "last", free: true }, + ], + specialized: [{ label: "specialized", free: false }], + }; + assert.deepEqual(resolveRunners(candidates, { freeOnly: false }), { + linux: "preferred", + specialized: "specialized", + }); + assert.deepEqual(resolveRunners(candidates, { freeOnly: true }), { + linux: "fallback", + }); +}); + +test("uses the workflow repository owner, including Astral forks", () => { + assert.equal(freeOnlyPolicy("", "astral-sh"), false); + assert.equal(freeOnlyPolicy("", "Astral-Sh"), false); + assert.equal(freeOnlyPolicy("", "contributor"), true); + assert.equal(freeOnlyPolicy("true", "astral-sh"), true); + assert.equal(freeOnlyPolicy("false", "contributor"), false); + assert.throws(() => freeOnlyPolicy("", undefined), /REPOSITORY_OWNER/); + assert.throws(() => freeOnlyPolicy("yes", "astral-sh"), /true or false/); +}); + +test("rejects unknown and unavailable required roles before emitting outputs", () => { + assert.throws( + () => resolveRunners(catalog, { freeOnly: false, required: ["typo"] }), + /Unknown required runner role: typo/, + ); + assert.throws( + () => + resolveRunners(catalog, { + freeOnly: true, + required: ["ubuntu-aarch64-pgo"], + }), + /No eligible runner for required role: ubuntu-aarch64-pgo/, + ); +}); + +test("the bundled free policy has no paid labels or specialized fallbacks", () => { + const runners = resolveRunners(catalog, { freeOnly: true }); + assert.equal(Object.hasOwn(runners, "ubuntu-aarch64-pgo"), false); + assert.equal(Object.hasOwn(runners, "ubuntu-x86_64-codspeed"), false); + assert.equal(runners["ubuntu-aarch64-4"], "ubuntu-24.04-arm"); + assert.equal(runners["windows-aarch64-8"], "windows-11-arm"); + for (const [role, label] of Object.entries(runners)) { + assert.ok( + catalog[role].some( + (candidate) => candidate.label === label && candidate.free, + ), + ); + } +}); + +test("validates the whole catalog even when selecting only free candidates", () => { + for (const invalid of [ + null, + [], + {}, + { "invalid role": [{ label: "runner", free: true }] }, + { linux: [] }, + { linux: [null] }, + { linux: [{ label: "runner" }] }, + { linux: [{ label: "runner", free: true, priority: 1 }] }, + { linux: [{ label: "", free: true }] }, + { linux: [{ label: "runner\nother=value", free: false }] }, + { linux: [{ label: "runner ", free: false }] }, + { linux: [{ label: "runner", free: "false" }] }, + { + linux: [ + { label: "runner", free: true }, + { label: "runner", free: false }, + ], + }, + ]) { + assert.throws(() => resolveRunners(invalid, { freeOnly: true })); + } + assert.equal(validateCatalog(catalog), catalog); +}); + +test("writes compact action outputs using the bundled catalog without a checkout", (context) => { + const directory = fs.mkdtempSync(path.join(os.tmpdir(), "select-runners-")); + context.after(() => fs.rmSync(directory, { recursive: true, force: true })); + const output = path.join(directory, "output"); + run({ + env: { + GITHUB_REPOSITORY_OWNER: "contributor", + GITHUB_REPOSITORY: "contributor/uv", + GITHUB_OUTPUT: output, + INPUT_REQUIRED: "ubuntu-x86_64-16\nwindows-aarch64-8", + }, + }); + const [runners, freeOnly, end] = fs.readFileSync(output, "utf8").split("\n"); + assert.equal(freeOnly, "free-only=true"); + assert.equal(end, ""); + assert.deepEqual( + JSON.parse(runners.slice("runners=".length)), + resolveRunners(catalog, { freeOnly: true }), + ); +}); diff --git a/select-runners/runners.json b/select-runners/runners.json new file mode 100644 index 0000000..d6c0c22 --- /dev/null +++ b/select-runners/runners.json @@ -0,0 +1,60 @@ +{ + "ubuntu-x86_64-2": [ + { "label": "github-ubuntu-24.04-x86_64-2", "free": false }, + { "label": "ubuntu-24.04", "free": true } + ], + "ubuntu-x86_64-2-slim": [ + { "label": "github-ubuntu-24.04-x86_64-2", "free": false }, + { "label": "ubuntu-slim", "free": true } + ], + "ubuntu-x86_64-4": [ + { "label": "depot-ubuntu-24.04-4", "free": false }, + { "label": "ubuntu-24.04", "free": true } + ], + "ubuntu-x86_64-4-github": [ + { "label": "github-ubuntu-24.04-x86_64-4", "free": false }, + { "label": "ubuntu-24.04", "free": true } + ], + "ubuntu-x86_64-8": [ + { "label": "depot-ubuntu-24.04-8", "free": false }, + { "label": "ubuntu-24.04", "free": true } + ], + "ubuntu-x86_64-8-github": [ + { "label": "github-ubuntu-24.04-x86_64-8", "free": false }, + { "label": "ubuntu-24.04", "free": true } + ], + "ubuntu-x86_64-16": [ + { "label": "depot-ubuntu-24.04-16", "free": false }, + { "label": "ubuntu-24.04", "free": true } + ], + "ubuntu-aarch64-2": [ + { "label": "github-ubuntu-24.04-aarch64-2", "free": false }, + { "label": "ubuntu-24.04-arm", "free": true } + ], + "ubuntu-aarch64-4": [ + { "label": "github-ubuntu-24.04-aarch64-4", "free": false }, + { "label": "ubuntu-24.04-arm", "free": true } + ], + "ubuntu-aarch64-pgo": [ + { "label": "depot-ubuntu-24.04-arm-16", "free": false } + ], + "ubuntu-x86_64-codspeed": [ + { "label": "codspeed-macro-x64-ryzen-9950x-ubuntu-24-04", "free": false } + ], + "macos-aarch64-8": [ + { "label": "namespace-profile-macos-15", "free": false }, + { "label": "macos-15", "free": true } + ], + "windows-x86_64-4": [ + { "label": "namespace-profile-windows-2022-x86-64-4", "free": false }, + { "label": "windows-2025", "free": true } + ], + "windows-x86_64-16": [ + { "label": "namespace-profile-windows-2022-x86-64-16x32", "free": false }, + { "label": "windows-2025", "free": true } + ], + "windows-aarch64-8": [ + { "label": "github-windows-11-aarch64-8", "free": false }, + { "label": "windows-11-arm", "free": true } + ] +} From 1df325fd3d5d6db131265775104771e338e3f96a Mon Sep 17 00:00:00 2001 From: zaniebot <242828183+zaniebot@users.noreply.github.com> Date: Thu, 29 Oct 2026 22:11:08 +0000 Subject: [PATCH 2/3] Use the self-repository reference for runner selection --- .github/workflows/test-select-runners.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-select-runners.yml b/.github/workflows/test-select-runners.yml index 94504ae..886522e 100644 --- a/.github/workflows/test-select-runners.yml +++ b/.github/workflows/test-select-runners.yml @@ -31,7 +31,7 @@ jobs: package-manager-cache: false - run: node --test select-runners/main.test.cjs - run: python3 -m unittest discover -s plan-release-signing - - uses: ./select-runners + - uses: $/select-runners id: runners with: free-only: "true" From d50d08cb8e679878ab643cbd115a801c252a312e Mon Sep 17 00:00:00 2001 From: zaniebot <242828183+zaniebot@users.noreply.github.com> Date: Wed, 4 Nov 2026 16:32:11 +0000 Subject: [PATCH 3/3] Catalog the GitHub, Namespace, and Depot runners available to Astral --- .github/workflows/test-select-runners.yml | 6 +- README.md | 4 +- plan-release-signing/plan.py | 6 +- select-runners/README.md | 46 ++++-- select-runners/action.yml | 3 + select-runners/main.cjs | 106 +++++------- select-runners/main.test.cjs | 140 ++++++++-------- select-runners/roles.json | 23 +++ select-runners/runners.json | 193 ++++++++++++++++------ 9 files changed, 314 insertions(+), 213 deletions(-) create mode 100644 select-runners/roles.json diff --git a/.github/workflows/test-select-runners.yml b/.github/workflows/test-select-runners.yml index 886522e..385b657 100644 --- a/.github/workflows/test-select-runners.yml +++ b/.github/workflows/test-select-runners.yml @@ -35,11 +35,13 @@ jobs: id: runners with: free-only: "true" - required: ubuntu-x86_64-16 ubuntu-aarch64-4 windows-x86_64-16 + roles: | + {"linux-smoke": ["namespace-profile-ubuntu-24-04-8", "ubuntu-24.04"]} + required: linux-smoke ubuntu-x86_64-16 ubuntu-aarch64-4 windows-x86_64-16 selected-runner: needs: test - runs-on: ${{ fromJSON(needs.test.outputs.runners).ubuntu-x86_64-16 }} + runs-on: ${{ fromJSON(needs.test.outputs.runners).linux-smoke }} timeout-minutes: 5 steps: - run: echo "Scheduled on the selected free runner" diff --git a/README.md b/README.md index 0ab1ec3..f2eceed 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ Shared GitHub Actions for Astral projects. -- [Select runners](select-runners/): resolve shared runner roles with free - GitHub-hosted alternatives for forks. +- [Select runners](select-runners/) chooses GitHub, Depot, and Namespace runners + for named roles and selects GitHub-hosted alternatives for forks. - [Simple token service](simple-token-service/): exchange GitHub Actions OIDC tokens for scoped GitHub App installation tokens. - [Key-value store](key-value-store/): share workflow state within a GitHub Actions diff --git a/plan-release-signing/plan.py b/plan-release-signing/plan.py index 35391c0..80cd1ff 100644 --- a/plan-release-signing/plan.py +++ b/plan-release-signing/plan.py @@ -42,9 +42,9 @@ def runner_labels(value: str = "") -> dict[str, str]: if value: runners = json.loads(value) else: - catalog_path = Path(__file__).parents[1] / "select-runners" / "runners.json" - catalog = json.loads(catalog_path.read_text(encoding="utf-8")) - runners = {role: candidates[0]["label"] for role, candidates in catalog.items()} + roles_path = Path(__file__).parents[1] / "select-runners" / "roles.json" + roles = json.loads(roles_path.read_text(encoding="utf-8")) + runners = {role: candidates[0] for role, candidates in roles.items()} if not isinstance(runners, dict) or not all( isinstance(role, str) and isinstance(label, str) diff --git a/select-runners/README.md b/select-runners/README.md index 669e1ad..7c9817e 100644 --- a/select-runners/README.md +++ b/select-runners/README.md @@ -1,19 +1,21 @@ # Select runners -Resolve logical runner roles from the shared [catalog](runners.json). The action -uses its bundled catalog and needs neither a checkout nor a GitHub token. +Choose runners for CI jobs from the [runner inventory](runners.json), which +lists exact labels for Namespace, Depot, GitHub, and CodSpeed. The +[default roles](roles.json) map job requirements to ordered lists of those +labels. Both files ship with the action. -Each role contains an ordered list of candidates. Selection uses the first -candidate, or the first candidate marked `free` when `free-only` is enabled. +For each role, the action selects the first candidate. With `free-only` +enabled, it selects the first candidate in the `github-standard` group. By default, workflows outside the `astral-sh` organization use only free -candidates. This uses the workflow repository owner: a contributor's pull request -to an Astral repository still runs on Astral's runners, while a workflow in the -contributor's fork uses GitHub-hosted alternatives. Astral repositories must have +candidates. A pull request targeting an Astral repository runs on Astral's +runners. A workflow running in the contributor's fork uses GitHub-hosted +alternatives. Astral repositories must have access to the configured runner pools. -Pin the action to a full commit SHA so the resolver and catalog change together. -Runner selection is configuration, not a probe of runner capacity or provider -availability; an unavailable provider does not trigger another selection. +Pin the action to a full commit SHA so the resolver, inventory, and roles +change together. Selection uses the configured labels and takes place before +GitHub schedules the dependent jobs. A queued job stays on its selected label. ## Usage @@ -45,11 +47,27 @@ Reusable workflows can accept a single required `runners` string input and use `${{ fromJSON(inputs.runners).ubuntu-x86_64-16 }}`. The caller remains responsible for job permissions, conditions, timeouts, and workload settings. +To select other machines from the inventory, use `roles` to add a role or +replace the candidates for a default role. This example uses a 32-core +Namespace runner for Windows builds and a 32-core Depot runner for Linux +builds. Each role names a standard GitHub runner for forks. + +```yaml +with: + roles: | + { + "windows-build": ["namespace-profile-windows-2022-x86-64-32x64", "windows-2025"], + "linux-build": ["depot-ubuntu-24.04-32", "ubuntu-24.04"] + } + required: windows-build linux-build +``` + ## Inputs and outputs | Input | Meaning | | ----------- | ------------------------------------------------------------------------------------------ | | `free-only` | Optional `true` or `false` override. Defaults to `true` outside `astral-sh`. | +| `roles` | Optional JSON object mapping role names to ordered lists of inventory labels. | | `required` | Whitespace-separated roles that must resolve. Unknown or unavailable roles fail selection. | | Output | Meaning | @@ -59,8 +77,8 @@ for job permissions, conditions, timeouts, and workload settings. Sizes in ordinary role names describe the preferred runner. Free fallbacks may have fewer CPUs and less memory, so callers may need longer timeouts or less -parallelism. The `free` flag describes the public-repository runner tier, not a -billing guarantee for private repositories. +parallelism. GitHub provides the `github-standard` runners free of charge for +public repositories. Private repositories follow their GitHub billing plan. Specialized roles are omitted when no eligible candidate exists: @@ -69,6 +87,6 @@ Specialized roles are omitted when no eligible candidate exists: - `ubuntu-x86_64-codspeed` requires CodSpeed's walltime benchmark runner. Guard the benchmark job with an `if` checking that this role is present. -The `-github` variants retain the GitHub runner image where a workload uses it; -the corresponding ordinary Linux build roles use Depot's runner and cache. +The `-github` variants use the GitHub runner image. The corresponding Linux +build roles use Depot's runner and cache. The `-slim` role permits the constrained `ubuntu-slim` image as its free fallback. diff --git a/select-runners/action.yml b/select-runners/action.yml index 387e589..d56d59e 100644 --- a/select-runners/action.yml +++ b/select-runners/action.yml @@ -5,6 +5,9 @@ inputs: free-only: description: "Select only free candidates. Defaults to true outside the astral-sh organization." required: false + roles: + description: "JSON object adding or replacing roles with ordered lists of catalog labels." + required: false required: description: "Runner roles that must be available, separated by whitespace." required: false diff --git a/select-runners/main.cjs b/select-runners/main.cjs index a46f2e3..8d8ff66 100644 --- a/select-runners/main.cjs +++ b/select-runners/main.cjs @@ -1,58 +1,11 @@ "use strict"; const fs = require("node:fs"); -const path = require("node:path"); +const inventory = require("./runners.json"); +const defaultRoles = require("./roles.json"); -function validateCatalog(catalog) { - if ( - !catalog || - typeof catalog !== "object" || - Array.isArray(catalog) || - Object.keys(catalog).length === 0 - ) { - throw new Error("Runner catalog must be a non-empty object"); - } - - for (const [role, candidates] of Object.entries(catalog)) { - if (!/^[a-z][a-z0-9_]*(?:-[a-z0-9_]+)*$/.test(role)) { - throw new Error(`Invalid runner role: ${role}`); - } - if (!Array.isArray(candidates) || candidates.length === 0) { - throw new Error(`Runner role ${role} must have at least one candidate`); - } - const labels = new Set(); - for (const candidate of candidates) { - if ( - !candidate || - typeof candidate !== "object" || - Array.isArray(candidate) || - Object.keys(candidate).sort().join(",") !== "free,label" - ) { - throw new Error( - `Runner candidates for ${role} must contain label and free`, - ); - } - if ( - typeof candidate.label !== "string" || - candidate.label.trim() !== candidate.label || - candidate.label.length === 0 || - /[\x00-\x1f\x7f]/.test(candidate.label) - ) { - throw new Error(`Invalid runner label for ${role}`); - } - if (typeof candidate.free !== "boolean") { - throw new Error( - `Runner candidate for ${role} must have a boolean free field`, - ); - } - if (labels.has(candidate.label)) { - throw new Error(`Runner role ${role} repeats label ${candidate.label}`); - } - labels.add(candidate.label); - } - } - return catalog; -} +const labels = new Set(Object.values(inventory).flat()); +const freeLabels = new Set(inventory["github-standard"]); function freeOnlyPolicy(input, owner) { if (input === "") { @@ -68,19 +21,38 @@ function freeOnlyPolicy(input, owner) { throw new Error("free-only must be true or false"); } -function resolveRunners(catalog, { freeOnly, required = [] }) { - validateCatalog(catalog); - const runners = Object.fromEntries( - Object.entries(catalog).flatMap(([role, candidates]) => { - const candidate = candidates.find( - (candidate) => !freeOnly || candidate.free, - ); - return candidate ? [[role, candidate.label]] : []; - }), - ); - +function resolveRunners({ freeOnly, required = [], roles = {} }) { + if (!roles || typeof roles !== "object" || Array.isArray(roles)) { + throw new Error( + "roles must be a JSON object mapping role names to runner labels", + ); + } + const candidatesByRole = { ...defaultRoles, ...roles }; + const runners = {}; + for (const [role, candidates] of Object.entries(candidatesByRole)) { + if (!/^[a-z][a-z0-9_]*(?:-[a-z0-9_]+)*$/.test(role)) { + throw new Error(`Invalid runner role: ${JSON.stringify(role)}`); + } + if (!Array.isArray(candidates) || candidates.length === 0) { + throw new Error(`Runner role ${role} must have at least one candidate`); + } + for (const label of candidates) { + if (!labels.has(label)) { + throw new Error( + `Unknown runner label for ${role}: ${JSON.stringify(label)}`, + ); + } + } + if (new Set(candidates).size !== candidates.length) { + throw new Error(`Runner role ${role} repeats a candidate`); + } + const selected = candidates.find( + (label) => !freeOnly || freeLabels.has(label), + ); + if (selected !== undefined) runners[role] = selected; + } for (const role of required) { - if (!Object.hasOwn(catalog, role)) { + if (!Object.hasOwn(candidatesByRole, role)) { throw new Error(`Unknown required runner role: ${role}`); } if (!Object.hasOwn(runners, role)) { @@ -96,10 +68,8 @@ function run({ env = process.env } = {}) { env.GITHUB_REPOSITORY_OWNER, ); const required = (env.INPUT_REQUIRED || "").split(/\s+/).filter(Boolean); - const catalog = JSON.parse( - fs.readFileSync(path.join(__dirname, "runners.json"), "utf8"), - ); - const runners = resolveRunners(catalog, { freeOnly, required }); + const roles = JSON.parse(env.INPUT_ROLES || "{}"); + const runners = resolveRunners({ freeOnly, required, roles }); if (!env.GITHUB_OUTPUT) { throw new Error("GITHUB_OUTPUT is required"); } @@ -110,7 +80,7 @@ function run({ env = process.env } = {}) { ); } -module.exports = { freeOnlyPolicy, resolveRunners, run, validateCatalog }; +module.exports = { freeOnlyPolicy, resolveRunners, run }; if (require.main === module) { try { diff --git a/select-runners/main.test.cjs b/select-runners/main.test.cjs index a2a162b..d55bdc5 100644 --- a/select-runners/main.test.cjs +++ b/select-runners/main.test.cjs @@ -5,30 +5,54 @@ const fs = require("node:fs"); const os = require("node:os"); const path = require("node:path"); const test = require("node:test"); -const { - freeOnlyPolicy, - resolveRunners, - run, - validateCatalog, -} = require("./main.cjs"); -const catalog = require("./runners.json"); +const { freeOnlyPolicy, resolveRunners, run } = require("./main.cjs"); +const inventory = require("./runners.json"); -test("selects the first eligible candidate for each role", () => { - const candidates = { - linux: [ - { label: "preferred", free: false }, - { label: "fallback", free: true }, - { label: "last", free: true }, - ], - specialized: [{ label: "specialized", free: false }], +test("each inventory label belongs to exactly one group", () => { + const seen = new Set(); + for (const [group, labels] of Object.entries(inventory)) { + assert.ok(Array.isArray(labels) && labels.length > 0, group); + for (const label of labels) { + assert.match(label, /^[a-z0-9][a-z0-9._-]*$/); + assert.ok(!seen.has(label), `Duplicate runner label: ${label}`); + seen.add(label); + } + } +}); + +test("selects additional provider labels and their explicit free fallbacks", () => { + const roles = { + "ubuntu-x86_64-4": ["namespace-profile-ubuntu-24-04-4", "ubuntu-24.04"], + "windows-build": ["depot-windows-2025-32", "windows-2025"], + "windows-large": ["namespace-profile-windows-2022-x86-64-32x64"], + "windows-preview": ["github-windows-11-preview-aarch64-8"], }; - assert.deepEqual(resolveRunners(candidates, { freeOnly: false }), { - linux: "preferred", - specialized: "specialized", - }); - assert.deepEqual(resolveRunners(candidates, { freeOnly: true }), { - linux: "fallback", - }); + const preferred = resolveRunners({ freeOnly: false, roles }); + assert.equal( + preferred["ubuntu-x86_64-4"], + "namespace-profile-ubuntu-24-04-4", + ); + assert.equal(preferred["windows-build"], "depot-windows-2025-32"); + assert.equal( + preferred["windows-large"], + "namespace-profile-windows-2022-x86-64-32x64", + ); + assert.equal( + preferred["windows-preview"], + "github-windows-11-preview-aarch64-8", + ); + assert.equal(preferred["ubuntu-x86_64-16"], "depot-ubuntu-24.04-16"); + + const free = resolveRunners({ freeOnly: true, roles }); + assert.equal(free["ubuntu-x86_64-4"], "ubuntu-24.04"); + assert.equal(free["windows-build"], "windows-2025"); + assert.ok(!Object.hasOwn(free, "windows-large")); + assert.ok(!Object.hasOwn(free, "windows-preview")); + assert.ok( + Object.values(free).every((label) => + inventory["github-standard"].includes(label), + ), + ); }); test("uses the workflow repository owner, including Astral forks", () => { @@ -41,79 +65,55 @@ test("uses the workflow repository owner, including Astral forks", () => { assert.throws(() => freeOnlyPolicy("yes", "astral-sh"), /true or false/); }); -test("rejects unknown and unavailable required roles before emitting outputs", () => { +test("rejects unknown and unavailable required roles", () => { assert.throws( - () => resolveRunners(catalog, { freeOnly: false, required: ["typo"] }), + () => resolveRunners({ freeOnly: false, required: ["typo"] }), /Unknown required runner role: typo/, ); assert.throws( - () => - resolveRunners(catalog, { - freeOnly: true, - required: ["ubuntu-aarch64-pgo"], - }), + () => resolveRunners({ freeOnly: true, required: ["ubuntu-aarch64-pgo"] }), /No eligible runner for required role: ubuntu-aarch64-pgo/, ); + const free = resolveRunners({ freeOnly: true }); + assert.ok(!Object.hasOwn(free, "ubuntu-x86_64-codspeed")); + assert.ok(!Object.hasOwn(free, "ubuntu-aarch64-pgo")); + assert.equal(free["ubuntu-aarch64-4"], "ubuntu-24.04-arm"); + assert.equal(free["windows-aarch64-8"], "windows-11-arm"); }); -test("the bundled free policy has no paid labels or specialized fallbacks", () => { - const runners = resolveRunners(catalog, { freeOnly: true }); - assert.equal(Object.hasOwn(runners, "ubuntu-aarch64-pgo"), false); - assert.equal(Object.hasOwn(runners, "ubuntu-x86_64-codspeed"), false); - assert.equal(runners["ubuntu-aarch64-4"], "ubuntu-24.04-arm"); - assert.equal(runners["windows-aarch64-8"], "windows-11-arm"); - for (const [role, label] of Object.entries(runners)) { - assert.ok( - catalog[role].some( - (candidate) => candidate.label === label && candidate.free, - ), - ); - } -}); - -test("validates the whole catalog even when selecting only free candidates", () => { - for (const invalid of [ +test("validates every candidate even when an earlier label is eligible", () => { + for (const roles of [ null, [], - {}, - { "invalid role": [{ label: "runner", free: true }] }, + { "invalid role": ["ubuntu-24.04"] }, { linux: [] }, - { linux: [null] }, - { linux: [{ label: "runner" }] }, - { linux: [{ label: "runner", free: true, priority: 1 }] }, - { linux: [{ label: "", free: true }] }, - { linux: [{ label: "runner\nother=value", free: false }] }, - { linux: [{ label: "runner ", free: false }] }, - { linux: [{ label: "runner", free: "false" }] }, - { - linux: [ - { label: "runner", free: true }, - { label: "runner", free: false }, - ], - }, + { linux: "ubuntu-24.04" }, + { linux: ["ubuntu-24.04", "depot-ubuntu-24.04-96"] }, + { linux: ["ubuntu-24.04", "ubuntu-24.04"] }, + { linux: [{ label: "depot-ubuntu-24.04-16", free: true }] }, ]) { - assert.throws(() => resolveRunners(invalid, { freeOnly: true })); + assert.throws(() => resolveRunners({ freeOnly: true, roles })); } - assert.equal(validateCatalog(catalog), catalog); }); -test("writes compact action outputs using the bundled catalog without a checkout", (context) => { +test("writes the resolved custom and default roles to the action outputs", (context) => { const directory = fs.mkdtempSync(path.join(os.tmpdir(), "select-runners-")); context.after(() => fs.rmSync(directory, { recursive: true, force: true })); const output = path.join(directory, "output"); + const roles = { "macos-build": ["depot-macos-26", "macos-15"] }; run({ env: { GITHUB_REPOSITORY_OWNER: "contributor", - GITHUB_REPOSITORY: "contributor/uv", GITHUB_OUTPUT: output, - INPUT_REQUIRED: "ubuntu-x86_64-16\nwindows-aarch64-8", + INPUT_ROLES: JSON.stringify(roles), + INPUT_REQUIRED: "ubuntu-x86_64-16\nmacos-build", }, }); const [runners, freeOnly, end] = fs.readFileSync(output, "utf8").split("\n"); assert.equal(freeOnly, "free-only=true"); assert.equal(end, ""); - assert.deepEqual( - JSON.parse(runners.slice("runners=".length)), - resolveRunners(catalog, { freeOnly: true }), - ); + assert.deepEqual(JSON.parse(runners.slice("runners=".length)), { + ...resolveRunners({ freeOnly: true }), + "macos-build": "macos-15", + }); }); diff --git a/select-runners/roles.json b/select-runners/roles.json new file mode 100644 index 0000000..555b9cf --- /dev/null +++ b/select-runners/roles.json @@ -0,0 +1,23 @@ +{ + "ubuntu-x86_64-2": ["github-ubuntu-24.04-x86_64-2", "ubuntu-24.04"], + "ubuntu-x86_64-2-slim": ["github-ubuntu-24.04-x86_64-2", "ubuntu-slim"], + "ubuntu-x86_64-4": ["depot-ubuntu-24.04-4", "ubuntu-24.04"], + "ubuntu-x86_64-4-github": ["github-ubuntu-24.04-x86_64-4", "ubuntu-24.04"], + "ubuntu-x86_64-8": ["depot-ubuntu-24.04-8", "ubuntu-24.04"], + "ubuntu-x86_64-8-github": ["github-ubuntu-24.04-x86_64-8", "ubuntu-24.04"], + "ubuntu-x86_64-16": ["depot-ubuntu-24.04-16", "ubuntu-24.04"], + "ubuntu-aarch64-2": ["github-ubuntu-24.04-aarch64-2", "ubuntu-24.04-arm"], + "ubuntu-aarch64-4": ["github-ubuntu-24.04-aarch64-4", "ubuntu-24.04-arm"], + "ubuntu-aarch64-pgo": ["depot-ubuntu-24.04-arm-16"], + "ubuntu-x86_64-codspeed": ["codspeed-macro-x64-ryzen-9950x-ubuntu-24-04"], + "macos-aarch64-8": ["namespace-profile-macos-15", "macos-15"], + "windows-x86_64-4": [ + "namespace-profile-windows-2022-x86-64-4", + "windows-2025" + ], + "windows-x86_64-16": [ + "namespace-profile-windows-2022-x86-64-16x32", + "windows-2025" + ], + "windows-aarch64-8": ["github-windows-11-aarch64-8", "windows-11-arm"] +} diff --git a/select-runners/runners.json b/select-runners/runners.json index d6c0c22..ac0b589 100644 --- a/select-runners/runners.json +++ b/select-runners/runners.json @@ -1,60 +1,145 @@ { - "ubuntu-x86_64-2": [ - { "label": "github-ubuntu-24.04-x86_64-2", "free": false }, - { "label": "ubuntu-24.04", "free": true } + "github-standard": [ + "ubuntu-slim", + "ubuntu-24.04", + "ubuntu-24.04-arm", + "macos-15", + "windows-2025", + "windows-11-arm" ], - "ubuntu-x86_64-2-slim": [ - { "label": "github-ubuntu-24.04-x86_64-2", "free": false }, - { "label": "ubuntu-slim", "free": true } + "github-larger": [ + "github-ubuntu-24.04-x86_64-2", + "github-ubuntu-24.04-x86_64-4", + "github-ubuntu-24.04-x86_64-8", + "github-ubuntu-24.04-x86_64-16", + "github-ubuntu-24.04-x86_64-32", + "github-ubuntu-24.04-x86_64-64", + "github-ubuntu-24.04-x86_64-96", + "github-ubuntu-24.04-aarch64-2", + "github-ubuntu-24.04-aarch64-4", + "github-ubuntu-24.04-aarch64-8", + "github-ubuntu-24.04-aarch64-16", + "github-ubuntu-24.04-aarch64-32", + "github-ubuntu-24.04-aarch64-64", + "github-windows-2025-x86_64-4", + "github-windows-2025-x86_64-8", + "github-windows-2025-x86_64-16", + "github-windows-2025-x86_64-32", + "github-windows-2025-x86_64-64", + "github-windows-2025-x86_64-96", + "github-windows-2022-x86_64-8", + "github-windows-2022-x86_64-16", + "github-windows-2022-x86_64-32", + "github-windows-2022-x86_64-64", + "github-windows-2022-x86_64-96", + "github-windows-11-aarch64-4", + "github-windows-11-aarch64-8", + "github-windows-11-aarch64-16", + "github-windows-11-aarch64-32", + "github-windows-11-aarch64-64", + "github-windows-11-vs2022-aarch64-8", + "github-windows-11-vs2022-aarch64-16", + "github-windows-11-vs2022-aarch64-32", + "github-windows-11-vs2022-aarch64-64", + "github-windows-11-vs2026-aarch64-8", + "github-windows-11-vs2026-aarch64-16", + "github-windows-11-vs2026-aarch64-32", + "github-windows-11-vs2026-aarch64-64", + "github-windows-11-preview-aarch64-8", + "ubuntu-latest-large", + "ubuntu-latest-xlarge", + "windows-latest-large", + "windows-latest-xlarge", + "windows-latest-xxlarge", + "macos-14-large", + "macos-14-xlarge", + "macos-15-large", + "macos-15-xlarge", + "macos-26-large", + "macos-26-xlarge", + "macos-latest-large", + "macos-latest-xlarge" ], - "ubuntu-x86_64-4": [ - { "label": "depot-ubuntu-24.04-4", "free": false }, - { "label": "ubuntu-24.04", "free": true } + "namespace": [ + "namespace-profile-default", + "namespace-profile-default-arm64", + "namespace-profile-macos-15", + "namespace-profile-macos-15-4x7", + "namespace-profile-macos-15-6x14", + "namespace-profile-ubuntu-22-04-arm-4", + "namespace-profile-ubuntu-22-04-arm-4-apple-silicon", + "namespace-profile-ubuntu-24-04", + "namespace-profile-ubuntu-24-04-4", + "namespace-profile-ubuntu-24-04-8", + "namespace-profile-ubuntu-24-04-16", + "namespace-profile-ubuntu-latest-4", + "namespace-profile-windows-2022-x86-64-4", + "namespace-profile-windows-2022-x86-64-4x8", + "namespace-profile-windows-2022-x86-64-8", + "namespace-profile-windows-2022-x86-64-8x16", + "namespace-profile-windows-2022-x86-64-16", + "namespace-profile-windows-2022-x86-64-16x32", + "namespace-profile-windows-2022-x86-64-32x64" ], - "ubuntu-x86_64-4-github": [ - { "label": "github-ubuntu-24.04-x86_64-4", "free": false }, - { "label": "ubuntu-24.04", "free": true } + "depot": [ + "depot-macos-14", + "depot-macos-15", + "depot-macos-26", + "depot-macos-latest", + "depot-ubuntu-22.04", + "depot-ubuntu-22.04-4", + "depot-ubuntu-22.04-8", + "depot-ubuntu-22.04-16", + "depot-ubuntu-22.04-32", + "depot-ubuntu-22.04-64", + "depot-ubuntu-22.04-arm", + "depot-ubuntu-22.04-arm-4", + "depot-ubuntu-22.04-arm-8", + "depot-ubuntu-22.04-arm-16", + "depot-ubuntu-22.04-arm-32", + "depot-ubuntu-22.04-arm-64", + "depot-ubuntu-24.04", + "depot-ubuntu-24.04-4", + "depot-ubuntu-24.04-8", + "depot-ubuntu-24.04-16", + "depot-ubuntu-24.04-32", + "depot-ubuntu-24.04-64", + "depot-ubuntu-24.04-arm", + "depot-ubuntu-24.04-arm-4", + "depot-ubuntu-24.04-arm-8", + "depot-ubuntu-24.04-arm-16", + "depot-ubuntu-24.04-arm-32", + "depot-ubuntu-24.04-arm-64", + "depot-ubuntu-latest", + "depot-ubuntu-latest-4", + "depot-ubuntu-latest-8", + "depot-ubuntu-latest-16", + "depot-ubuntu-latest-32", + "depot-ubuntu-latest-64", + "depot-ubuntu-latest-arm", + "depot-ubuntu-latest-arm-4", + "depot-ubuntu-latest-arm-8", + "depot-ubuntu-latest-arm-16", + "depot-ubuntu-latest-arm-32", + "depot-ubuntu-latest-arm-64", + "depot-windows-2022", + "depot-windows-2022-4", + "depot-windows-2022-8", + "depot-windows-2022-16", + "depot-windows-2022-32", + "depot-windows-2022-64", + "depot-windows-2025", + "depot-windows-2025-4", + "depot-windows-2025-8", + "depot-windows-2025-16", + "depot-windows-2025-32", + "depot-windows-2025-64", + "depot-windows-latest", + "depot-windows-latest-4", + "depot-windows-latest-8", + "depot-windows-latest-16", + "depot-windows-latest-32", + "depot-windows-latest-64" ], - "ubuntu-x86_64-8": [ - { "label": "depot-ubuntu-24.04-8", "free": false }, - { "label": "ubuntu-24.04", "free": true } - ], - "ubuntu-x86_64-8-github": [ - { "label": "github-ubuntu-24.04-x86_64-8", "free": false }, - { "label": "ubuntu-24.04", "free": true } - ], - "ubuntu-x86_64-16": [ - { "label": "depot-ubuntu-24.04-16", "free": false }, - { "label": "ubuntu-24.04", "free": true } - ], - "ubuntu-aarch64-2": [ - { "label": "github-ubuntu-24.04-aarch64-2", "free": false }, - { "label": "ubuntu-24.04-arm", "free": true } - ], - "ubuntu-aarch64-4": [ - { "label": "github-ubuntu-24.04-aarch64-4", "free": false }, - { "label": "ubuntu-24.04-arm", "free": true } - ], - "ubuntu-aarch64-pgo": [ - { "label": "depot-ubuntu-24.04-arm-16", "free": false } - ], - "ubuntu-x86_64-codspeed": [ - { "label": "codspeed-macro-x64-ryzen-9950x-ubuntu-24-04", "free": false } - ], - "macos-aarch64-8": [ - { "label": "namespace-profile-macos-15", "free": false }, - { "label": "macos-15", "free": true } - ], - "windows-x86_64-4": [ - { "label": "namespace-profile-windows-2022-x86-64-4", "free": false }, - { "label": "windows-2025", "free": true } - ], - "windows-x86_64-16": [ - { "label": "namespace-profile-windows-2022-x86-64-16x32", "free": false }, - { "label": "windows-2025", "free": true } - ], - "windows-aarch64-8": [ - { "label": "github-windows-11-aarch64-8", "free": false }, - { "label": "windows-11-arm", "free": true } - ] + "codspeed": ["codspeed-macro-x64-ryzen-9950x-ubuntu-24-04"] }