ci.yml 32 KB

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