ci.yml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801
  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. # fetch-depth 2 + DSH_ARCHIVE_BASE_REF below: same frozen-archive
  380. # comparison as serial-linux — without the prior commit the archive
  381. # verifier defaults to HEAD and compares the new manifest with itself.
  382. - uses: actions/checkout@v6
  383. with:
  384. fetch-depth: 2
  385. - uses: actions/setup-node@v6
  386. with:
  387. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  388. - name: Enable corepack (pnpm)
  389. run: corepack enable
  390. - name: Install (immutable)
  391. run: pnpm install --frozen-lockfile
  392. - name: Prepare bubblewrap (unrestrict userns)
  393. run: bash scripts/prepare-ci-bubblewrap.sh
  394. - name: Run complete unsharded primary Node CI serially
  395. env:
  396. DSH_ARCHIVE_BASE_REF: ${{ github.event.before }}
  397. DSH_COVERAGE_MAX_WORKERS: '1'
  398. DSH_E2E_MAX_WORKERS: '1'
  399. DSH_ESLINT_CACHE: '1'
  400. DSH_GATE_CONCURRENCY: '1'
  401. DSH_PUBLINT_CONCURRENCY: '1'
  402. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  403. run: pnpm run check:ci
  404. serial-macos:
  405. if: github.event_name == 'push' && github.ref == 'refs/heads/master'
  406. name: serial / macos
  407. runs-on: macos-latest
  408. steps:
  409. - uses: actions/checkout@v6
  410. - uses: actions/setup-node@v6
  411. with:
  412. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  413. - name: Enable corepack (pnpm)
  414. run: corepack enable
  415. - name: Install (immutable)
  416. run: pnpm install --frozen-lockfile
  417. - name: Run complete unsharded primary Node CI serially
  418. env:
  419. DSH_COVERAGE_MAX_WORKERS: '1'
  420. DSH_E2E_MAX_WORKERS: '1'
  421. DSH_GATE_CONCURRENCY: '1'
  422. DSH_PUBLINT_CONCURRENCY: '1'
  423. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  424. run: pnpm run check:ci
  425. serial-windows:
  426. if: github.event_name == 'push' && github.ref == 'refs/heads/master'
  427. name: serial / windows
  428. runs-on: windows-2025
  429. steps:
  430. - uses: actions/checkout@v6
  431. - name: Enable Developer Mode (symlink support)
  432. shell: pwsh
  433. run: >-
  434. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
  435. /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
  436. - uses: actions/setup-node@v6
  437. with:
  438. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  439. - name: Enable corepack (pnpm)
  440. shell: pwsh
  441. run: corepack enable
  442. # Master refreshes the small cache that pull requests restore without
  443. # putting package-store extraction back on the Windows critical path.
  444. - uses: actions/cache@v4
  445. with:
  446. path: .cache/eslint
  447. 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') }}
  448. restore-keys: |
  449. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-eslint-full-
  450. - name: Install (immutable)
  451. shell: pwsh
  452. run: pnpm install --frozen-lockfile
  453. - name: Run complete unsharded primary Node CI serially
  454. shell: pwsh
  455. env:
  456. DSH_COVERAGE_MAX_WORKERS: '1'
  457. DSH_E2E_MAX_WORKERS: '1'
  458. DSH_ESLINT_CACHE: '1'
  459. DSH_GATE_CONCURRENCY: '1'
  460. DSH_PUBLINT_CONCURRENCY: '1'
  461. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  462. run: pnpm run check:ci
  463. # Manual, bounded comparison of the actual critical Linux and Windows lanes.
  464. # The named pools are restricted at the organization level to this repository.
  465. larger-runner-benchmark:
  466. if: github.event_name == 'workflow_dispatch' && inputs.suite == 'larger-runner-benchmark'
  467. runs-on: ${{ matrix.runner }}
  468. timeout-minutes: 15
  469. strategy:
  470. fail-fast: false
  471. max-parallel: 12
  472. matrix:
  473. include:
  474. - platform: linux
  475. cores: '4'
  476. runner: dsh-ubuntu-24-04-4core
  477. workload: typecheck
  478. - platform: linux
  479. cores: '8'
  480. runner: dsh-ubuntu-24-04-8core
  481. workload: typecheck
  482. - platform: linux
  483. cores: '16'
  484. runner: dsh-ubuntu-24-04-16core
  485. workload: typecheck
  486. - platform: linux
  487. cores: '32'
  488. runner: dsh-ubuntu-24-04-32core
  489. workload: typecheck
  490. - platform: linux
  491. cores: '64'
  492. runner: dsh-ubuntu-24-04-64core
  493. workload: typecheck
  494. - platform: linux
  495. cores: '96'
  496. runner: dsh-ubuntu-24-04-96core
  497. workload: typecheck
  498. - platform: windows
  499. cores: '4'
  500. runner: dsh-windows-2025-4core
  501. workload: production-site
  502. - platform: windows
  503. cores: '8'
  504. runner: dsh-windows-2025-8core
  505. workload: production-site
  506. - platform: windows
  507. cores: '16'
  508. runner: dsh-windows-2025-16core
  509. workload: production-site
  510. - platform: windows
  511. cores: '32'
  512. runner: dsh-windows-2025-32core
  513. workload: production-site
  514. - platform: windows
  515. cores: '64'
  516. runner: dsh-windows-2025-64core
  517. workload: production-site
  518. - platform: windows
  519. cores: '96'
  520. runner: dsh-windows-2025-96core
  521. workload: production-site
  522. steps:
  523. - uses: actions/checkout@v6
  524. - uses: actions/setup-node@v6
  525. with:
  526. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  527. - name: Report runner capacity
  528. run: >-
  529. node -e "const os = require('node:os');
  530. console.log(JSON.stringify({ arch: process.arch, cpus: os.cpus().length,
  531. memoryGiB: Math.round(os.totalmem() / 2 ** 30) }))"
  532. - name: Enable corepack (pnpm)
  533. run: corepack enable
  534. - name: Resolve pnpm store path
  535. if: matrix.platform == 'linux'
  536. id: pnpm-store
  537. run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
  538. - uses: actions/cache@v4
  539. if: matrix.platform == 'linux'
  540. with:
  541. path: ${{ steps.pnpm-store.outputs.path }}
  542. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  543. restore-keys: |
  544. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  545. - name: Install (immutable)
  546. run: pnpm install --frozen-lockfile
  547. - name: Run critical Linux typecheck lane
  548. if: matrix.platform == 'linux'
  549. run: pnpm run typecheck
  550. - name: Run critical Windows production-site lane
  551. if: matrix.platform == 'windows'
  552. run: pnpm run docs:build
  553. # Manual comparison of the intended low-fanout topology. Linux runs the
  554. # complete unsharded primary aggregate with bounded in-runner parallelism;
  555. # Windows runs both blocking build surfaces concurrently through run-gates.
  556. consolidated-runner-benchmark:
  557. if: github.event_name == 'workflow_dispatch' && inputs.suite == 'consolidated-runner-benchmark'
  558. runs-on: ${{ matrix.runner }}
  559. timeout-minutes: 15
  560. strategy:
  561. fail-fast: false
  562. max-parallel: 12
  563. matrix:
  564. include:
  565. - platform: linux
  566. cores: '4'
  567. runner: dsh-ubuntu-24-04-4core
  568. workers: '4'
  569. - platform: linux
  570. cores: '8'
  571. runner: dsh-ubuntu-24-04-8core
  572. workers: '8'
  573. - platform: linux
  574. cores: '16'
  575. runner: dsh-ubuntu-24-04-16core
  576. workers: '16'
  577. - platform: linux
  578. cores: '32'
  579. runner: dsh-ubuntu-24-04-32core
  580. workers: '32'
  581. - platform: linux
  582. cores: '64'
  583. runner: dsh-ubuntu-24-04-64core
  584. workers: '32'
  585. - platform: linux
  586. cores: '96'
  587. runner: dsh-ubuntu-24-04-96core
  588. workers: '32'
  589. - platform: windows
  590. cores: '4'
  591. runner: dsh-windows-2025-4core
  592. workers: '2'
  593. - platform: windows
  594. cores: '8'
  595. runner: dsh-windows-2025-8core
  596. workers: '2'
  597. - platform: windows
  598. cores: '16'
  599. runner: dsh-windows-2025-16core
  600. workers: '2'
  601. - platform: windows
  602. cores: '32'
  603. runner: dsh-windows-2025-32core
  604. workers: '2'
  605. - platform: windows
  606. cores: '64'
  607. runner: dsh-windows-2025-64core
  608. workers: '2'
  609. - platform: windows
  610. cores: '96'
  611. runner: dsh-windows-2025-96core
  612. workers: '2'
  613. steps:
  614. - uses: actions/checkout@v6
  615. - uses: actions/setup-node@v6
  616. with:
  617. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  618. - name: Report runner capacity
  619. run: >-
  620. node -e "const os = require('node:os');
  621. console.log(JSON.stringify({ arch: process.arch, cpus: os.cpus().length,
  622. memoryGiB: Math.round(os.totalmem() / 2 ** 30) }))"
  623. - name: Enable corepack (pnpm)
  624. run: corepack enable
  625. - name: Resolve pnpm store path (Linux)
  626. if: matrix.platform == 'linux'
  627. id: pnpm-store-linux
  628. run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
  629. - name: Resolve pnpm store path (Windows)
  630. if: matrix.platform == 'windows'
  631. id: pnpm-store-windows
  632. shell: pwsh
  633. run: '"path=$(pnpm store path --silent)" >> $env:GITHUB_OUTPUT'
  634. - uses: actions/cache@v4
  635. with:
  636. path: ${{ steps.pnpm-store-linux.outputs.path || steps.pnpm-store-windows.outputs.path }}
  637. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  638. restore-keys: |
  639. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  640. - uses: actions/cache@v4
  641. if: matrix.platform == 'linux'
  642. with:
  643. path: .cache/eslint
  644. 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') }}
  645. restore-keys: |
  646. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-eslint-full-
  647. - name: Install and prepare Linux
  648. if: matrix.platform == 'linux'
  649. run: |
  650. pnpm install --frozen-lockfile &
  651. install_pid=$!
  652. bash scripts/prepare-ci-bubblewrap.sh &
  653. sandbox_pid=$!
  654. install_status=0
  655. wait "$install_pid" || install_status=$?
  656. sandbox_status=0
  657. wait "$sandbox_pid" || sandbox_status=$?
  658. if (( install_status != 0 )); then exit "$install_status"; fi
  659. exit "$sandbox_status"
  660. - name: Install (immutable)
  661. if: matrix.platform == 'windows'
  662. shell: pwsh
  663. run: pnpm install --frozen-lockfile
  664. - name: Run complete unsharded primary Node CI concurrently
  665. if: matrix.platform == 'linux'
  666. env:
  667. DSH_COVERAGE_MAX_WORKERS: ${{ matrix.workers }}
  668. DSH_ESLINT_CACHE: '1'
  669. DSH_ESLINT_CONCURRENCY: ${{ matrix.workers }}
  670. DSH_GATE_CONCURRENCY: ${{ matrix.workers }}
  671. DSH_PUBLINT_CONCURRENCY: ${{ matrix.workers }}
  672. DSH_SNAPSHOT_MAX_CONCURRENCY: ${{ matrix.workers }}
  673. run: pnpm run check:ci
  674. - name: Run blocking Windows builds concurrently
  675. if: matrix.platform == 'windows'
  676. shell: pwsh
  677. env:
  678. DSH_GATE_CONCURRENCY: ${{ matrix.workers }}
  679. run: pnpm run check:ci:windows-blocking
  680. # Single stable required check for branch protection: require "all checks
  681. # passed" instead of enumerating matrix legs whose names change as lanes and
  682. # node versions evolve. Every blocking job in THIS workflow must be listed in
  683. # `needs`; observational Windows gates share the required Windows job but are
  684. # marked non-blocking inside run-gates. (`needs` cannot reach across workflow
  685. # files; e2e.yml stays its own check.)
  686. # `if: always()` is load-bearing: without it a failed dependency
  687. # would SKIP this job, and GitHub counts a skipped required check as passing
  688. # — so this job always runs and fails on any non-success result, including
  689. # 'cancelled' and 'skipped'.
  690. all-checks-passed:
  691. name: all checks passed
  692. # The required verdict must not add a separate standard-hosted billing
  693. # dependency — and it must follow the failover selector like the worker
  694. # jobs it aggregates: if it stayed pinned to the hosted pool, every
  695. # failover-passed run would still leave the branch-protection verdict
  696. # queued forever on the failed pool.
  697. runs-on: >-
  698. ${{ vars.DSH_CI_FAILOVER == 'selfhosted'
  699. && github.event.pull_request.user.login != 'dependabot[bot]'
  700. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  701. || 'dsh-enterprise-ubuntu-latest-32core-test' }}
  702. needs: [node-24, node-24-coverage, node-24-consumers, node-compat, python-sdk, windows]
  703. if: always() && github.event_name == 'pull_request'
  704. steps:
  705. - name: Fail if any needed job did not succeed
  706. if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')
  707. run: |
  708. echo "::error::Needed job results: ${{ join(needs.*.result, ', ') }}"
  709. exit 1
  710. - name: All checks passed
  711. run: echo "All needed jobs succeeded (${{ join(needs.*.result, ', ') }})"