ci.yml 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884
  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. # The required pull-request Windows signal: the two blocking win32 surfaces
  263. # (workspace build, production site) execute with real, checksum-verified
  264. # Windows Node under Wine on standard hosted Linux. The independent
  265. # windows-native job below keeps the complete native-kernel inventory —
  266. # including the observational portability gates this lane does not run —
  267. # on real windows-2025. This job only provisions runner state (caches,
  268. # apt); scripts/wine-windows-gates.sh owns the gate logic and is the same
  269. # script the optional local gate `pnpm run check:windows-wine` runs.
  270. # Current topology and fidelity limits live in
  271. # .agents/notes/implemented/process/2026-08-08-native-windows-pull-request-ci.md
  272. windows:
  273. if: github.event_name == 'pull_request'
  274. runs-on: ubuntu-latest
  275. name: windows node 24 / wine blocking
  276. timeout-minutes: 15
  277. steps:
  278. - uses: actions/checkout@v6
  279. with:
  280. persist-credentials: false
  281. - uses: pnpm/action-setup@v4
  282. with:
  283. dest: ${{ runner.temp }}/setup-pnpm
  284. - uses: actions/setup-node@v6
  285. with:
  286. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  287. - name: Configure pnpm store path
  288. id: pnpm-store
  289. run: |
  290. store_root="$HOME/.local/share/pnpm/store"
  291. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  292. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  293. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  294. - uses: actions/cache/restore@v4
  295. with:
  296. path: ${{ steps.pnpm-store.outputs.path }}
  297. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  298. restore-keys: |
  299. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  300. # Master's wine-apt-cache job seeds the default-branch scope every pull
  301. # request can read; a save from this job only reaches reruns of the
  302. # same merge ref.
  303. - name: Compose Wine apt cache key
  304. id: wine-cache-key
  305. run: echo "key=wine-debs-${ImageOS:-linux}-${ImageVersion:-v0}" >> "$GITHUB_OUTPUT"
  306. - uses: actions/cache@v4
  307. with:
  308. path: ~/wine-debs
  309. key: ${{ steps.wine-cache-key.outputs.key }}
  310. # Runner provisioning only — a developer machine installs Wine through
  311. # its own package manager; the gate script assumes a wine binary and
  312. # fails loud without one. Wine from the apt cache when present; else
  313. # download the full dependency closure once and keep it for the next
  314. # run. The `wine` dispatcher package (not bare `wine64`) is what puts a
  315. # binary on PATH.
  316. - name: Install Wine
  317. run: |
  318. if compgen -G "$HOME/wine-debs/*.deb" > /dev/null; then
  319. sudo apt-get install -y --no-install-recommends "$HOME"/wine-debs/*.deb
  320. else
  321. sudo apt-get update
  322. sudo apt-get install -y --no-install-recommends --download-only wine
  323. mkdir -p "$HOME/wine-debs"
  324. cp /var/cache/apt/archives/*.deb "$HOME/wine-debs/" 2>/dev/null || true
  325. sudo apt-get install -y --no-install-recommends wine
  326. fi
  327. - name: Run the Wine Windows gates
  328. run: bash scripts/wine-windows-gates.sh
  329. - name: Shut down wineserver
  330. if: always()
  331. run: wineserver -k 2>/dev/null || true
  332. # Master seeds the Wine apt-archive cache in the default-branch scope,
  333. # which every pull request's windows job can restore; saves from
  334. # pull-request runs are scoped to their own merge ref and help nobody
  335. # else. Runs in seconds when the image version already has a cache.
  336. wine-apt-cache:
  337. if: github.event_name == 'push' && github.ref == 'refs/heads/master'
  338. name: wine apt cache
  339. runs-on: ubuntu-latest
  340. timeout-minutes: 10
  341. steps:
  342. - name: Compose Wine apt cache key
  343. id: wine-cache-key
  344. run: echo "key=wine-debs-${ImageOS:-linux}-${ImageVersion:-v0}" >> "$GITHUB_OUTPUT"
  345. - uses: actions/cache@v4
  346. id: wine-cache
  347. with:
  348. path: ~/wine-debs
  349. key: ${{ steps.wine-cache-key.outputs.key }}
  350. - name: Download the Wine dependency closure
  351. if: steps.wine-cache.outputs.cache-hit != 'true'
  352. run: |
  353. sudo apt-get update
  354. sudo apt-get install -y --no-install-recommends --download-only wine
  355. mkdir -p "$HOME/wine-debs"
  356. cp /var/cache/apt/archives/*.deb "$HOME/wine-debs/"
  357. du -sh "$HOME/wine-debs"
  358. # Every pull request also gets a real Windows-kernel signal. This job keeps
  359. # its own unmasked conclusion but is deliberately absent from
  360. # all-checks-passed.needs, so it never delays or changes that required verdict.
  361. # See the dual Wine/native pull-request CI decision:
  362. # .agents/notes/implemented/process/2026-08-08-native-windows-pull-request-ci.md
  363. windows-native:
  364. if: github.event_name == 'pull_request'
  365. runs-on: dsh-windows-2025-16core
  366. name: windows node 24 / native complete
  367. timeout-minutes: 60
  368. env:
  369. DSH_COVERAGE_MAX_WORKERS: '2'
  370. DSH_GATE_CONCURRENCY: '2'
  371. DSH_PUBLINT_CONCURRENCY: '8'
  372. steps:
  373. - uses: actions/checkout@v6
  374. with:
  375. persist-credentials: false
  376. - name: Enable Developer Mode (symlink support)
  377. shell: pwsh
  378. run: >-
  379. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
  380. /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
  381. - uses: pnpm/action-setup@v4
  382. with:
  383. dest: ${{ runner.temp }}/setup-pnpm
  384. - uses: actions/setup-node@v6
  385. with:
  386. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  387. # Extracting the many-file pnpm store cache is slower than a clean install,
  388. # and saving it adds more latency after the gates.
  389. - name: Install (immutable)
  390. shell: pwsh
  391. run: pnpm install --frozen-lockfile
  392. - name: Run complete native Windows gate inventory
  393. shell: pwsh
  394. run: pnpm run check:ci:windows-complete
  395. # The hosted reference jobs below are temporarily disabled; the self-hosted
  396. # standby remains active. Each enabled host executes the complete, unsharded
  397. # primary Node aggregate with one gate worker, giving reviewers a simple
  398. # cross-platform oracle for completeness and timing.
  399. serial-linux:
  400. if: false
  401. name: serial / linux
  402. runs-on: ubuntu-latest
  403. steps:
  404. - uses: actions/checkout@v6
  405. with:
  406. fetch-depth: 2
  407. - uses: pnpm/action-setup@v4
  408. with:
  409. dest: ${{ runner.temp }}/setup-pnpm
  410. - uses: actions/setup-node@v6
  411. with:
  412. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  413. - name: Configure pnpm store path
  414. id: pnpm-store
  415. run: |
  416. store_root="$HOME/.local/share/pnpm/store"
  417. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  418. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  419. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  420. # Master refreshes the pnpm store cache that pull requests restore without saving.
  421. # The store cache stays a hand-rolled actions/cache step rather than
  422. # setup-node's `cache: pnpm`: the enterprise pull-request jobs above
  423. # restore exactly this key and path, and setup-node's built-in cache
  424. # uses its own key format — converting this producer would silently
  425. # starve their documented restore-only optimization.
  426. - uses: actions/cache@v4
  427. with:
  428. path: ${{ steps.pnpm-store.outputs.path }}
  429. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  430. restore-keys: |
  431. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  432. # Master produces the hosted Chromium cache restored by pull requests.
  433. - uses: actions/cache@v4
  434. with:
  435. path: ~/.cache/ms-playwright
  436. key: ${{ runner.os }}-playwright-${{ hashFiles('pnpm-lock.yaml') }}
  437. restore-keys: |
  438. ${{ runner.os }}-playwright-
  439. - name: Install (immutable)
  440. run: pnpm install --frozen-lockfile
  441. - name: Install Playwright Chromium and system dependencies
  442. run: pnpm --filter @deepseek-ai/dsh-frontend exec playwright install --with-deps chromium
  443. - name: Prepare bubblewrap (unrestrict userns)
  444. run: bash scripts/prepare-ci-bubblewrap.sh
  445. - name: Run complete unsharded primary Node CI serially
  446. env:
  447. DSH_ARCHIVE_BASE_REF: ${{ github.event.before }}
  448. DSH_COVERAGE_MAX_WORKERS: '1'
  449. DSH_E2E_MAX_WORKERS: '1'
  450. DSH_GATE_CONCURRENCY: '1'
  451. DSH_OXLINT_THREADS: '1'
  452. DSH_PUBLINT_CONCURRENCY: '1'
  453. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  454. run: pnpm run check:ci:linux-primary
  455. # Hot-standby drill for the in-house self-hosted pool: every master move
  456. # re-runs the complete unsharded aggregate on the persistent 64-core VM,
  457. # continuously proving that environment can take over a required lane if
  458. # the hosted pools degrade (the switch is then setting the writer-manageable
  459. # DSH_CI_FAILOVER variable — see the failover runbook, no merge required).
  460. # Push-triggered, so this lane always executes the base branch's own
  461. # workflow definition. (Under failover, pull_request jobs do reach these
  462. # runners with the PR merge ref's workflow — the boundary there is
  463. # repository membership: private, forking disabled, Dependabot excluded.)
  464. # Non-blocking for
  465. # pull requests; no cache steps because the VM's persistent pnpm store and
  466. # tool caches make them redundant (and saving here would poison the hosted
  467. # cache namespace with self-hosted paths).
  468. serial-linux-selfhosted:
  469. if: github.event_name == 'push' && github.ref == 'refs/heads/master'
  470. name: serial / linux (self-hosted standby)
  471. runs-on: [self-hosted, linux, x64, vm-backup]
  472. steps:
  473. # Full history + DSH_ARCHIVE_BASE_REF below: same frozen-archive
  474. # comparison as serial-linux. Depth 2 would miss github.event.before
  475. # on multi-commit or force pushes; full fetch is cheap here because
  476. # checkout resolves against the VM's local mirror.
  477. - uses: actions/checkout@v6
  478. with:
  479. fetch-depth: 0
  480. - uses: pnpm/action-setup@v4
  481. with:
  482. dest: ${{ runner.temp }}/setup-pnpm
  483. - uses: actions/setup-node@v6
  484. with:
  485. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  486. - name: Configure persistent pnpm store
  487. run: echo "PNPM_CONFIG_STORE_DIR=$HOME/.local/share/pnpm/store" >> "$GITHUB_ENV"
  488. - name: Install (immutable)
  489. run: pnpm install --frozen-lockfile
  490. # The persistent VM image owns Playwright's Linux system packages; this
  491. # step also proves that browser provisioning remains usable for failover.
  492. - name: Install Playwright Chromium
  493. run: pnpm --filter @deepseek-ai/dsh-frontend exec playwright install chromium
  494. - name: Prepare bubblewrap (unrestrict userns)
  495. run: bash scripts/prepare-ci-bubblewrap.sh
  496. - name: Run complete unsharded primary Node CI serially
  497. env:
  498. DSH_ARCHIVE_BASE_REF: ${{ github.event.before }}
  499. DSH_COVERAGE_MAX_WORKERS: '1'
  500. DSH_E2E_MAX_WORKERS: '1'
  501. DSH_GATE_CONCURRENCY: '1'
  502. DSH_OXLINT_THREADS: '1'
  503. DSH_PUBLINT_CONCURRENCY: '1'
  504. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  505. run: pnpm run check:ci:linux-primary
  506. serial-macos:
  507. if: false
  508. name: serial / macos
  509. runs-on: macos-latest
  510. steps:
  511. - uses: actions/checkout@v6
  512. - uses: pnpm/action-setup@v4
  513. with:
  514. dest: ${{ runner.temp }}/setup-pnpm
  515. - uses: actions/setup-node@v6
  516. with:
  517. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  518. - name: Install (immutable)
  519. run: pnpm install --frozen-lockfile
  520. - name: Run complete unsharded primary Node CI serially
  521. env:
  522. DSH_COVERAGE_MAX_WORKERS: '1'
  523. DSH_E2E_MAX_WORKERS: '1'
  524. DSH_GATE_CONCURRENCY: '1'
  525. DSH_PUBLINT_CONCURRENCY: '1'
  526. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  527. run: pnpm run check:ci
  528. serial-windows:
  529. if: false
  530. name: serial / windows
  531. runs-on: windows-2025
  532. steps:
  533. - uses: actions/checkout@v6
  534. - name: Enable Developer Mode (symlink support)
  535. shell: pwsh
  536. run: >-
  537. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
  538. /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
  539. - uses: pnpm/action-setup@v4
  540. with:
  541. dest: ${{ runner.temp }}/setup-pnpm
  542. - uses: actions/setup-node@v6
  543. with:
  544. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  545. - name: Install (immutable)
  546. shell: pwsh
  547. run: pnpm install --frozen-lockfile
  548. - name: Run complete unsharded primary Node CI serially
  549. shell: pwsh
  550. env:
  551. DSH_COVERAGE_MAX_WORKERS: '1'
  552. DSH_E2E_MAX_WORKERS: '1'
  553. DSH_GATE_CONCURRENCY: '1'
  554. DSH_OXLINT_THREADS: '1'
  555. DSH_PUBLINT_CONCURRENCY: '1'
  556. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  557. run: pnpm run check:ci
  558. # Manual, bounded comparison of the actual critical Linux and Windows lanes.
  559. # The named pools are restricted at the organization level to this repository.
  560. larger-runner-benchmark:
  561. if: github.event_name == 'workflow_dispatch' && inputs.suite == 'larger-runner-benchmark'
  562. runs-on: ${{ matrix.runner }}
  563. timeout-minutes: 15
  564. strategy:
  565. fail-fast: false
  566. max-parallel: 12
  567. matrix:
  568. include:
  569. - platform: linux
  570. cores: '4'
  571. runner: dsh-ubuntu-24-04-4core
  572. workload: typecheck
  573. - platform: linux
  574. cores: '8'
  575. runner: dsh-ubuntu-24-04-8core
  576. workload: typecheck
  577. - platform: linux
  578. cores: '16'
  579. runner: dsh-ubuntu-24-04-16core
  580. workload: typecheck
  581. - platform: linux
  582. cores: '32'
  583. runner: dsh-ubuntu-24-04-32core
  584. workload: typecheck
  585. - platform: linux
  586. cores: '64'
  587. runner: dsh-ubuntu-24-04-64core
  588. workload: typecheck
  589. - platform: linux
  590. cores: '96'
  591. runner: dsh-ubuntu-24-04-96core
  592. workload: typecheck
  593. - platform: windows
  594. cores: '4'
  595. runner: dsh-windows-2025-4core
  596. workload: production-site
  597. - platform: windows
  598. cores: '8'
  599. runner: dsh-windows-2025-8core
  600. workload: production-site
  601. - platform: windows
  602. cores: '16'
  603. runner: dsh-windows-2025-16core
  604. workload: production-site
  605. - platform: windows
  606. cores: '32'
  607. runner: dsh-windows-2025-32core
  608. workload: production-site
  609. - platform: windows
  610. cores: '64'
  611. runner: dsh-windows-2025-64core
  612. workload: production-site
  613. - platform: windows
  614. cores: '96'
  615. runner: dsh-windows-2025-96core
  616. workload: production-site
  617. steps:
  618. - uses: actions/checkout@v6
  619. - uses: pnpm/action-setup@v4
  620. with:
  621. dest: ${{ runner.temp }}/setup-pnpm
  622. # The benchmark's Windows lanes deliberately skip the store cache like
  623. # the independent native Windows job; an empty input disables caching.
  624. - uses: actions/setup-node@v6
  625. with:
  626. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  627. cache: ${{ matrix.platform == 'linux' && 'pnpm' || '' }}
  628. - name: Report runner capacity
  629. run: >-
  630. node -e "const os = require('node:os');
  631. console.log(JSON.stringify({ arch: process.arch, cpus: os.cpus().length,
  632. memoryGiB: Math.round(os.totalmem() / 2 ** 30) }))"
  633. - name: Install (immutable)
  634. run: pnpm install --frozen-lockfile
  635. - name: Run critical Linux typecheck lane
  636. if: matrix.platform == 'linux'
  637. run: pnpm run typecheck
  638. - name: Run critical Windows production-site lane
  639. if: matrix.platform == 'windows'
  640. run: pnpm run docs:build
  641. # Manual comparison of the intended low-fanout topology. Linux runs the
  642. # complete unsharded primary aggregate with bounded in-runner parallelism;
  643. # Windows runs both blocking build surfaces concurrently through run-gates.
  644. consolidated-runner-benchmark:
  645. if: github.event_name == 'workflow_dispatch' && inputs.suite == 'consolidated-runner-benchmark'
  646. runs-on: ${{ matrix.runner }}
  647. timeout-minutes: 15
  648. strategy:
  649. fail-fast: false
  650. max-parallel: 12
  651. matrix:
  652. include:
  653. - platform: linux
  654. cores: '4'
  655. runner: dsh-ubuntu-24-04-4core
  656. workers: '4'
  657. - platform: linux
  658. cores: '8'
  659. runner: dsh-ubuntu-24-04-8core
  660. workers: '8'
  661. - platform: linux
  662. cores: '16'
  663. runner: dsh-ubuntu-24-04-16core
  664. workers: '16'
  665. - platform: linux
  666. cores: '32'
  667. runner: dsh-ubuntu-24-04-32core
  668. workers: '32'
  669. - platform: linux
  670. cores: '64'
  671. runner: dsh-ubuntu-24-04-64core
  672. workers: '32'
  673. - platform: linux
  674. cores: '96'
  675. runner: dsh-ubuntu-24-04-96core
  676. workers: '32'
  677. - platform: windows
  678. cores: '4'
  679. runner: dsh-windows-2025-4core
  680. workers: '2'
  681. - platform: windows
  682. cores: '8'
  683. runner: dsh-windows-2025-8core
  684. workers: '2'
  685. - platform: windows
  686. cores: '16'
  687. runner: dsh-windows-2025-16core
  688. workers: '2'
  689. - platform: windows
  690. cores: '32'
  691. runner: dsh-windows-2025-32core
  692. workers: '2'
  693. - platform: windows
  694. cores: '64'
  695. runner: dsh-windows-2025-64core
  696. workers: '2'
  697. - platform: windows
  698. cores: '96'
  699. runner: dsh-windows-2025-96core
  700. workers: '2'
  701. steps:
  702. - uses: actions/checkout@v6
  703. - uses: pnpm/action-setup@v4
  704. with:
  705. dest: ${{ runner.temp }}/setup-pnpm
  706. # Unlike the larger-runner suite, both platforms cache the store here:
  707. # the consolidated topology measures cache mechanics as workload.
  708. - uses: actions/setup-node@v6
  709. with:
  710. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  711. cache: pnpm
  712. - name: Report runner capacity
  713. run: >-
  714. node -e "const os = require('node:os');
  715. console.log(JSON.stringify({ arch: process.arch, cpus: os.cpus().length,
  716. memoryGiB: Math.round(os.totalmem() / 2 ** 30) }))"
  717. - name: Install and prepare Linux
  718. if: matrix.platform == 'linux'
  719. run: |
  720. pnpm install --frozen-lockfile &
  721. install_pid=$!
  722. bash scripts/prepare-ci-bubblewrap.sh &
  723. sandbox_pid=$!
  724. install_status=0
  725. wait "$install_pid" || install_status=$?
  726. sandbox_status=0
  727. wait "$sandbox_pid" || sandbox_status=$?
  728. if (( install_status != 0 )); then exit "$install_status"; fi
  729. exit "$sandbox_status"
  730. - name: Install (immutable)
  731. if: matrix.platform == 'windows'
  732. shell: pwsh
  733. run: pnpm install --frozen-lockfile
  734. - name: Run complete unsharded primary Node CI concurrently
  735. if: matrix.platform == 'linux'
  736. env:
  737. DSH_COVERAGE_MAX_WORKERS: ${{ matrix.workers }}
  738. DSH_GATE_CONCURRENCY: ${{ matrix.workers }}
  739. DSH_OXLINT_THREADS: ${{ matrix.workers }}
  740. DSH_PUBLINT_CONCURRENCY: ${{ matrix.workers }}
  741. DSH_SNAPSHOT_MAX_CONCURRENCY: ${{ matrix.workers }}
  742. run: pnpm run check:ci
  743. - name: Run blocking Windows builds concurrently
  744. if: matrix.platform == 'windows'
  745. shell: pwsh
  746. env:
  747. DSH_GATE_CONCURRENCY: ${{ matrix.workers }}
  748. run: pnpm run check:ci:windows-blocking
  749. # Single stable required check for branch protection: require "all checks
  750. # passed" instead of enumerating matrix legs whose names change as lanes and
  751. # node versions evolve. Every blocking job in THIS workflow must be listed in
  752. # `needs`. The required Wine job is listed as `windows`; `windows-native` is
  753. # deliberately absent so its independent result never delays or changes this
  754. # verdict. (`needs` cannot reach across workflow files; e2e.yml stays its own
  755. # check.)
  756. # `if: always()` is load-bearing: without it a failed dependency
  757. # would SKIP this job, and GitHub counts a skipped required check as passing
  758. # — so this job always runs and fails on any non-success result, including
  759. # 'cancelled' and 'skipped'.
  760. all-checks-passed:
  761. name: all checks passed
  762. # This bookkeeping-only verdict must not depend on custom-pool
  763. # provisioning — and under failover it follows the same selector as the
  764. # worker jobs it aggregates, so a standard-hosted outage cannot strand
  765. # the branch-protection verdict either.
  766. runs-on: >-
  767. ${{ vars.DSH_CI_FAILOVER == 'selfhosted'
  768. && github.event.pull_request.user.login != 'dependabot[bot]'
  769. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  770. || 'ubuntu-latest' }}
  771. needs: [node-24, node-24-coverage, node-24-consumers, node-compat, python-sdk, windows]
  772. if: always() && github.event_name == 'pull_request'
  773. steps:
  774. - name: Fail if any needed job did not succeed
  775. if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')
  776. run: |
  777. echo "::error::Needed job results: ${{ join(needs.*.result, ', ') }}"
  778. exit 1
  779. - name: All checks passed
  780. run: echo "All needed jobs succeeded (${{ join(needs.*.result, ', ') }})"