ci.yml 28 KB

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