ci.yml 30 KB

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