ci.yml 32 KB

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