ci.yml 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843
  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. # FIXME: Re-enable the three hosted serial reference jobs before cutting a 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. # Failover shrinks the worker bound: the hosted 32-core runner is
  98. # exclusive to one job, but the failover pool shares one 64-core VM
  99. # across six always-on runner instances, and the timing-sensitive
  100. # process suites have documented aggregate-contention failures.
  101. # 8 × 6 instances = 48 workers worst case on 64 cores.
  102. DSH_COVERAGE_MAX_WORKERS: ${{ vars.DSH_CI_FAILOVER == 'selfhosted' && github.event.pull_request.user.login != 'dependabot[bot]' && '8' || '6' }}
  103. DSH_GATE_CONCURRENCY: '3'
  104. steps:
  105. - uses: actions/checkout@v6
  106. with:
  107. persist-credentials: false
  108. - uses: pnpm/action-setup@v4
  109. with:
  110. dest: ${{ runner.temp }}/setup-pnpm
  111. - uses: actions/setup-node@v6
  112. with:
  113. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  114. - name: Configure pnpm store path
  115. id: pnpm-store
  116. run: |
  117. store_root="$HOME/.local/share/pnpm/store"
  118. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  119. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  120. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  121. # Skipped under failover: the self-hosted VM's persistent pnpm store
  122. # already serves warm installs, while restoring the hosted archive
  123. # would spend ~52 s pulling ~180 MB into that populated store.
  124. - uses: actions/cache/restore@v4
  125. if: vars.DSH_CI_FAILOVER != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
  126. with:
  127. path: ${{ steps.pnpm-store.outputs.path }}
  128. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  129. restore-keys: |
  130. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  131. - name: Install dependencies and prepare bubblewrap
  132. run: |
  133. pnpm install --frozen-lockfile &
  134. install_pid=$!
  135. bash scripts/prepare-ci-bubblewrap.sh &
  136. sandbox_pid=$!
  137. install_status=0
  138. wait "$install_pid" || install_status=$?
  139. sandbox_status=0
  140. wait "$sandbox_pid" || sandbox_status=$?
  141. if (( install_status != 0 )); then exit "$install_status"; fi
  142. exit "$sandbox_status"
  143. - name: Run exhaustive coverage
  144. run: pnpm run check:ci:coverage
  145. node-24-consumers:
  146. if: github.event_name == 'pull_request'
  147. runs-on: >-
  148. ${{ vars.DSH_CI_FAILOVER == 'selfhosted'
  149. && github.event.pull_request.user.login != 'dependabot[bot]'
  150. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  151. || 'dsh-ubuntu-24-04-16core' }}
  152. name: node 24 / snapshots and artifacts
  153. env:
  154. DSH_GATE_CONCURRENCY: '8'
  155. DSH_NODE_COMPAT_SKIP_TYPECHECK: '1'
  156. DSH_OXLINT_THREADS: '8'
  157. DSH_PUBLINT_CONCURRENCY: '8'
  158. # Failover halves snapshot concurrency for the shared 64-core VM.
  159. DSH_SNAPSHOT_MAX_CONCURRENCY: ${{ vars.DSH_CI_FAILOVER == 'selfhosted' && github.event.pull_request.user.login != 'dependabot[bot]' && '12' || '32' }}
  160. steps:
  161. - uses: actions/checkout@v6
  162. with:
  163. persist-credentials: false
  164. - uses: pnpm/action-setup@v4
  165. with:
  166. dest: ${{ runner.temp }}/setup-pnpm
  167. - uses: actions/setup-node@v6
  168. with:
  169. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  170. - name: Configure pnpm store path
  171. id: pnpm-store
  172. run: |
  173. store_root="$HOME/.local/share/pnpm/store"
  174. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  175. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  176. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  177. # Skipped under failover — see the coverage lane's identical rationale.
  178. - uses: actions/cache/restore@v4
  179. if: vars.DSH_CI_FAILOVER != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
  180. with:
  181. path: ${{ steps.pnpm-store.outputs.path }}
  182. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  183. restore-keys: |
  184. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  185. # Pull requests restore the cache normally produced by serial-linux on
  186. # master; they do not pay compression and upload on the required path.
  187. - uses: actions/cache/restore@v4
  188. if: vars.DSH_CI_FAILOVER != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
  189. with:
  190. path: ~/.cache/ms-playwright
  191. key: ${{ runner.os }}-playwright-${{ hashFiles('pnpm-lock.yaml') }}
  192. restore-keys: |
  193. ${{ runner.os }}-playwright-
  194. - name: Install dependencies and prepare bubblewrap
  195. run: |
  196. pnpm install --frozen-lockfile &
  197. install_pid=$!
  198. bash scripts/prepare-ci-bubblewrap.sh &
  199. sandbox_pid=$!
  200. install_status=0
  201. wait "$install_pid" || install_status=$?
  202. sandbox_status=0
  203. wait "$sandbox_pid" || sandbox_status=$?
  204. if (( install_status != 0 )); then exit "$install_status"; fi
  205. exit "$sandbox_status"
  206. - name: Install Playwright Chromium and hosted dependencies
  207. if: vars.DSH_CI_FAILOVER != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
  208. run: pnpm --filter @deepseek-ai/dsh-frontend exec playwright install --with-deps chromium
  209. # The persistent VM image owns Playwright's Linux system packages; do
  210. # not mutate the shared host with apt on every failover run.
  211. - name: Install Playwright Chromium on the failover VM
  212. if: vars.DSH_CI_FAILOVER == 'selfhosted' && github.event.pull_request.user.login != 'dependabot[bot]'
  213. run: pnpm --filter @deepseek-ai/dsh-frontend exec playwright install chromium
  214. - name: Run compatibility, snapshot, and artifact gates
  215. run: pnpm run check:ci:consumers
  216. node-compat:
  217. if: github.event_name == 'pull_request'
  218. # Each compatibility contract receives an independent standard hosted job.
  219. runs-on: ${{ matrix.runner }}
  220. name: ${{ matrix.name }}
  221. env:
  222. DSH_GATE_CONCURRENCY: ${{ matrix.gate_concurrency }}
  223. DSH_NODE_COMPAT_SKIP_TYPECHECK: '1'
  224. strategy:
  225. fail-fast: false
  226. matrix:
  227. include:
  228. - node: '22.19'
  229. name: node 22.19
  230. runner: ubuntu-latest
  231. gate_concurrency: '1'
  232. - node: 26
  233. name: node 26
  234. runner: ubuntu-latest
  235. gate_concurrency: '1'
  236. steps:
  237. - uses: actions/checkout@v6
  238. - uses: pnpm/action-setup@v4
  239. with:
  240. dest: ${{ runner.temp }}/setup-pnpm
  241. - uses: actions/setup-node@v6
  242. with:
  243. node-version: ${{ matrix.node }}
  244. cache: pnpm
  245. - name: Install (immutable)
  246. run: pnpm install --frozen-lockfile
  247. - name: Run compatibility smokes
  248. run: pnpm run check:node-compat
  249. python-sdk:
  250. if: github.event_name == 'pull_request'
  251. runs-on: ubuntu-latest
  252. name: python 3.10 / keyless SDK
  253. steps:
  254. - uses: actions/checkout@v6
  255. - uses: actions/setup-python@v6.3.0
  256. with:
  257. python-version: '3.10'
  258. cache: pip
  259. - name: Install uv
  260. run: python -m pip install uv==0.11.23
  261. - name: Run complete keyless Python suite
  262. run: uv run --python 3.10 --group test --project python/sdk pytest
  263. # The required pull-request Windows signal: the two blocking win32 surfaces
  264. # (workspace build, production site) execute with real, checksum-verified
  265. # Windows Node under Wine on standard hosted Linux. The master
  266. # serial-windows job below normally keeps the complete native-kernel
  267. # inventory — including the observational portability gates this lane does
  268. # not run —
  269. # on real windows-2025. This job only provisions runner state (caches,
  270. # apt); scripts/wine-windows-gates.sh owns the gate logic and is the same
  271. # script the optional local gate `pnpm run check:windows-wine` runs.
  272. # Layout, fidelity limits, and measured timings live in
  273. # .agents/notes/implemented/process/2026-07-27-wine-windows-gates-experiment.md
  274. windows:
  275. if: github.event_name == 'pull_request'
  276. runs-on: ubuntu-latest
  277. name: windows node 24 / wine blocking
  278. timeout-minutes: 15
  279. steps:
  280. - uses: actions/checkout@v6
  281. with:
  282. persist-credentials: false
  283. - uses: pnpm/action-setup@v4
  284. with:
  285. dest: ${{ runner.temp }}/setup-pnpm
  286. - uses: actions/setup-node@v6
  287. with:
  288. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  289. - name: Configure pnpm store path
  290. id: pnpm-store
  291. run: |
  292. store_root="$HOME/.local/share/pnpm/store"
  293. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  294. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  295. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  296. - uses: actions/cache/restore@v4
  297. with:
  298. path: ${{ steps.pnpm-store.outputs.path }}
  299. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  300. restore-keys: |
  301. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  302. # Master's wine-apt-cache job seeds the default-branch scope every pull
  303. # request can read; a save from this job only reaches reruns of the
  304. # same merge ref.
  305. - name: Compose Wine apt cache key
  306. id: wine-cache-key
  307. run: echo "key=wine-debs-${ImageOS:-linux}-${ImageVersion:-v0}" >> "$GITHUB_OUTPUT"
  308. - uses: actions/cache@v4
  309. with:
  310. path: ~/wine-debs
  311. key: ${{ steps.wine-cache-key.outputs.key }}
  312. # Runner provisioning only — a developer machine installs Wine through
  313. # its own package manager; the gate script assumes a wine binary and
  314. # fails loud without one. Wine from the apt cache when present; else
  315. # download the full dependency closure once and keep it for the next
  316. # run. The `wine` dispatcher package (not bare `wine64`) is what puts a
  317. # binary on PATH.
  318. - name: Install Wine
  319. run: |
  320. if compgen -G "$HOME/wine-debs/*.deb" > /dev/null; then
  321. sudo apt-get install -y --no-install-recommends "$HOME"/wine-debs/*.deb
  322. else
  323. sudo apt-get update
  324. sudo apt-get install -y --no-install-recommends --download-only wine
  325. mkdir -p "$HOME/wine-debs"
  326. cp /var/cache/apt/archives/*.deb "$HOME/wine-debs/" 2>/dev/null || true
  327. sudo apt-get install -y --no-install-recommends wine
  328. fi
  329. - name: Run the Wine Windows gates
  330. run: bash scripts/wine-windows-gates.sh
  331. - name: Shut down wineserver
  332. if: always()
  333. run: wineserver -k 2>/dev/null || true
  334. # Master seeds the Wine apt-archive cache in the default-branch scope,
  335. # which every pull request's windows job can restore; saves from
  336. # pull-request runs are scoped to their own merge ref and help nobody
  337. # else. Runs in seconds when the image version already has a cache.
  338. wine-apt-cache:
  339. if: github.event_name == 'push' && github.ref == 'refs/heads/master'
  340. name: wine apt cache
  341. runs-on: ubuntu-latest
  342. timeout-minutes: 10
  343. steps:
  344. - name: Compose Wine apt cache key
  345. id: wine-cache-key
  346. run: echo "key=wine-debs-${ImageOS:-linux}-${ImageVersion:-v0}" >> "$GITHUB_OUTPUT"
  347. - uses: actions/cache@v4
  348. id: wine-cache
  349. with:
  350. path: ~/wine-debs
  351. key: ${{ steps.wine-cache-key.outputs.key }}
  352. - name: Download the Wine dependency closure
  353. if: steps.wine-cache.outputs.cache-hit != 'true'
  354. run: |
  355. sudo apt-get update
  356. sudo apt-get install -y --no-install-recommends --download-only wine
  357. mkdir -p "$HOME/wine-debs"
  358. cp /var/cache/apt/archives/*.deb "$HOME/wine-debs/"
  359. du -sh "$HOME/wine-debs"
  360. # The hosted reference jobs below are temporarily disabled; the self-hosted
  361. # standby remains active. Each enabled host executes the complete, unsharded
  362. # primary Node aggregate with one gate worker, giving reviewers a simple
  363. # cross-platform oracle for completeness and timing.
  364. serial-linux:
  365. if: false
  366. name: serial / linux
  367. runs-on: ubuntu-latest
  368. steps:
  369. - uses: actions/checkout@v6
  370. with:
  371. fetch-depth: 2
  372. - uses: pnpm/action-setup@v4
  373. with:
  374. dest: ${{ runner.temp }}/setup-pnpm
  375. - uses: actions/setup-node@v6
  376. with:
  377. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  378. - name: Configure pnpm store path
  379. id: pnpm-store
  380. run: |
  381. store_root="$HOME/.local/share/pnpm/store"
  382. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  383. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  384. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  385. # Master refreshes the pnpm store cache that pull requests restore without saving.
  386. # The store cache stays a hand-rolled actions/cache step rather than
  387. # setup-node's `cache: pnpm`: the enterprise pull-request jobs above
  388. # restore exactly this key and path, and setup-node's built-in cache
  389. # uses its own key format — converting this producer would silently
  390. # starve their documented restore-only optimization.
  391. - uses: actions/cache@v4
  392. with:
  393. path: ${{ steps.pnpm-store.outputs.path }}
  394. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  395. restore-keys: |
  396. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  397. # Master produces the hosted Chromium cache restored by pull requests.
  398. - uses: actions/cache@v4
  399. with:
  400. path: ~/.cache/ms-playwright
  401. key: ${{ runner.os }}-playwright-${{ hashFiles('pnpm-lock.yaml') }}
  402. restore-keys: |
  403. ${{ runner.os }}-playwright-
  404. - name: Install (immutable)
  405. run: pnpm install --frozen-lockfile
  406. - name: Install Playwright Chromium and system dependencies
  407. run: pnpm --filter @deepseek-ai/dsh-frontend exec playwright install --with-deps chromium
  408. - name: Prepare bubblewrap (unrestrict userns)
  409. run: bash scripts/prepare-ci-bubblewrap.sh
  410. - name: Run complete unsharded primary Node CI serially
  411. env:
  412. DSH_ARCHIVE_BASE_REF: ${{ github.event.before }}
  413. DSH_COVERAGE_MAX_WORKERS: '1'
  414. DSH_E2E_MAX_WORKERS: '1'
  415. DSH_GATE_CONCURRENCY: '1'
  416. DSH_OXLINT_THREADS: '1'
  417. DSH_PUBLINT_CONCURRENCY: '1'
  418. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  419. run: pnpm run check:ci:linux-primary
  420. # Hot-standby drill for the in-house self-hosted pool: every master move
  421. # re-runs the complete unsharded aggregate on the persistent 64-core VM,
  422. # continuously proving that environment can take over a required lane if
  423. # the hosted pools degrade (the switch is then setting the writer-manageable
  424. # DSH_CI_FAILOVER variable — see the failover runbook, no merge required).
  425. # Push-triggered, so this lane always executes the base branch's own
  426. # workflow definition. (Under failover, pull_request jobs do reach these
  427. # runners with the PR merge ref's workflow — the boundary there is
  428. # repository membership: private, forking disabled, Dependabot excluded.)
  429. # Non-blocking for
  430. # pull requests; no cache steps because the VM's persistent pnpm store and
  431. # tool caches make them redundant (and saving here would poison the hosted
  432. # cache namespace with self-hosted paths).
  433. serial-linux-selfhosted:
  434. if: github.event_name == 'push' && github.ref == 'refs/heads/master'
  435. name: serial / linux (self-hosted standby)
  436. runs-on: [self-hosted, linux, x64, vm-backup]
  437. steps:
  438. # Full history + DSH_ARCHIVE_BASE_REF below: same frozen-archive
  439. # comparison as serial-linux. Depth 2 would miss github.event.before
  440. # on multi-commit or force pushes; full fetch is cheap here because
  441. # checkout resolves against the VM's local mirror.
  442. - uses: actions/checkout@v6
  443. with:
  444. fetch-depth: 0
  445. - uses: pnpm/action-setup@v4
  446. with:
  447. dest: ${{ runner.temp }}/setup-pnpm
  448. - uses: actions/setup-node@v6
  449. with:
  450. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  451. - name: Configure persistent pnpm store
  452. run: echo "PNPM_CONFIG_STORE_DIR=$HOME/.local/share/pnpm/store" >> "$GITHUB_ENV"
  453. - name: Install (immutable)
  454. run: pnpm install --frozen-lockfile
  455. # The persistent VM image owns Playwright's Linux system packages; this
  456. # step also proves that browser provisioning remains usable for failover.
  457. - name: Install Playwright Chromium
  458. run: pnpm --filter @deepseek-ai/dsh-frontend exec playwright install chromium
  459. - name: Prepare bubblewrap (unrestrict userns)
  460. run: bash scripts/prepare-ci-bubblewrap.sh
  461. - name: Run complete unsharded primary Node CI serially
  462. env:
  463. DSH_ARCHIVE_BASE_REF: ${{ github.event.before }}
  464. DSH_COVERAGE_MAX_WORKERS: '1'
  465. DSH_E2E_MAX_WORKERS: '1'
  466. DSH_GATE_CONCURRENCY: '1'
  467. DSH_OXLINT_THREADS: '1'
  468. DSH_PUBLINT_CONCURRENCY: '1'
  469. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  470. run: pnpm run check:ci:linux-primary
  471. serial-macos:
  472. if: false
  473. name: serial / macos
  474. runs-on: macos-latest
  475. steps:
  476. - uses: actions/checkout@v6
  477. - uses: pnpm/action-setup@v4
  478. with:
  479. dest: ${{ runner.temp }}/setup-pnpm
  480. - uses: actions/setup-node@v6
  481. with:
  482. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  483. - name: Install (immutable)
  484. run: pnpm install --frozen-lockfile
  485. - name: Run complete unsharded primary Node CI serially
  486. env:
  487. DSH_COVERAGE_MAX_WORKERS: '1'
  488. DSH_E2E_MAX_WORKERS: '1'
  489. DSH_GATE_CONCURRENCY: '1'
  490. DSH_PUBLINT_CONCURRENCY: '1'
  491. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  492. run: pnpm run check:ci
  493. serial-windows:
  494. if: false
  495. name: serial / windows
  496. runs-on: windows-2025
  497. steps:
  498. - uses: actions/checkout@v6
  499. - name: Enable Developer Mode (symlink support)
  500. shell: pwsh
  501. run: >-
  502. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
  503. /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
  504. - uses: pnpm/action-setup@v4
  505. with:
  506. dest: ${{ runner.temp }}/setup-pnpm
  507. - uses: actions/setup-node@v6
  508. with:
  509. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  510. - name: Install (immutable)
  511. shell: pwsh
  512. run: pnpm install --frozen-lockfile
  513. - name: Run complete unsharded primary Node CI serially
  514. shell: pwsh
  515. env:
  516. DSH_COVERAGE_MAX_WORKERS: '1'
  517. DSH_E2E_MAX_WORKERS: '1'
  518. DSH_GATE_CONCURRENCY: '1'
  519. DSH_OXLINT_THREADS: '1'
  520. DSH_PUBLINT_CONCURRENCY: '1'
  521. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  522. run: pnpm run check:ci
  523. # Manual, bounded comparison of the actual critical Linux and Windows lanes.
  524. # The named pools are restricted at the organization level to this repository.
  525. larger-runner-benchmark:
  526. if: github.event_name == 'workflow_dispatch' && inputs.suite == 'larger-runner-benchmark'
  527. runs-on: ${{ matrix.runner }}
  528. timeout-minutes: 15
  529. strategy:
  530. fail-fast: false
  531. max-parallel: 12
  532. matrix:
  533. include:
  534. - platform: linux
  535. cores: '4'
  536. runner: dsh-ubuntu-24-04-4core
  537. workload: typecheck
  538. - platform: linux
  539. cores: '8'
  540. runner: dsh-ubuntu-24-04-8core
  541. workload: typecheck
  542. - platform: linux
  543. cores: '16'
  544. runner: dsh-ubuntu-24-04-16core
  545. workload: typecheck
  546. - platform: linux
  547. cores: '32'
  548. runner: dsh-ubuntu-24-04-32core
  549. workload: typecheck
  550. - platform: linux
  551. cores: '64'
  552. runner: dsh-ubuntu-24-04-64core
  553. workload: typecheck
  554. - platform: linux
  555. cores: '96'
  556. runner: dsh-ubuntu-24-04-96core
  557. workload: typecheck
  558. - platform: windows
  559. cores: '4'
  560. runner: dsh-windows-2025-4core
  561. workload: production-site
  562. - platform: windows
  563. cores: '8'
  564. runner: dsh-windows-2025-8core
  565. workload: production-site
  566. - platform: windows
  567. cores: '16'
  568. runner: dsh-windows-2025-16core
  569. workload: production-site
  570. - platform: windows
  571. cores: '32'
  572. runner: dsh-windows-2025-32core
  573. workload: production-site
  574. - platform: windows
  575. cores: '64'
  576. runner: dsh-windows-2025-64core
  577. workload: production-site
  578. - platform: windows
  579. cores: '96'
  580. runner: dsh-windows-2025-96core
  581. workload: production-site
  582. steps:
  583. - uses: actions/checkout@v6
  584. - uses: pnpm/action-setup@v4
  585. with:
  586. dest: ${{ runner.temp }}/setup-pnpm
  587. # The Windows lanes deliberately skip the store cache like the required
  588. # windows job; an empty cache input disables setup-node's caching.
  589. - uses: actions/setup-node@v6
  590. with:
  591. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  592. cache: ${{ matrix.platform == 'linux' && 'pnpm' || '' }}
  593. - name: Report runner capacity
  594. run: >-
  595. node -e "const os = require('node:os');
  596. console.log(JSON.stringify({ arch: process.arch, cpus: os.cpus().length,
  597. memoryGiB: Math.round(os.totalmem() / 2 ** 30) }))"
  598. - name: Install (immutable)
  599. run: pnpm install --frozen-lockfile
  600. - name: Run critical Linux typecheck lane
  601. if: matrix.platform == 'linux'
  602. run: pnpm run typecheck
  603. - name: Run critical Windows production-site lane
  604. if: matrix.platform == 'windows'
  605. run: pnpm run docs:build
  606. # Manual comparison of the intended low-fanout topology. Linux runs the
  607. # complete unsharded primary aggregate with bounded in-runner parallelism;
  608. # Windows runs both blocking build surfaces concurrently through run-gates.
  609. consolidated-runner-benchmark:
  610. if: github.event_name == 'workflow_dispatch' && inputs.suite == 'consolidated-runner-benchmark'
  611. runs-on: ${{ matrix.runner }}
  612. timeout-minutes: 15
  613. strategy:
  614. fail-fast: false
  615. max-parallel: 12
  616. matrix:
  617. include:
  618. - platform: linux
  619. cores: '4'
  620. runner: dsh-ubuntu-24-04-4core
  621. workers: '4'
  622. - platform: linux
  623. cores: '8'
  624. runner: dsh-ubuntu-24-04-8core
  625. workers: '8'
  626. - platform: linux
  627. cores: '16'
  628. runner: dsh-ubuntu-24-04-16core
  629. workers: '16'
  630. - platform: linux
  631. cores: '32'
  632. runner: dsh-ubuntu-24-04-32core
  633. workers: '32'
  634. - platform: linux
  635. cores: '64'
  636. runner: dsh-ubuntu-24-04-64core
  637. workers: '32'
  638. - platform: linux
  639. cores: '96'
  640. runner: dsh-ubuntu-24-04-96core
  641. workers: '32'
  642. - platform: windows
  643. cores: '4'
  644. runner: dsh-windows-2025-4core
  645. workers: '2'
  646. - platform: windows
  647. cores: '8'
  648. runner: dsh-windows-2025-8core
  649. workers: '2'
  650. - platform: windows
  651. cores: '16'
  652. runner: dsh-windows-2025-16core
  653. workers: '2'
  654. - platform: windows
  655. cores: '32'
  656. runner: dsh-windows-2025-32core
  657. workers: '2'
  658. - platform: windows
  659. cores: '64'
  660. runner: dsh-windows-2025-64core
  661. workers: '2'
  662. - platform: windows
  663. cores: '96'
  664. runner: dsh-windows-2025-96core
  665. workers: '2'
  666. steps:
  667. - uses: actions/checkout@v6
  668. - uses: pnpm/action-setup@v4
  669. with:
  670. dest: ${{ runner.temp }}/setup-pnpm
  671. # Unlike the larger-runner suite, both platforms cache the store here:
  672. # the consolidated topology measures cache mechanics as workload.
  673. - uses: actions/setup-node@v6
  674. with:
  675. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  676. cache: pnpm
  677. - name: Report runner capacity
  678. run: >-
  679. node -e "const os = require('node:os');
  680. console.log(JSON.stringify({ arch: process.arch, cpus: os.cpus().length,
  681. memoryGiB: Math.round(os.totalmem() / 2 ** 30) }))"
  682. - name: Install and prepare Linux
  683. if: matrix.platform == 'linux'
  684. run: |
  685. pnpm install --frozen-lockfile &
  686. install_pid=$!
  687. bash scripts/prepare-ci-bubblewrap.sh &
  688. sandbox_pid=$!
  689. install_status=0
  690. wait "$install_pid" || install_status=$?
  691. sandbox_status=0
  692. wait "$sandbox_pid" || sandbox_status=$?
  693. if (( install_status != 0 )); then exit "$install_status"; fi
  694. exit "$sandbox_status"
  695. - name: Install (immutable)
  696. if: matrix.platform == 'windows'
  697. shell: pwsh
  698. run: pnpm install --frozen-lockfile
  699. - name: Run complete unsharded primary Node CI concurrently
  700. if: matrix.platform == 'linux'
  701. env:
  702. DSH_COVERAGE_MAX_WORKERS: ${{ matrix.workers }}
  703. DSH_GATE_CONCURRENCY: ${{ matrix.workers }}
  704. DSH_OXLINT_THREADS: ${{ matrix.workers }}
  705. DSH_PUBLINT_CONCURRENCY: ${{ matrix.workers }}
  706. DSH_SNAPSHOT_MAX_CONCURRENCY: ${{ matrix.workers }}
  707. run: pnpm run check:ci
  708. - name: Run blocking Windows builds concurrently
  709. if: matrix.platform == 'windows'
  710. shell: pwsh
  711. env:
  712. DSH_GATE_CONCURRENCY: ${{ matrix.workers }}
  713. run: pnpm run check:ci:windows-blocking
  714. # Single stable required check for branch protection: require "all checks
  715. # passed" instead of enumerating matrix legs whose names change as lanes and
  716. # node versions evolve. Every blocking job in THIS workflow must be listed in
  717. # `needs`; observational Windows gates share the required Windows job but are
  718. # marked non-blocking inside run-gates. (`needs` cannot reach across workflow
  719. # files; e2e.yml stays its own check.)
  720. # `if: always()` is load-bearing: without it a failed dependency
  721. # would SKIP this job, and GitHub counts a skipped required check as passing
  722. # — so this job always runs and fails on any non-success result, including
  723. # 'cancelled' and 'skipped'.
  724. all-checks-passed:
  725. name: all checks passed
  726. # This bookkeeping-only verdict must not depend on custom-pool
  727. # provisioning (master's #734 moved it to ubuntu-latest) — and under
  728. # failover it follows the same selector as the worker jobs it
  729. # aggregates, so a standard-hosted outage cannot strand the
  730. # branch-protection verdict either (observed 2026-07-27).
  731. runs-on: >-
  732. ${{ vars.DSH_CI_FAILOVER == 'selfhosted'
  733. && github.event.pull_request.user.login != 'dependabot[bot]'
  734. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  735. || 'ubuntu-latest' }}
  736. needs: [node-24, node-24-coverage, node-24-consumers, node-compat, python-sdk, windows]
  737. if: always() && github.event_name == 'pull_request'
  738. steps:
  739. - name: Fail if any needed job did not succeed
  740. if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')
  741. run: |
  742. echo "::error::Needed job results: ${{ join(needs.*.result, ', ') }}"
  743. exit 1
  744. - name: All checks passed
  745. run: echo "All needed jobs succeeded (${{ join(needs.*.result, ', ') }})"