ci.yml 29 KB

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