Skip to content

Commit 92a8416

Browse files
Nullpoint56claude
andcommitted
CI: the macOS leg is opt-in
Hosted macOS arm64 runners were unavailable for hours at a time ("not acquired by Runner of type hosted even after multiple attempts"; GitHub: capacity constraints), and every pull request waited on them. The gate now runs osx-arm64 only for a pull request labelled "macos" (adding the label starts macOS alone, in its own concurrency group, so it cancels nothing), a manual run with the macos input, and a weekly schedule on master (macOS alone). Master pushes skip it. The release still builds and smoke-tests osx-arm64. Checked locally for each event: PR without and with the label, the label added, manual with and without the input, schedule. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NvXTk6Roe4sQLHFx9Zykv8
1 parent fafd375 commit 92a8416

4 files changed

Lines changed: 78 additions & 9 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ name: ci
1111
# interop generator) start no run; regen.yml checks the interop layer when its inputs change.
1212
# - Superseded runs are cancelled. Timeouts sit a few times above the slowest measured job, so a
1313
# hang costs minutes, not an hour.
14+
# - macOS is opt-in (hosted macOS arm64 runners are often unavailable for long stretches): a pull
15+
# request labelled "macos" (adding the label runs only macOS), a manual run with the macos
16+
# input, and a weekly run on master. The release builds and tests macOS regardless.
1417

1518
on:
1619
push:
@@ -27,6 +30,7 @@ on:
2730
- "tools/coverage/**"
2831
pull_request:
2932
branches: [master] # pull requests into "next" are verified locally (AGENTS.md: Branches)
33+
types: [opened, synchronize, reopened, labeled]
3034
paths-ignore:
3135
- "**.md"
3236
- "docs/**"
@@ -38,9 +42,18 @@ on:
3842
- "tools/coverage.ps1"
3943
- "tools/coverage/**"
4044
workflow_dispatch:
41-
45+
inputs:
46+
macos:
47+
description: "Run the macOS leg too"
48+
type: boolean
49+
default: false
50+
schedule:
51+
- cron: "0 4 * * 1" # Mondays 04:00 UTC: the macOS leg on master
52+
53+
# A run started by adding the macos label must not cancel the pull request's own run, nor be
54+
# cancelled by it.
4255
concurrency:
43-
group: ci-${{ github.workflow }}-${{ github.ref }}
56+
group: ci-${{ github.workflow }}-${{ github.ref }}${{ github.event.action == 'labeled' && '-macos' || '' }}
4457
cancel-in-progress: true
4558

4659
permissions:
@@ -55,6 +68,8 @@ env:
5568
jobs:
5669
# full | warm | skip per platform, and the payload cache key; the reasoning is in the run summary.
5770
gate:
71+
# Of the label events only "macos" starts anything.
72+
if: github.event.action != 'labeled' || github.event.label.name == 'macos'
5873
runs-on: ubuntu-24.04
5974
timeout-minutes: 5
6075
permissions:
@@ -74,6 +89,10 @@ jobs:
7489
shell: pwsh
7590
env:
7691
GH_TOKEN: ${{ github.token }}
92+
GATE_ACTION: ${{ github.event.action }}
93+
GATE_LABEL: ${{ github.event.label.name }}
94+
GATE_PR_LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }}
95+
GATE_MACOS: ${{ inputs.macos }}
7796
run: ./tools/ci/ci-gate.ps1
7897

7998
win-x64:

‎AGENTS.md‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ have no intermittent failures. Both were test defects, not driver bugs.
13731373
layer crashed). Fixed by `VulkanApi.cs`; the minidump and "Crash stacks" CI steps stay.
13741374

13751375
- `.github/workflows/ci.yml`: `gate` (Linux, seconds), then `win-x64` (WARP + NONE), `linux-x64`
1376-
(lavapipe, stock 1.3 loader, 1.4.363 layer, `ubuntu-24.04`), `osx-arm64` (MoltenVK). `regen.yml`
1376+
(lavapipe, stock 1.3 loader, 1.4.363 layer, `ubuntu-24.04`), `osx-arm64` (MoltenVK; opt-in, below). `regen.yml`
13771377
is the ClangSharp drift check, run only when `nri`, `patches/`, the generator, `dotnet/Native/` or
13781378
the pin change (prints the first 120 diff lines on drift). `coverage.yml` runs `tools/coverage.ps1
13791379
-Check` (Coverage).
@@ -1391,7 +1391,14 @@ have no intermittent failures. Both were test defects, not driver bugs.
13911391
Hosted minutes are limited and billed per job, rounded up; a macOS minute costs about ten Linux
13921392
minutes and a Windows minute about two. That shapes the runs:
13931393

1394-
- **`gate`** (`tools/ci/ci-gate.ps1`): pull requests and manual runs test everything. A push to
1394+
- **macOS is opt-in** (owner, 2026-11-04): hosted macOS arm64 runners were unavailable for hours at a
1395+
time ("The job was not acquired by Runner of type hosted even after multiple attempts"; GitHub's
1396+
annotation: "Due to capacity constraints, jobs targeting macOS arm64 runners may experience
1397+
longer queue times"). The gate runs `osx-arm64` for a pull request labelled `macos` (adding the
1398+
label starts a run of macOS alone, in its own concurrency group), a manual run with the `macos`
1399+
input, and the weekly schedule (Mondays 04:00 UTC, macOS alone, on master); never on master
1400+
pushes. The release builds and smoke-tests osx-arm64 regardless, re-run until a Mac picks it up.
1401+
- **`gate`** (`tools/ci/ci-gate.ps1`): pull requests and manual runs test everything but macOS (above). A push to
13951402
master whose tree equals the head of a merged pull request that passed CI as a `pull_request` run
13961403
is not tested again; a platform then only builds and caches the payload when master has no cache
13971404
for its key (a pull request's own caches are visible to it alone). A direct push, a merge of a

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Windows x64, Linux x64, macOS arm64. On macOS the binding is Vulkan through Molt
1919
backend is not built, only the Base package exists, the application provides the Vulkan loader and
2020
MoltenVK, and the library needs macOS 15 or newer (.NET 11's floor).
2121

22-
CI builds the native library from the pinned tag and the patch set on all three platforms and runs
23-
the suite with NRI's validation and the backend validation layer on: D3D12 on WARP, Vulkan on
24-
lavapipe and MoltenVK, NONE everywhere. A separate workflow regenerates the interop layer when the
22+
CI builds the native library from the pinned tag and the patch set and runs the suite with NRI's
23+
validation and the backend validation layer on: D3D12 on WARP, Vulkan on lavapipe, NONE everywhere,
24+
and on macOS (Vulkan on MoltenVK) weekly, on request and for every release. A separate workflow regenerates the interop layer when the
2525
headers, patches or generator change, and fails on drift. Windows is also verified on NVIDIA
2626
hardware.
2727

‎tools/ci/ci-gate.ps1‎

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@
1212
warm native payload built and saved to the cache, nothing else
1313
skip the job does not run
1414
15-
pull_request and workflow_dispatch: every job is full.
15+
pull_request and workflow_dispatch: every job is full, except macOS (below).
16+
17+
macOS is opt-in: hosted macOS arm64 runners are often unavailable for long stretches, and a
18+
macOS minute costs about ten Linux minutes. osx is full for a pull request labelled "macos",
19+
for the "macos" label being added (then win and linux skip: that head ran already), for a
20+
manual run with the macos input, and for the weekly schedule (then win and linux skip: every
21+
pull request runs them). Pushes to master skip it. The release builds and tests macOS itself.
1622
1723
push to master: when the pushed commit is the merge of a pull request whose head has the
1824
same tree and passed ci as a pull_request run, that tree has been tested; running the suite
@@ -29,7 +35,11 @@ param(
2935
[string]$EventName = $env:GITHUB_EVENT_NAME,
3036
[string]$Sha = $env:GITHUB_SHA,
3137
[string]$Repository = $env:GITHUB_REPOSITORY,
32-
[string]$Token = $env:GH_TOKEN
38+
[string]$Token = $env:GH_TOKEN,
39+
[string]$Action = $env:GATE_ACTION, # github.event.action
40+
[string]$Label = $env:GATE_LABEL, # github.event.label.name, for "labeled"
41+
[string]$PullRequestLabels = $env:GATE_PR_LABELS, # JSON array of the pull request's label names
42+
[string]$MacOSInput = $env:GATE_MACOS # workflow_dispatch input "macos"
3343
)
3444

3545
$ErrorActionPreference = 'Stop'
@@ -91,6 +101,39 @@ if ($EventName -eq 'push') {
91101
}
92102
}
93103

104+
# ------------------------------------------------------------------------------ macOS, opt-in
105+
$labels = @()
106+
if ($PullRequestLabels) { try { $labels = @($PullRequestLabels | ConvertFrom-Json) } catch { $labels = @() } }
107+
switch ($EventName) {
108+
'pull_request' {
109+
if ($Action -eq 'labeled') {
110+
$modes.win = 'skip'; $modes.linux = 'skip'; $modes.osx = 'full'
111+
$reason = "the macos label was added: macOS runs; Windows and Linux ran on this head already."
112+
}
113+
elseif ($labels -contains 'macos') {
114+
$reason += " The pull request is labelled macos: macOS runs too."
115+
}
116+
else {
117+
$modes.osx = 'skip'
118+
$reason = "$EventName event: Windows and Linux run; macOS is opt-in (label the pull request macos)."
119+
}
120+
}
121+
'workflow_dispatch' {
122+
if ($MacOSInput -ne 'true') {
123+
$modes.osx = 'skip'
124+
$reason = "$EventName event: Windows and Linux run; macOS only with the macos input."
125+
}
126+
}
127+
'schedule' {
128+
$modes.win = 'skip'; $modes.linux = 'skip'; $modes.osx = 'full'
129+
$reason = "weekly schedule: macOS runs on master; Windows and Linux run on every pull request."
130+
}
131+
'push' {
132+
$modes.osx = 'skip'
133+
$reason += " macOS is opt-in and skips on master pushes."
134+
}
135+
}
136+
94137
# ------------------------------------------------------------------------------ outputs
95138
$lines = @("key=$key") + @($modes.Keys | ForEach-Object { "$_=$($modes[$_])" })
96139
$summary = @("### ci gate", "", $reason, "", "| Job | Mode | Payload cache key |", "|---|---|---|") +

0 commit comments

Comments
 (0)