ci.yml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  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. node-24:
  28. if: github.event_name == 'pull_request'
  29. runs-on: dsh-enterprise-ubuntu-latest-32core-test
  30. name: node 24 / static
  31. env:
  32. DSH_GATE_CONCURRENCY: '8'
  33. steps:
  34. - uses: actions/checkout@v6
  35. with:
  36. persist-credentials: false
  37. # Pull requests consume the default-branch cache but do not put cache
  38. # compression and upload on the paid latency-critical path.
  39. - uses: actions/cache/restore@v4
  40. with:
  41. path: /home/runner/.local/share/pnpm/store/v11
  42. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  43. restore-keys: |
  44. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  45. - uses: actions/setup-node@v6
  46. with:
  47. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  48. - name: Enable corepack and install dependencies
  49. run: |
  50. corepack enable
  51. pnpm install --frozen-lockfile
  52. - name: Run static gates
  53. run: pnpm run check:ci:static
  54. - name: Pack built tree
  55. run: >-
  56. tar -czf "$RUNNER_TEMP/node-24-built-tree.tar.gz"
  57. apps/*/lib packages/*/*/lib vendor/*/lib
  58. - uses: actions/upload-artifact@v6
  59. with:
  60. name: node-24-built-tree
  61. path: ${{ runner.temp }}/node-24-built-tree.tar.gz
  62. if-no-files-found: error
  63. retention-days: 1
  64. compression-level: 0
  65. node-24-coverage:
  66. if: github.event_name == 'pull_request'
  67. runs-on: dsh-enterprise-ubuntu-24-04-32core-test
  68. name: node 24 / coverage
  69. env:
  70. DSH_COVERAGE_MAX_WORKERS: '24'
  71. DSH_GATE_CONCURRENCY: '8'
  72. steps:
  73. - uses: actions/checkout@v6
  74. with:
  75. persist-credentials: false
  76. - uses: actions/cache/restore@v4
  77. with:
  78. path: /home/runner/.local/share/pnpm/store/v11
  79. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  80. restore-keys: |
  81. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  82. - uses: actions/setup-node@v6
  83. with:
  84. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  85. - name: Enable corepack, install dependencies, and prepare bubblewrap
  86. run: |
  87. corepack enable
  88. pnpm install --frozen-lockfile &
  89. install_pid=$!
  90. bash scripts/prepare-ci-bubblewrap.sh &
  91. sandbox_pid=$!
  92. install_status=0
  93. wait "$install_pid" || install_status=$?
  94. sandbox_status=0
  95. wait "$sandbox_pid" || sandbox_status=$?
  96. if (( install_status != 0 )); then exit "$install_status"; fi
  97. exit "$sandbox_status"
  98. - name: Run exhaustive coverage
  99. run: pnpm run check:ci:coverage
  100. node-24-consumers:
  101. needs: node-24
  102. if: github.event_name == 'pull_request'
  103. runs-on: dsh-enterprise-ubuntu-latest-32core-test
  104. name: node 24 / snapshots and artifacts
  105. env:
  106. DSH_ESLINT_CACHE: '1'
  107. DSH_ESLINT_CONCURRENCY: '8'
  108. DSH_GATE_CONCURRENCY: '8'
  109. DSH_NODE_COMPAT_SKIP_TYPECHECK: '1'
  110. DSH_PUBLINT_CONCURRENCY: '8'
  111. DSH_SNAPSHOT_MAX_CONCURRENCY: '32'
  112. steps:
  113. - uses: actions/checkout@v6
  114. with:
  115. persist-credentials: false
  116. - uses: actions/download-artifact@v8
  117. with:
  118. name: node-24-built-tree
  119. path: ${{ runner.temp }}
  120. - name: Restore built tree
  121. run: tar -xzf "$RUNNER_TEMP/node-24-built-tree.tar.gz"
  122. - uses: actions/cache/restore@v4
  123. with:
  124. path: /home/runner/.local/share/pnpm/store/v11
  125. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  126. restore-keys: |
  127. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  128. - uses: actions/cache/restore@v4
  129. with:
  130. path: .cache/eslint
  131. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-eslint-full-${{ hashFiles('pnpm-lock.yaml', 'eslint.config.mjs', 'tsconfig.json', 'tsconfig.base.json', 'tsconfig.base.client.json', 'tsconfig.host.json', 'tsconfig.client.json', 'packages/*/*/tsconfig.json', 'examples/*/tsconfig.json') }}
  132. restore-keys: |
  133. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-eslint-full-
  134. - uses: actions/setup-node@v6
  135. with:
  136. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  137. - name: Enable corepack, install dependencies, and prepare bubblewrap
  138. run: |
  139. corepack enable
  140. pnpm install --frozen-lockfile &
  141. install_pid=$!
  142. bash scripts/prepare-ci-bubblewrap.sh &
  143. sandbox_pid=$!
  144. install_status=0
  145. wait "$install_pid" || install_status=$?
  146. sandbox_status=0
  147. wait "$sandbox_pid" || sandbox_status=$?
  148. if (( install_status != 0 )); then exit "$install_status"; fi
  149. exit "$sandbox_status"
  150. - name: Run compatibility, snapshot, and artifact gates
  151. run: |
  152. pnpm run check:ci:lint &
  153. lint_pid=$!
  154. pnpm run check:node-compat &
  155. compat_pid=$!
  156. DSH_EXAMPLE_MODE=lib pnpm run test:snapshot &
  157. snapshot_pid=$!
  158. pnpm run publint &
  159. publint_pid=$!
  160. pnpm run verify-node-next-types &
  161. node_next_pid=$!
  162. pnpm run verify-built-package-invariants &
  163. built_invariants_pid=$!
  164. DSH_EXAMPLE_MODE=lib pnpm exec vitest run --config vitest.e2e.config.ts \
  165. examples/headless-agent/tests/keyless-smoke.e2e.ts \
  166. examples/tui-agent/tests/tui-keyless-smoke.e2e.ts \
  167. packages/examples/cli-demo/tests/built-bin.e2e.ts \
  168. packages/examples/acp-demo/tests/built-bin.e2e.ts \
  169. packages/ui/jsonrpc/tests/built-scope-carrier.e2e.ts \
  170. packages/workflow/workflow-workerthread/tests/built-worker.e2e.ts \
  171. packages/code-runtime/code-runtime-worker/tests/built-lib.e2e.ts &
  172. built_bin_pid=$!
  173. final_status=0
  174. capture_status() {
  175. local child_status=0
  176. wait "$1" || child_status=$?
  177. if (( final_status == 0 && child_status != 0 )); then
  178. final_status=$child_status
  179. fi
  180. }
  181. for child_pid in \
  182. "$lint_pid" "$compat_pid" "$snapshot_pid" \
  183. "$publint_pid" "$node_next_pid" "$built_invariants_pid" "$built_bin_pid"
  184. do
  185. capture_status "$child_pid"
  186. done
  187. exit "$final_status"
  188. node-compat:
  189. if: github.event_name == 'pull_request'
  190. # Each compatibility contract receives an independent standard hosted job.
  191. runs-on: ${{ matrix.runner }}
  192. name: ${{ matrix.name }}
  193. env:
  194. DSH_GATE_CONCURRENCY: ${{ matrix.gate_concurrency }}
  195. DSH_NODE_COMPAT_SKIP_TYPECHECK: '1'
  196. strategy:
  197. fail-fast: false
  198. matrix:
  199. include:
  200. - node: '22.19'
  201. name: node 22.19
  202. runner: ubuntu-latest
  203. gate_concurrency: '1'
  204. - node: 26
  205. name: node 26
  206. runner: ubuntu-latest
  207. gate_concurrency: '1'
  208. steps:
  209. - uses: actions/checkout@v6
  210. - uses: actions/setup-node@v6
  211. with:
  212. node-version: ${{ matrix.node }}
  213. - name: Enable corepack and resolve pnpm store path
  214. id: pnpm-store
  215. run: |
  216. corepack enable
  217. echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
  218. - uses: actions/cache@v4
  219. with:
  220. path: ${{ steps.pnpm-store.outputs.path }}
  221. key: ${{ runner.os }}-node-${{ matrix.node }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  222. restore-keys: |
  223. ${{ runner.os }}-node-${{ matrix.node }}-pnpm-
  224. - name: Install (immutable)
  225. run: pnpm install --frozen-lockfile
  226. - name: Run compatibility smokes
  227. run: pnpm run check:node-compat
  228. python-sdk:
  229. if: github.event_name == 'pull_request'
  230. runs-on: ubuntu-latest
  231. name: python 3.10 / keyless SDK
  232. steps:
  233. - uses: actions/checkout@v6
  234. - uses: actions/setup-python@v6
  235. with:
  236. python-version: '3.10'
  237. cache: pip
  238. - name: Install uv
  239. run: python -m pip install uv==0.11.23
  240. - name: Run complete keyless Python suite
  241. run: uv run --python 3.10 --group test --project python/sdk pytest
  242. # One Windows box shares setup across the required build/site checks and the
  243. # observational portability inventory. Linux owns duplicate lint, coverage,
  244. # and snapshots so they do not dominate the paid Windows critical path.
  245. windows:
  246. if: github.event_name == 'pull_request'
  247. runs-on: dsh-enterprise-windows-2025-32core-test
  248. name: windows node 24 / complete
  249. env:
  250. DSH_COVERAGE_MAX_WORKERS: '12'
  251. DSH_GATE_CONCURRENCY: '16'
  252. DSH_PUBLINT_CONCURRENCY: '16'
  253. steps:
  254. - uses: actions/checkout@v6
  255. - name: Enable Developer Mode (symlink support)
  256. shell: pwsh
  257. run: >-
  258. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
  259. /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
  260. - uses: actions/setup-node@v6
  261. with:
  262. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  263. # Extracting the many-file pnpm store cache is slower than a clean install,
  264. # and saving it adds more latency after gates.
  265. - name: Enable corepack and install (immutable)
  266. shell: pwsh
  267. run: |
  268. corepack enable
  269. pnpm install --frozen-lockfile
  270. - name: Run blocking and observational Windows gates concurrently
  271. shell: pwsh
  272. run: pnpm run check:ci:windows-complete
  273. # Master pushes run only the serial reference jobs below.
  274. # Each host executes the complete, unsharded primary Node aggregate with one
  275. # gate worker, giving reviewers a simple cross-platform oracle for completeness
  276. # and timing.
  277. serial-linux:
  278. if: github.event_name == 'push' && github.ref == 'refs/heads/master'
  279. name: serial / linux
  280. runs-on: ubuntu-latest
  281. steps:
  282. - uses: actions/checkout@v6
  283. - uses: actions/setup-node@v6
  284. with:
  285. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  286. - name: Enable corepack and resolve pnpm store path
  287. id: pnpm-store
  288. run: |
  289. corepack enable
  290. echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
  291. # Master refreshes the caches that pull requests restore without saving.
  292. - uses: actions/cache@v4
  293. with:
  294. path: ${{ steps.pnpm-store.outputs.path }}
  295. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  296. restore-keys: |
  297. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  298. - uses: actions/cache@v4
  299. with:
  300. path: .cache/eslint
  301. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-eslint-full-${{ hashFiles('pnpm-lock.yaml', 'eslint.config.mjs', 'tsconfig.json', 'tsconfig.base.json', 'tsconfig.base.client.json', 'tsconfig.host.json', 'tsconfig.client.json', 'packages/*/*/tsconfig.json', 'examples/*/tsconfig.json') }}
  302. restore-keys: |
  303. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-eslint-full-
  304. - name: Install (immutable)
  305. run: pnpm install --frozen-lockfile
  306. - name: Prepare bubblewrap (unrestrict userns)
  307. run: bash scripts/prepare-ci-bubblewrap.sh
  308. - name: Run complete unsharded primary Node CI serially
  309. env:
  310. DSH_COVERAGE_MAX_WORKERS: '1'
  311. DSH_E2E_MAX_WORKERS: '1'
  312. DSH_ESLINT_CACHE: '1'
  313. DSH_GATE_CONCURRENCY: '1'
  314. DSH_PUBLINT_CONCURRENCY: '1'
  315. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  316. run: pnpm run check:ci
  317. serial-macos:
  318. if: github.event_name == 'push' && github.ref == 'refs/heads/master'
  319. name: serial / macos
  320. runs-on: macos-latest
  321. steps:
  322. - uses: actions/checkout@v6
  323. - uses: actions/setup-node@v6
  324. with:
  325. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  326. - name: Enable corepack (pnpm)
  327. run: corepack enable
  328. - name: Install (immutable)
  329. run: pnpm install --frozen-lockfile
  330. - name: Run complete unsharded primary Node CI serially
  331. env:
  332. DSH_COVERAGE_MAX_WORKERS: '1'
  333. DSH_E2E_MAX_WORKERS: '1'
  334. DSH_GATE_CONCURRENCY: '1'
  335. DSH_PUBLINT_CONCURRENCY: '1'
  336. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  337. run: pnpm run check:ci
  338. serial-windows:
  339. if: github.event_name == 'push' && github.ref == 'refs/heads/master'
  340. name: serial / windows
  341. runs-on: windows-2025
  342. steps:
  343. - uses: actions/checkout@v6
  344. - name: Enable Developer Mode (symlink support)
  345. shell: pwsh
  346. run: >-
  347. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
  348. /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
  349. - uses: actions/setup-node@v6
  350. with:
  351. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  352. - name: Enable corepack (pnpm)
  353. shell: pwsh
  354. run: corepack enable
  355. # Master refreshes the small cache that pull requests restore without
  356. # putting package-store extraction back on the Windows critical path.
  357. - uses: actions/cache@v4
  358. with:
  359. path: .cache/eslint
  360. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-eslint-full-${{ hashFiles('pnpm-lock.yaml', 'eslint.config.mjs', 'tsconfig.json', 'tsconfig.base.json', 'tsconfig.base.client.json', 'tsconfig.host.json', 'tsconfig.client.json', 'packages/*/*/tsconfig.json', 'examples/*/tsconfig.json') }}
  361. restore-keys: |
  362. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-eslint-full-
  363. - name: Install (immutable)
  364. shell: pwsh
  365. run: pnpm install --frozen-lockfile
  366. - name: Run complete unsharded primary Node CI serially
  367. shell: pwsh
  368. env:
  369. DSH_COVERAGE_MAX_WORKERS: '1'
  370. DSH_E2E_MAX_WORKERS: '1'
  371. DSH_ESLINT_CACHE: '1'
  372. DSH_GATE_CONCURRENCY: '1'
  373. DSH_PUBLINT_CONCURRENCY: '1'
  374. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  375. run: pnpm run check:ci
  376. # Manual, bounded comparison of the actual critical Linux and Windows lanes.
  377. # The named pools are restricted at the organization level to this repository.
  378. larger-runner-benchmark:
  379. if: github.event_name == 'workflow_dispatch' && inputs.suite == 'larger-runner-benchmark'
  380. runs-on: ${{ matrix.runner }}
  381. timeout-minutes: 15
  382. strategy:
  383. fail-fast: false
  384. max-parallel: 12
  385. matrix:
  386. include:
  387. - platform: linux
  388. cores: '4'
  389. runner: dsh-ubuntu-24-04-4core
  390. workload: typecheck
  391. - platform: linux
  392. cores: '8'
  393. runner: dsh-ubuntu-24-04-8core
  394. workload: typecheck
  395. - platform: linux
  396. cores: '16'
  397. runner: dsh-ubuntu-24-04-16core
  398. workload: typecheck
  399. - platform: linux
  400. cores: '32'
  401. runner: dsh-ubuntu-24-04-32core
  402. workload: typecheck
  403. - platform: linux
  404. cores: '64'
  405. runner: dsh-ubuntu-24-04-64core
  406. workload: typecheck
  407. - platform: linux
  408. cores: '96'
  409. runner: dsh-ubuntu-24-04-96core
  410. workload: typecheck
  411. - platform: windows
  412. cores: '4'
  413. runner: dsh-windows-2025-4core
  414. workload: production-site
  415. - platform: windows
  416. cores: '8'
  417. runner: dsh-windows-2025-8core
  418. workload: production-site
  419. - platform: windows
  420. cores: '16'
  421. runner: dsh-windows-2025-16core
  422. workload: production-site
  423. - platform: windows
  424. cores: '32'
  425. runner: dsh-windows-2025-32core
  426. workload: production-site
  427. - platform: windows
  428. cores: '64'
  429. runner: dsh-windows-2025-64core
  430. workload: production-site
  431. - platform: windows
  432. cores: '96'
  433. runner: dsh-windows-2025-96core
  434. workload: production-site
  435. steps:
  436. - uses: actions/checkout@v6
  437. - uses: actions/setup-node@v6
  438. with:
  439. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  440. - name: Report runner capacity
  441. run: >-
  442. node -e "const os = require('node:os');
  443. console.log(JSON.stringify({ arch: process.arch, cpus: os.cpus().length,
  444. memoryGiB: Math.round(os.totalmem() / 2 ** 30) }))"
  445. - name: Enable corepack (pnpm)
  446. run: corepack enable
  447. - name: Resolve pnpm store path
  448. if: matrix.platform == 'linux'
  449. id: pnpm-store
  450. run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
  451. - uses: actions/cache@v4
  452. if: matrix.platform == 'linux'
  453. with:
  454. path: ${{ steps.pnpm-store.outputs.path }}
  455. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  456. restore-keys: |
  457. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  458. - name: Install (immutable)
  459. run: pnpm install --frozen-lockfile
  460. - name: Run critical Linux typecheck lane
  461. if: matrix.platform == 'linux'
  462. run: pnpm run typecheck
  463. - name: Run critical Windows production-site lane
  464. if: matrix.platform == 'windows'
  465. run: pnpm run docs:build
  466. # Manual comparison of the intended low-fanout topology. Linux runs the
  467. # complete unsharded primary aggregate with bounded in-runner parallelism;
  468. # Windows runs both blocking build surfaces concurrently through run-gates.
  469. consolidated-runner-benchmark:
  470. if: github.event_name == 'workflow_dispatch' && inputs.suite == 'consolidated-runner-benchmark'
  471. runs-on: ${{ matrix.runner }}
  472. timeout-minutes: 15
  473. strategy:
  474. fail-fast: false
  475. max-parallel: 12
  476. matrix:
  477. include:
  478. - platform: linux
  479. cores: '4'
  480. runner: dsh-ubuntu-24-04-4core
  481. workers: '4'
  482. - platform: linux
  483. cores: '8'
  484. runner: dsh-ubuntu-24-04-8core
  485. workers: '8'
  486. - platform: linux
  487. cores: '16'
  488. runner: dsh-ubuntu-24-04-16core
  489. workers: '16'
  490. - platform: linux
  491. cores: '32'
  492. runner: dsh-ubuntu-24-04-32core
  493. workers: '32'
  494. - platform: linux
  495. cores: '64'
  496. runner: dsh-ubuntu-24-04-64core
  497. workers: '32'
  498. - platform: linux
  499. cores: '96'
  500. runner: dsh-ubuntu-24-04-96core
  501. workers: '32'
  502. - platform: windows
  503. cores: '4'
  504. runner: dsh-windows-2025-4core
  505. workers: '2'
  506. - platform: windows
  507. cores: '8'
  508. runner: dsh-windows-2025-8core
  509. workers: '2'
  510. - platform: windows
  511. cores: '16'
  512. runner: dsh-windows-2025-16core
  513. workers: '2'
  514. - platform: windows
  515. cores: '32'
  516. runner: dsh-windows-2025-32core
  517. workers: '2'
  518. - platform: windows
  519. cores: '64'
  520. runner: dsh-windows-2025-64core
  521. workers: '2'
  522. - platform: windows
  523. cores: '96'
  524. runner: dsh-windows-2025-96core
  525. workers: '2'
  526. steps:
  527. - uses: actions/checkout@v6
  528. - uses: actions/setup-node@v6
  529. with:
  530. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  531. - name: Report runner capacity
  532. run: >-
  533. node -e "const os = require('node:os');
  534. console.log(JSON.stringify({ arch: process.arch, cpus: os.cpus().length,
  535. memoryGiB: Math.round(os.totalmem() / 2 ** 30) }))"
  536. - name: Enable corepack (pnpm)
  537. run: corepack enable
  538. - name: Resolve pnpm store path (Linux)
  539. if: matrix.platform == 'linux'
  540. id: pnpm-store-linux
  541. run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
  542. - name: Resolve pnpm store path (Windows)
  543. if: matrix.platform == 'windows'
  544. id: pnpm-store-windows
  545. shell: pwsh
  546. run: '"path=$(pnpm store path --silent)" >> $env:GITHUB_OUTPUT'
  547. - uses: actions/cache@v4
  548. with:
  549. path: ${{ steps.pnpm-store-linux.outputs.path || steps.pnpm-store-windows.outputs.path }}
  550. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  551. restore-keys: |
  552. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  553. - uses: actions/cache@v4
  554. if: matrix.platform == 'linux'
  555. with:
  556. path: .cache/eslint
  557. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-eslint-full-${{ hashFiles('pnpm-lock.yaml', 'eslint.config.mjs', 'tsconfig.json', 'tsconfig.base.json', 'tsconfig.base.client.json', 'tsconfig.host.json', 'tsconfig.client.json', 'packages/*/*/tsconfig.json', 'examples/*/tsconfig.json') }}
  558. restore-keys: |
  559. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-eslint-full-
  560. - name: Install and prepare Linux
  561. if: matrix.platform == 'linux'
  562. run: |
  563. pnpm install --frozen-lockfile &
  564. install_pid=$!
  565. bash scripts/prepare-ci-bubblewrap.sh &
  566. sandbox_pid=$!
  567. install_status=0
  568. wait "$install_pid" || install_status=$?
  569. sandbox_status=0
  570. wait "$sandbox_pid" || sandbox_status=$?
  571. if (( install_status != 0 )); then exit "$install_status"; fi
  572. exit "$sandbox_status"
  573. - name: Install (immutable)
  574. if: matrix.platform == 'windows'
  575. shell: pwsh
  576. run: pnpm install --frozen-lockfile
  577. - name: Run complete unsharded primary Node CI concurrently
  578. if: matrix.platform == 'linux'
  579. env:
  580. DSH_COVERAGE_MAX_WORKERS: ${{ matrix.workers }}
  581. DSH_ESLINT_CACHE: '1'
  582. DSH_ESLINT_CONCURRENCY: ${{ matrix.workers }}
  583. DSH_GATE_CONCURRENCY: ${{ matrix.workers }}
  584. DSH_PUBLINT_CONCURRENCY: ${{ matrix.workers }}
  585. DSH_SNAPSHOT_MAX_CONCURRENCY: ${{ matrix.workers }}
  586. run: pnpm run check:ci
  587. - name: Run blocking Windows builds concurrently
  588. if: matrix.platform == 'windows'
  589. shell: pwsh
  590. env:
  591. DSH_GATE_CONCURRENCY: ${{ matrix.workers }}
  592. run: pnpm run check:ci:windows-blocking
  593. # Single stable required check for branch protection: require "all checks
  594. # passed" instead of enumerating matrix legs whose names change as lanes and
  595. # node versions evolve. Every blocking job in THIS workflow must be listed in
  596. # `needs`; observational Windows gates share the required Windows job but are
  597. # marked non-blocking inside run-gates. (`needs` cannot reach across workflow
  598. # files; e2e.yml stays its own check.)
  599. # `if: always()` is load-bearing: without it a failed dependency
  600. # would SKIP this job, and GitHub counts a skipped required check as passing
  601. # — so this job always runs and fails on any non-success result, including
  602. # 'cancelled' and 'skipped'.
  603. all-checks-passed:
  604. name: all checks passed
  605. runs-on: ubuntu-latest
  606. needs: [node-24, node-24-coverage, node-24-consumers, node-compat, python-sdk, windows]
  607. if: always() && github.event_name == 'pull_request'
  608. steps:
  609. - name: Fail if any needed job did not succeed
  610. if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')
  611. run: |
  612. echo "::error::Needed job results: ${{ join(needs.*.result, ', ') }}"
  613. exit 1
  614. - name: All checks passed
  615. run: echo "All needed jobs succeeded (${{ join(needs.*.result, ', ') }})"