ci.yml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822
  1. name: CI
  2. on:
  3. push:
  4. branches: [master]
  5. pull_request:
  6. workflow_dispatch:
  7. inputs:
  8. suite:
  9. description: Manual CI suite to run
  10. required: true
  11. default: larger-runner-benchmark
  12. type: choice
  13. options:
  14. - larger-runner-benchmark
  15. - consolidated-runner-benchmark
  16. concurrency:
  17. group: ${{ github.workflow }}-${{ github.ref }}
  18. cancel-in-progress: true
  19. permissions:
  20. contents: read
  21. env:
  22. PRIMARY_NODE_VERSION: '24'
  23. jobs:
  24. # Three enterprise jobs isolate coverage, static analysis, and the
  25. # build-backed consumer tail. The static job publishes its exact build so
  26. # consumers do not repeat the longest part of their critical path.
  27. #
  28. # FAILOVER: each Linux enterprise job resolves its pool through the
  29. # DSH_CI_FAILOVER repository variable. Unset (normal), the expressions
  30. # pick the hosted enterprise pools below. Setting the variable to
  31. # 'selfhosted' (repo Settings → Actions → Variables; writer-manageable
  32. # repository state — not PR-editable, no merge required) retargets all
  33. # three onto the in-house
  34. # vm-backup pool and re-running the failed jobs is the entire switch —
  35. # see .agents/notes/implemented/process/2026-07-26-ci-failover-runbook.md. The
  36. # in-house pool's readiness is re-proven on every master push by the
  37. # serial-linux-selfhosted standby lane below.
  38. node-24:
  39. if: github.event_name == 'pull_request'
  40. runs-on: >-
  41. ${{ vars.DSH_CI_FAILOVER == 'selfhosted'
  42. && github.event.pull_request.user.login != 'dependabot[bot]'
  43. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  44. || 'dsh-enterprise-ubuntu-latest-32core-test' }}
  45. name: node 24 / static
  46. env:
  47. DSH_GATE_CONCURRENCY: '8'
  48. steps:
  49. # Fetch complete history so the archive gate can read the trusted PR base from a reused shallow checkout.
  50. - uses: actions/checkout@v6
  51. with:
  52. fetch-depth: 0
  53. persist-credentials: false
  54. - uses: pnpm/action-setup@v4
  55. with:
  56. dest: ${{ runner.temp }}/setup-pnpm
  57. - uses: actions/setup-node@v6
  58. with:
  59. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  60. - name: Configure pnpm store path
  61. id: pnpm-store
  62. run: |
  63. store_root="$HOME/.local/share/pnpm/store"
  64. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  65. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  66. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  67. # Pull requests consume the default-branch cache but do not put cache
  68. # compression and upload on the paid latency-critical path. Skipped
  69. # under failover — see the coverage lane's identical rationale.
  70. - uses: actions/cache/restore@v4
  71. if: vars.DSH_CI_FAILOVER != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
  72. with:
  73. path: ${{ steps.pnpm-store.outputs.path }}
  74. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  75. restore-keys: |
  76. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  77. - name: Install (immutable)
  78. run: pnpm install --frozen-lockfile
  79. - name: Run static gates
  80. env:
  81. DSH_ARCHIVE_BASE_REF: ${{ github.event.pull_request.base.sha }}
  82. run: pnpm run check:ci:static
  83. - name: Pack built tree
  84. run: >-
  85. tar -czf "$RUNNER_TEMP/node-24-built-tree.tar.gz"
  86. apps/*/lib packages/*/*/lib vendor/*/lib
  87. - uses: actions/upload-artifact@v7
  88. with:
  89. name: node-24-built-tree
  90. path: ${{ runner.temp }}/node-24-built-tree.tar.gz
  91. if-no-files-found: error
  92. retention-days: 1
  93. compression-level: 0
  94. node-24-coverage:
  95. if: github.event_name == 'pull_request'
  96. runs-on: >-
  97. ${{ vars.DSH_CI_FAILOVER == 'selfhosted'
  98. && github.event.pull_request.user.login != 'dependabot[bot]'
  99. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  100. || 'dsh-enterprise-ubuntu-24-04-32core-test' }}
  101. name: node 24 / coverage
  102. env:
  103. # Failover shrinks the worker bound: the hosted 32-core runner is
  104. # exclusive to one job, but the failover pool shares one 64-core VM
  105. # across six always-on runner instances, and the timing-sensitive
  106. # process suites have documented aggregate-contention failures.
  107. # 8 × 6 instances = 48 workers worst case on 64 cores.
  108. DSH_COVERAGE_MAX_WORKERS: ${{ vars.DSH_CI_FAILOVER == 'selfhosted' && github.event.pull_request.user.login != 'dependabot[bot]' && '8' || '24' }}
  109. DSH_GATE_CONCURRENCY: '8'
  110. steps:
  111. - uses: actions/checkout@v6
  112. with:
  113. persist-credentials: false
  114. - uses: pnpm/action-setup@v4
  115. with:
  116. dest: ${{ runner.temp }}/setup-pnpm
  117. - uses: actions/setup-node@v6
  118. with:
  119. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  120. - name: Configure pnpm store path
  121. id: pnpm-store
  122. run: |
  123. store_root="$HOME/.local/share/pnpm/store"
  124. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  125. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  126. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  127. # Skipped under failover: the self-hosted VM's persistent pnpm store
  128. # already serves warm installs, while restoring the hosted archive
  129. # would spend ~52 s pulling ~180 MB into that populated store.
  130. - uses: actions/cache/restore@v4
  131. if: vars.DSH_CI_FAILOVER != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
  132. with:
  133. path: ${{ steps.pnpm-store.outputs.path }}
  134. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  135. restore-keys: |
  136. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  137. - name: Install dependencies and prepare bubblewrap
  138. run: |
  139. pnpm install --frozen-lockfile &
  140. install_pid=$!
  141. bash scripts/prepare-ci-bubblewrap.sh &
  142. sandbox_pid=$!
  143. install_status=0
  144. wait "$install_pid" || install_status=$?
  145. sandbox_status=0
  146. wait "$sandbox_pid" || sandbox_status=$?
  147. if (( install_status != 0 )); then exit "$install_status"; fi
  148. exit "$sandbox_status"
  149. - name: Run exhaustive coverage
  150. run: pnpm run check:ci:coverage
  151. node-24-consumers:
  152. needs: node-24
  153. if: github.event_name == 'pull_request'
  154. runs-on: >-
  155. ${{ vars.DSH_CI_FAILOVER == 'selfhosted'
  156. && github.event.pull_request.user.login != 'dependabot[bot]'
  157. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  158. || 'dsh-enterprise-ubuntu-latest-32core-test' }}
  159. name: node 24 / snapshots and artifacts
  160. env:
  161. DSH_GATE_CONCURRENCY: '8'
  162. DSH_NODE_COMPAT_SKIP_TYPECHECK: '1'
  163. DSH_OXLINT_THREADS: '8'
  164. DSH_PUBLINT_CONCURRENCY: '8'
  165. # Failover halves snapshot concurrency for the shared 64-core VM.
  166. DSH_SNAPSHOT_MAX_CONCURRENCY: ${{ vars.DSH_CI_FAILOVER == 'selfhosted' && github.event.pull_request.user.login != 'dependabot[bot]' && '12' || '32' }}
  167. steps:
  168. - uses: actions/checkout@v6
  169. with:
  170. persist-credentials: false
  171. - uses: actions/download-artifact@v8
  172. with:
  173. name: node-24-built-tree
  174. path: ${{ runner.temp }}
  175. - name: Restore built tree
  176. run: tar -xzf "$RUNNER_TEMP/node-24-built-tree.tar.gz"
  177. - uses: pnpm/action-setup@v4
  178. with:
  179. dest: ${{ runner.temp }}/setup-pnpm
  180. - uses: actions/setup-node@v6
  181. with:
  182. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  183. - name: Configure pnpm store path
  184. id: pnpm-store
  185. run: |
  186. store_root="$HOME/.local/share/pnpm/store"
  187. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  188. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  189. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  190. # Skipped under failover — see the coverage lane's identical rationale.
  191. - uses: actions/cache/restore@v4
  192. if: vars.DSH_CI_FAILOVER != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
  193. with:
  194. path: ${{ steps.pnpm-store.outputs.path }}
  195. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  196. restore-keys: |
  197. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  198. - name: Install dependencies and prepare bubblewrap
  199. run: |
  200. pnpm install --frozen-lockfile &
  201. install_pid=$!
  202. bash scripts/prepare-ci-bubblewrap.sh &
  203. sandbox_pid=$!
  204. install_status=0
  205. wait "$install_pid" || install_status=$?
  206. sandbox_status=0
  207. wait "$sandbox_pid" || sandbox_status=$?
  208. if (( install_status != 0 )); then exit "$install_status"; fi
  209. exit "$sandbox_status"
  210. - name: Run compatibility, snapshot, and artifact gates
  211. run: pnpm run check:ci:consumers
  212. node-compat:
  213. if: github.event_name == 'pull_request'
  214. # Each compatibility contract receives an independent standard hosted job.
  215. runs-on: ${{ matrix.runner }}
  216. name: ${{ matrix.name }}
  217. env:
  218. DSH_GATE_CONCURRENCY: ${{ matrix.gate_concurrency }}
  219. DSH_NODE_COMPAT_SKIP_TYPECHECK: '1'
  220. strategy:
  221. fail-fast: false
  222. matrix:
  223. include:
  224. - node: '22.19'
  225. name: node 22.19
  226. runner: ubuntu-latest
  227. gate_concurrency: '1'
  228. - node: 26
  229. name: node 26
  230. runner: ubuntu-latest
  231. gate_concurrency: '1'
  232. steps:
  233. - uses: actions/checkout@v6
  234. - uses: pnpm/action-setup@v4
  235. with:
  236. dest: ${{ runner.temp }}/setup-pnpm
  237. - uses: actions/setup-node@v6
  238. with:
  239. node-version: ${{ matrix.node }}
  240. cache: pnpm
  241. - name: Install (immutable)
  242. run: pnpm install --frozen-lockfile
  243. - name: Run compatibility smokes
  244. run: pnpm run check:node-compat
  245. python-sdk:
  246. if: github.event_name == 'pull_request'
  247. runs-on: ubuntu-latest
  248. name: python 3.10 / keyless SDK
  249. steps:
  250. - uses: actions/checkout@v6
  251. - uses: actions/setup-python@v6.3.0
  252. with:
  253. python-version: '3.10'
  254. cache: pip
  255. - name: Install uv
  256. run: python -m pip install uv==0.11.23
  257. - name: Run complete keyless Python suite
  258. run: uv run --python 3.10 --group test --project python/sdk pytest
  259. # The required pull-request Windows signal: the two blocking win32 surfaces
  260. # (workspace build, production site) execute with real, checksum-verified
  261. # Windows Node under Wine on standard hosted Linux. The master
  262. # serial-windows job below keeps the complete native-kernel inventory —
  263. # including the observational portability gates this lane does not run —
  264. # on real windows-2025. This job only provisions runner state (caches,
  265. # apt); scripts/wine-windows-gates.sh owns the gate logic and is the same
  266. # script the optional local gate `pnpm run check:windows-wine` runs.
  267. # Layout, fidelity limits, and measured timings live in
  268. # .agents/notes/implemented/process/2026-07-27-wine-windows-gates-experiment.md
  269. windows:
  270. if: github.event_name == 'pull_request'
  271. runs-on: ubuntu-latest
  272. name: windows node 24 / wine blocking
  273. timeout-minutes: 15
  274. steps:
  275. - uses: actions/checkout@v6
  276. with:
  277. persist-credentials: false
  278. - uses: pnpm/action-setup@v4
  279. with:
  280. dest: ${{ runner.temp }}/setup-pnpm
  281. - uses: actions/setup-node@v6
  282. with:
  283. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  284. - name: Configure pnpm store path
  285. id: pnpm-store
  286. run: |
  287. store_root="$HOME/.local/share/pnpm/store"
  288. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  289. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  290. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  291. - uses: actions/cache/restore@v4
  292. with:
  293. path: ${{ steps.pnpm-store.outputs.path }}
  294. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  295. restore-keys: |
  296. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  297. # Master's wine-apt-cache job seeds the default-branch scope every pull
  298. # request can read; a save from this job only reaches reruns of the
  299. # same merge ref.
  300. - name: Compose Wine apt cache key
  301. id: wine-cache-key
  302. run: echo "key=wine-debs-${ImageOS:-linux}-${ImageVersion:-v0}" >> "$GITHUB_OUTPUT"
  303. - uses: actions/cache@v4
  304. with:
  305. path: ~/wine-debs
  306. key: ${{ steps.wine-cache-key.outputs.key }}
  307. # Runner provisioning only — a developer machine installs Wine through
  308. # its own package manager; the gate script assumes a wine binary and
  309. # fails loud without one. Wine from the apt cache when present; else
  310. # download the full dependency closure once and keep it for the next
  311. # run. The `wine` dispatcher package (not bare `wine64`) is what puts a
  312. # binary on PATH.
  313. - name: Install Wine
  314. run: |
  315. if compgen -G "$HOME/wine-debs/*.deb" > /dev/null; then
  316. sudo apt-get install -y --no-install-recommends "$HOME"/wine-debs/*.deb
  317. else
  318. sudo apt-get update
  319. sudo apt-get install -y --no-install-recommends --download-only wine
  320. mkdir -p "$HOME/wine-debs"
  321. cp /var/cache/apt/archives/*.deb "$HOME/wine-debs/" 2>/dev/null || true
  322. sudo apt-get install -y --no-install-recommends wine
  323. fi
  324. - name: Run the Wine Windows gates
  325. run: bash scripts/wine-windows-gates.sh
  326. - name: Shut down wineserver
  327. if: always()
  328. run: wineserver -k 2>/dev/null || true
  329. # Master seeds the Wine apt-archive cache in the default-branch scope,
  330. # which every pull request's windows job can restore; saves from
  331. # pull-request runs are scoped to their own merge ref and help nobody
  332. # else. Runs in seconds when the image version already has a cache.
  333. wine-apt-cache:
  334. if: github.event_name == 'push' && github.ref == 'refs/heads/master'
  335. name: wine apt cache
  336. runs-on: ubuntu-latest
  337. timeout-minutes: 10
  338. steps:
  339. - name: Compose Wine apt cache key
  340. id: wine-cache-key
  341. run: echo "key=wine-debs-${ImageOS:-linux}-${ImageVersion:-v0}" >> "$GITHUB_OUTPUT"
  342. - uses: actions/cache@v4
  343. id: wine-cache
  344. with:
  345. path: ~/wine-debs
  346. key: ${{ steps.wine-cache-key.outputs.key }}
  347. - name: Download the Wine dependency closure
  348. if: steps.wine-cache.outputs.cache-hit != 'true'
  349. run: |
  350. sudo apt-get update
  351. sudo apt-get install -y --no-install-recommends --download-only wine
  352. mkdir -p "$HOME/wine-debs"
  353. cp /var/cache/apt/archives/*.deb "$HOME/wine-debs/"
  354. du -sh "$HOME/wine-debs"
  355. # Master pushes run only the serial reference jobs below.
  356. # Each host executes the complete, unsharded primary Node aggregate with one
  357. # gate worker, giving reviewers a simple cross-platform oracle for completeness
  358. # and timing.
  359. serial-linux:
  360. if: github.event_name == 'push' && github.ref == 'refs/heads/master'
  361. name: serial / linux
  362. runs-on: ubuntu-latest
  363. steps:
  364. - uses: actions/checkout@v6
  365. with:
  366. fetch-depth: 2
  367. - uses: pnpm/action-setup@v4
  368. with:
  369. dest: ${{ runner.temp }}/setup-pnpm
  370. - uses: actions/setup-node@v6
  371. with:
  372. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  373. - name: Configure pnpm store path
  374. id: pnpm-store
  375. run: |
  376. store_root="$HOME/.local/share/pnpm/store"
  377. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  378. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  379. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  380. # Master refreshes the pnpm store cache that pull requests restore without saving.
  381. # The store cache stays a hand-rolled actions/cache step rather than
  382. # setup-node's `cache: pnpm`: the enterprise pull-request jobs above
  383. # restore exactly this key and path, and setup-node's built-in cache
  384. # uses its own key format — converting this producer would silently
  385. # starve their documented restore-only optimization.
  386. - uses: actions/cache@v4
  387. with:
  388. path: ${{ steps.pnpm-store.outputs.path }}
  389. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  390. restore-keys: |
  391. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  392. - name: Install (immutable)
  393. run: pnpm install --frozen-lockfile
  394. - name: Prepare bubblewrap (unrestrict userns)
  395. run: bash scripts/prepare-ci-bubblewrap.sh
  396. - name: Run complete unsharded primary Node CI serially
  397. env:
  398. DSH_ARCHIVE_BASE_REF: ${{ github.event.before }}
  399. DSH_COVERAGE_MAX_WORKERS: '1'
  400. DSH_E2E_MAX_WORKERS: '1'
  401. DSH_GATE_CONCURRENCY: '1'
  402. DSH_OXLINT_THREADS: '1'
  403. DSH_PUBLINT_CONCURRENCY: '1'
  404. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  405. run: pnpm run check:ci
  406. # Hot-standby drill for the in-house self-hosted pool: every master move
  407. # re-runs the complete unsharded aggregate on the persistent 64-core VM,
  408. # continuously proving that environment can take over a required lane if
  409. # the hosted pools degrade (the switch is then setting the writer-manageable
  410. # DSH_CI_FAILOVER variable — see the failover runbook, no merge required).
  411. # Push-triggered, so this lane always executes the base branch's own
  412. # workflow definition. (Under failover, pull_request jobs do reach these
  413. # runners with the PR merge ref's workflow — the boundary there is
  414. # repository membership: private, forking disabled, Dependabot excluded.)
  415. # Non-blocking for
  416. # pull requests; no cache steps because the VM's persistent pnpm store and
  417. # tool caches make them redundant (and saving here would poison the hosted
  418. # cache namespace with self-hosted paths).
  419. serial-linux-selfhosted:
  420. if: github.event_name == 'push' && github.ref == 'refs/heads/master'
  421. name: serial / linux (self-hosted standby)
  422. runs-on: [self-hosted, linux, x64, vm-backup]
  423. steps:
  424. # Full history + DSH_ARCHIVE_BASE_REF below: same frozen-archive
  425. # comparison as serial-linux. Depth 2 would miss github.event.before
  426. # on multi-commit or force pushes; full fetch is cheap here because
  427. # checkout resolves against the VM's local mirror.
  428. - uses: actions/checkout@v6
  429. with:
  430. fetch-depth: 0
  431. - uses: pnpm/action-setup@v4
  432. with:
  433. dest: ${{ runner.temp }}/setup-pnpm
  434. - uses: actions/setup-node@v6
  435. with:
  436. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  437. - name: Configure persistent pnpm store
  438. run: echo "PNPM_CONFIG_STORE_DIR=$HOME/.local/share/pnpm/store" >> "$GITHUB_ENV"
  439. - name: Install (immutable)
  440. run: pnpm install --frozen-lockfile
  441. - name: Prepare bubblewrap (unrestrict userns)
  442. run: bash scripts/prepare-ci-bubblewrap.sh
  443. - name: Run complete unsharded primary Node CI serially
  444. env:
  445. DSH_ARCHIVE_BASE_REF: ${{ github.event.before }}
  446. DSH_COVERAGE_MAX_WORKERS: '1'
  447. DSH_E2E_MAX_WORKERS: '1'
  448. DSH_GATE_CONCURRENCY: '1'
  449. DSH_OXLINT_THREADS: '1'
  450. DSH_PUBLINT_CONCURRENCY: '1'
  451. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  452. run: pnpm run check:ci
  453. serial-macos:
  454. if: github.event_name == 'push' && github.ref == 'refs/heads/master'
  455. name: serial / macos
  456. runs-on: macos-latest
  457. steps:
  458. - uses: actions/checkout@v6
  459. - uses: pnpm/action-setup@v4
  460. with:
  461. dest: ${{ runner.temp }}/setup-pnpm
  462. - uses: actions/setup-node@v6
  463. with:
  464. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  465. - name: Install (immutable)
  466. run: pnpm install --frozen-lockfile
  467. - name: Run complete unsharded primary Node CI serially
  468. env:
  469. DSH_COVERAGE_MAX_WORKERS: '1'
  470. DSH_E2E_MAX_WORKERS: '1'
  471. DSH_GATE_CONCURRENCY: '1'
  472. DSH_PUBLINT_CONCURRENCY: '1'
  473. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  474. run: pnpm run check:ci
  475. serial-windows:
  476. if: github.event_name == 'push' && github.ref == 'refs/heads/master'
  477. name: serial / windows
  478. runs-on: windows-2025
  479. steps:
  480. - uses: actions/checkout@v6
  481. - name: Enable Developer Mode (symlink support)
  482. shell: pwsh
  483. run: >-
  484. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
  485. /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
  486. - uses: pnpm/action-setup@v4
  487. with:
  488. dest: ${{ runner.temp }}/setup-pnpm
  489. - uses: actions/setup-node@v6
  490. with:
  491. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  492. - name: Install (immutable)
  493. shell: pwsh
  494. run: pnpm install --frozen-lockfile
  495. - name: Run complete unsharded primary Node CI serially
  496. shell: pwsh
  497. env:
  498. DSH_COVERAGE_MAX_WORKERS: '1'
  499. DSH_E2E_MAX_WORKERS: '1'
  500. DSH_GATE_CONCURRENCY: '1'
  501. DSH_OXLINT_THREADS: '1'
  502. DSH_PUBLINT_CONCURRENCY: '1'
  503. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  504. run: pnpm run check:ci
  505. # Manual, bounded comparison of the actual critical Linux and Windows lanes.
  506. # The named pools are restricted at the organization level to this repository.
  507. larger-runner-benchmark:
  508. if: github.event_name == 'workflow_dispatch' && inputs.suite == 'larger-runner-benchmark'
  509. runs-on: ${{ matrix.runner }}
  510. timeout-minutes: 15
  511. strategy:
  512. fail-fast: false
  513. max-parallel: 12
  514. matrix:
  515. include:
  516. - platform: linux
  517. cores: '4'
  518. runner: dsh-ubuntu-24-04-4core
  519. workload: typecheck
  520. - platform: linux
  521. cores: '8'
  522. runner: dsh-ubuntu-24-04-8core
  523. workload: typecheck
  524. - platform: linux
  525. cores: '16'
  526. runner: dsh-ubuntu-24-04-16core
  527. workload: typecheck
  528. - platform: linux
  529. cores: '32'
  530. runner: dsh-ubuntu-24-04-32core
  531. workload: typecheck
  532. - platform: linux
  533. cores: '64'
  534. runner: dsh-ubuntu-24-04-64core
  535. workload: typecheck
  536. - platform: linux
  537. cores: '96'
  538. runner: dsh-ubuntu-24-04-96core
  539. workload: typecheck
  540. - platform: windows
  541. cores: '4'
  542. runner: dsh-windows-2025-4core
  543. workload: production-site
  544. - platform: windows
  545. cores: '8'
  546. runner: dsh-windows-2025-8core
  547. workload: production-site
  548. - platform: windows
  549. cores: '16'
  550. runner: dsh-windows-2025-16core
  551. workload: production-site
  552. - platform: windows
  553. cores: '32'
  554. runner: dsh-windows-2025-32core
  555. workload: production-site
  556. - platform: windows
  557. cores: '64'
  558. runner: dsh-windows-2025-64core
  559. workload: production-site
  560. - platform: windows
  561. cores: '96'
  562. runner: dsh-windows-2025-96core
  563. workload: production-site
  564. steps:
  565. - uses: actions/checkout@v6
  566. - uses: pnpm/action-setup@v4
  567. with:
  568. dest: ${{ runner.temp }}/setup-pnpm
  569. # The Windows lanes deliberately skip the store cache like the required
  570. # windows job; an empty cache input disables setup-node's caching.
  571. - uses: actions/setup-node@v6
  572. with:
  573. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  574. cache: ${{ matrix.platform == 'linux' && 'pnpm' || '' }}
  575. - name: Report runner capacity
  576. run: >-
  577. node -e "const os = require('node:os');
  578. console.log(JSON.stringify({ arch: process.arch, cpus: os.cpus().length,
  579. memoryGiB: Math.round(os.totalmem() / 2 ** 30) }))"
  580. - name: Install (immutable)
  581. run: pnpm install --frozen-lockfile
  582. - name: Run critical Linux typecheck lane
  583. if: matrix.platform == 'linux'
  584. run: pnpm run typecheck
  585. - name: Run critical Windows production-site lane
  586. if: matrix.platform == 'windows'
  587. run: pnpm run docs:build
  588. # Manual comparison of the intended low-fanout topology. Linux runs the
  589. # complete unsharded primary aggregate with bounded in-runner parallelism;
  590. # Windows runs both blocking build surfaces concurrently through run-gates.
  591. consolidated-runner-benchmark:
  592. if: github.event_name == 'workflow_dispatch' && inputs.suite == 'consolidated-runner-benchmark'
  593. runs-on: ${{ matrix.runner }}
  594. timeout-minutes: 15
  595. strategy:
  596. fail-fast: false
  597. max-parallel: 12
  598. matrix:
  599. include:
  600. - platform: linux
  601. cores: '4'
  602. runner: dsh-ubuntu-24-04-4core
  603. workers: '4'
  604. - platform: linux
  605. cores: '8'
  606. runner: dsh-ubuntu-24-04-8core
  607. workers: '8'
  608. - platform: linux
  609. cores: '16'
  610. runner: dsh-ubuntu-24-04-16core
  611. workers: '16'
  612. - platform: linux
  613. cores: '32'
  614. runner: dsh-ubuntu-24-04-32core
  615. workers: '32'
  616. - platform: linux
  617. cores: '64'
  618. runner: dsh-ubuntu-24-04-64core
  619. workers: '32'
  620. - platform: linux
  621. cores: '96'
  622. runner: dsh-ubuntu-24-04-96core
  623. workers: '32'
  624. - platform: windows
  625. cores: '4'
  626. runner: dsh-windows-2025-4core
  627. workers: '2'
  628. - platform: windows
  629. cores: '8'
  630. runner: dsh-windows-2025-8core
  631. workers: '2'
  632. - platform: windows
  633. cores: '16'
  634. runner: dsh-windows-2025-16core
  635. workers: '2'
  636. - platform: windows
  637. cores: '32'
  638. runner: dsh-windows-2025-32core
  639. workers: '2'
  640. - platform: windows
  641. cores: '64'
  642. runner: dsh-windows-2025-64core
  643. workers: '2'
  644. - platform: windows
  645. cores: '96'
  646. runner: dsh-windows-2025-96core
  647. workers: '2'
  648. steps:
  649. - uses: actions/checkout@v6
  650. - uses: pnpm/action-setup@v4
  651. with:
  652. dest: ${{ runner.temp }}/setup-pnpm
  653. # Unlike the larger-runner suite, both platforms cache the store here:
  654. # the consolidated topology measures cache mechanics as workload.
  655. - uses: actions/setup-node@v6
  656. with:
  657. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  658. cache: pnpm
  659. - name: Report runner capacity
  660. run: >-
  661. node -e "const os = require('node:os');
  662. console.log(JSON.stringify({ arch: process.arch, cpus: os.cpus().length,
  663. memoryGiB: Math.round(os.totalmem() / 2 ** 30) }))"
  664. - name: Install and prepare Linux
  665. if: matrix.platform == 'linux'
  666. run: |
  667. pnpm install --frozen-lockfile &
  668. install_pid=$!
  669. bash scripts/prepare-ci-bubblewrap.sh &
  670. sandbox_pid=$!
  671. install_status=0
  672. wait "$install_pid" || install_status=$?
  673. sandbox_status=0
  674. wait "$sandbox_pid" || sandbox_status=$?
  675. if (( install_status != 0 )); then exit "$install_status"; fi
  676. exit "$sandbox_status"
  677. - name: Install (immutable)
  678. if: matrix.platform == 'windows'
  679. shell: pwsh
  680. run: pnpm install --frozen-lockfile
  681. - name: Run complete unsharded primary Node CI concurrently
  682. if: matrix.platform == 'linux'
  683. env:
  684. DSH_COVERAGE_MAX_WORKERS: ${{ matrix.workers }}
  685. DSH_GATE_CONCURRENCY: ${{ matrix.workers }}
  686. DSH_OXLINT_THREADS: ${{ matrix.workers }}
  687. DSH_PUBLINT_CONCURRENCY: ${{ matrix.workers }}
  688. DSH_SNAPSHOT_MAX_CONCURRENCY: ${{ matrix.workers }}
  689. run: pnpm run check:ci
  690. - name: Run blocking Windows builds concurrently
  691. if: matrix.platform == 'windows'
  692. shell: pwsh
  693. env:
  694. DSH_GATE_CONCURRENCY: ${{ matrix.workers }}
  695. run: pnpm run check:ci:windows-blocking
  696. # Single stable required check for branch protection: require "all checks
  697. # passed" instead of enumerating matrix legs whose names change as lanes and
  698. # node versions evolve. Every blocking job in THIS workflow must be listed in
  699. # `needs`; observational Windows gates share the required Windows job but are
  700. # marked non-blocking inside run-gates. (`needs` cannot reach across workflow
  701. # files; e2e.yml stays its own check.)
  702. # `if: always()` is load-bearing: without it a failed dependency
  703. # would SKIP this job, and GitHub counts a skipped required check as passing
  704. # — so this job always runs and fails on any non-success result, including
  705. # 'cancelled' and 'skipped'.
  706. all-checks-passed:
  707. name: all checks passed
  708. # This bookkeeping-only verdict must not depend on custom-pool
  709. # provisioning (master's #734 moved it to ubuntu-latest) — and under
  710. # failover it follows the same selector as the worker jobs it
  711. # aggregates, so a standard-hosted outage cannot strand the
  712. # branch-protection verdict either (observed 2026-07-27).
  713. runs-on: >-
  714. ${{ vars.DSH_CI_FAILOVER == 'selfhosted'
  715. && github.event.pull_request.user.login != 'dependabot[bot]'
  716. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  717. || 'ubuntu-latest' }}
  718. needs: [node-24, node-24-coverage, node-24-consumers, node-compat, python-sdk, windows]
  719. if: always() && github.event_name == 'pull_request'
  720. steps:
  721. - name: Fail if any needed job did not succeed
  722. if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')
  723. run: |
  724. echo "::error::Needed job results: ${{ join(needs.*.result, ', ') }}"
  725. exit 1
  726. - name: All checks passed
  727. run: echo "All needed jobs succeeded (${{ join(needs.*.result, ', ') }})"