ci.yml 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890
  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. node-24:
  28. if: github.event_name == 'pull_request'
  29. runs-on: dsh-enterprise-ubuntu-latest-32core-test
  30. name: node 24 / static
  31. env:
  32. DSH_GATE_CONCURRENCY: '8'
  33. steps:
  34. # Fetch complete history so the archive gate can read the trusted PR base from a reused shallow checkout.
  35. - uses: actions/checkout@v6
  36. with:
  37. fetch-depth: 0
  38. persist-credentials: false
  39. # Pull requests consume the default-branch cache but do not put cache
  40. # compression and upload on the paid latency-critical path.
  41. - uses: actions/cache/restore@v4
  42. with:
  43. path: /home/runner/.local/share/pnpm/store/v11
  44. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  45. restore-keys: |
  46. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  47. - uses: actions/setup-node@v6
  48. with:
  49. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  50. - name: Enable corepack and install dependencies
  51. run: |
  52. corepack enable
  53. pnpm install --frozen-lockfile
  54. - name: Run static gates
  55. env:
  56. DSH_ARCHIVE_BASE_REF: ${{ github.event.pull_request.base.sha }}
  57. run: pnpm run check:ci:static
  58. - name: Pack built tree
  59. run: >-
  60. tar -czf "$RUNNER_TEMP/node-24-built-tree.tar.gz"
  61. apps/*/lib packages/*/*/lib vendor/*/lib
  62. - uses: actions/upload-artifact@v6
  63. with:
  64. name: node-24-built-tree
  65. path: ${{ runner.temp }}/node-24-built-tree.tar.gz
  66. if-no-files-found: error
  67. retention-days: 1
  68. compression-level: 0
  69. node-24-coverage:
  70. if: github.event_name == 'pull_request'
  71. runs-on: dsh-enterprise-ubuntu-24-04-32core-test
  72. name: node 24 / coverage
  73. env:
  74. DSH_COVERAGE_MAX_WORKERS: '24'
  75. DSH_GATE_CONCURRENCY: '8'
  76. steps:
  77. - uses: actions/checkout@v6
  78. with:
  79. persist-credentials: false
  80. - uses: actions/cache/restore@v4
  81. with:
  82. path: /home/runner/.local/share/pnpm/store/v11
  83. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  84. restore-keys: |
  85. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  86. - uses: actions/setup-node@v6
  87. with:
  88. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  89. - name: Enable corepack, install dependencies, and prepare bubblewrap
  90. run: |
  91. corepack enable
  92. pnpm install --frozen-lockfile &
  93. install_pid=$!
  94. bash scripts/prepare-ci-bubblewrap.sh &
  95. sandbox_pid=$!
  96. install_status=0
  97. wait "$install_pid" || install_status=$?
  98. sandbox_status=0
  99. wait "$sandbox_pid" || sandbox_status=$?
  100. if (( install_status != 0 )); then exit "$install_status"; fi
  101. exit "$sandbox_status"
  102. - name: Run exhaustive coverage
  103. run: pnpm run check:ci:coverage
  104. node-24-consumers:
  105. needs: node-24
  106. if: github.event_name == 'pull_request'
  107. runs-on: dsh-enterprise-ubuntu-latest-32core-test
  108. name: node 24 / snapshots and artifacts
  109. env:
  110. DSH_ESLINT_CACHE: '1'
  111. DSH_ESLINT_CONCURRENCY: '8'
  112. DSH_GATE_CONCURRENCY: '8'
  113. DSH_NODE_COMPAT_SKIP_TYPECHECK: '1'
  114. DSH_PUBLINT_CONCURRENCY: '8'
  115. DSH_SNAPSHOT_MAX_CONCURRENCY: '32'
  116. steps:
  117. - uses: actions/checkout@v6
  118. with:
  119. persist-credentials: false
  120. - uses: actions/download-artifact@v8
  121. with:
  122. name: node-24-built-tree
  123. path: ${{ runner.temp }}
  124. - name: Restore built tree
  125. run: tar -xzf "$RUNNER_TEMP/node-24-built-tree.tar.gz"
  126. - uses: actions/cache/restore@v4
  127. with:
  128. path: /home/runner/.local/share/pnpm/store/v11
  129. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  130. restore-keys: |
  131. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  132. - uses: actions/cache/restore@v4
  133. with:
  134. path: .cache/eslint
  135. 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') }}
  136. restore-keys: |
  137. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-eslint-full-
  138. - uses: actions/setup-node@v6
  139. with:
  140. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  141. - name: Enable corepack, install dependencies, and prepare bubblewrap
  142. run: |
  143. corepack enable
  144. pnpm install --frozen-lockfile &
  145. install_pid=$!
  146. bash scripts/prepare-ci-bubblewrap.sh &
  147. sandbox_pid=$!
  148. install_status=0
  149. wait "$install_pid" || install_status=$?
  150. sandbox_status=0
  151. wait "$sandbox_pid" || sandbox_status=$?
  152. if (( install_status != 0 )); then exit "$install_status"; fi
  153. exit "$sandbox_status"
  154. - name: Run compatibility, snapshot, and artifact gates
  155. run: |
  156. pnpm run check:ci:lint &
  157. lint_pid=$!
  158. pnpm run check:node-compat &
  159. compat_pid=$!
  160. DSH_EXAMPLE_MODE=lib pnpm run test:snapshot &
  161. snapshot_pid=$!
  162. pnpm run publint &
  163. publint_pid=$!
  164. pnpm run verify-node-next-types &
  165. node_next_pid=$!
  166. pnpm run verify-built-package-invariants &
  167. built_invariants_pid=$!
  168. DSH_EXAMPLE_MODE=lib pnpm exec vitest run --config vitest.e2e.config.ts \
  169. examples/headless-agent/tests/keyless-smoke.e2e.ts \
  170. examples/tui-agent/tests/tui-keyless-smoke.e2e.ts \
  171. packages/examples/cli-demo/tests/built-bin.e2e.ts \
  172. packages/examples/acp-demo/tests/built-bin.e2e.ts \
  173. packages/ui/jsonrpc/tests/built-scope-carrier.e2e.ts \
  174. packages/workflow/workflow-workerthread/tests/built-worker.e2e.ts \
  175. packages/code-runtime/code-runtime-worker/tests/built-lib.e2e.ts &
  176. built_bin_pid=$!
  177. final_status=0
  178. capture_status() {
  179. local child_status=0
  180. wait "$1" || child_status=$?
  181. if (( final_status == 0 && child_status != 0 )); then
  182. final_status=$child_status
  183. fi
  184. }
  185. for child_pid in \
  186. "$lint_pid" "$compat_pid" "$snapshot_pid" \
  187. "$publint_pid" "$node_next_pid" "$built_invariants_pid" "$built_bin_pid"
  188. do
  189. capture_status "$child_pid"
  190. done
  191. exit "$final_status"
  192. node-compat:
  193. if: github.event_name == 'pull_request'
  194. # Each compatibility contract receives an independent standard hosted job.
  195. runs-on: ${{ matrix.runner }}
  196. name: ${{ matrix.name }}
  197. env:
  198. DSH_GATE_CONCURRENCY: ${{ matrix.gate_concurrency }}
  199. DSH_NODE_COMPAT_SKIP_TYPECHECK: '1'
  200. strategy:
  201. fail-fast: false
  202. matrix:
  203. include:
  204. - node: '22.19'
  205. name: node 22.19
  206. runner: ubuntu-latest
  207. gate_concurrency: '1'
  208. - node: 26
  209. name: node 26
  210. runner: ubuntu-latest
  211. gate_concurrency: '1'
  212. steps:
  213. - uses: actions/checkout@v6
  214. - uses: actions/setup-node@v6
  215. with:
  216. node-version: ${{ matrix.node }}
  217. - name: Enable corepack and resolve pnpm store path
  218. id: pnpm-store
  219. run: |
  220. corepack enable
  221. echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
  222. - uses: actions/cache@v4
  223. with:
  224. path: ${{ steps.pnpm-store.outputs.path }}
  225. key: ${{ runner.os }}-node-${{ matrix.node }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  226. restore-keys: |
  227. ${{ runner.os }}-node-${{ matrix.node }}-pnpm-
  228. - name: Install (immutable)
  229. run: pnpm install --frozen-lockfile
  230. - name: Run compatibility smokes
  231. run: pnpm run check:node-compat
  232. python-sdk:
  233. if: github.event_name == 'pull_request'
  234. runs-on: ubuntu-latest
  235. name: python 3.10 / keyless SDK
  236. steps:
  237. - uses: actions/checkout@v6
  238. - uses: actions/setup-python@v6
  239. with:
  240. python-version: '3.10'
  241. cache: pip
  242. - name: Install uv
  243. run: python -m pip install uv==0.11.23
  244. - name: Run complete keyless Python suite
  245. run: uv run --python 3.10 --group test --project python/sdk pytest
  246. # The required pull-request Windows signal: the two blocking win32 surfaces
  247. # (workspace build, production site) execute with real, checksum-verified
  248. # Windows Node under Wine on standard hosted Linux. The master
  249. # serial-windows job below keeps the complete native-kernel inventory —
  250. # including the observational portability gates this lane does not run —
  251. # on real windows-2025. Direct tool entrypoints stand in for pnpm's cmd
  252. # shims, which a Linux-side install does not create; layout, fidelity
  253. # limits, and measured timings live in
  254. # .agents/notes/implemented/process/2026-07-27-wine-windows-gates-experiment.md
  255. windows:
  256. if: github.event_name == 'pull_request'
  257. runs-on: ubuntu-latest
  258. name: windows node 24 / wine blocking
  259. timeout-minutes: 15
  260. env:
  261. WINEDEBUG: '-all'
  262. WINEARCH: win64
  263. # Skip Wine Mono / Gecko installers: Node needs neither.
  264. WINEDLLOVERRIDES: 'mscoree,mshtml='
  265. steps:
  266. - uses: actions/checkout@v6
  267. with:
  268. persist-credentials: false
  269. - uses: actions/setup-node@v6
  270. with:
  271. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  272. - uses: actions/cache/restore@v4
  273. with:
  274. path: /home/runner/.local/share/pnpm/store/v11
  275. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  276. restore-keys: |
  277. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  278. # Master's wine-apt-cache job seeds the default-branch scope every pull
  279. # request can read; a save from this job only reaches reruns of the
  280. # same merge ref.
  281. - name: Compose Wine apt cache key
  282. id: wine-cache-key
  283. run: echo "key=wine-debs-${ImageOS:-linux}-${ImageVersion:-v0}" >> "$GITHUB_OUTPUT"
  284. - uses: actions/cache@v4
  285. with:
  286. path: ~/wine-debs
  287. key: ${{ steps.wine-cache-key.outputs.key }}
  288. - name: Install dependencies and provision Wine concurrently
  289. run: |
  290. corepack enable
  291. # Windows-lane install-time overrides. supportedArchitectures
  292. # additionally materializes the win32-x64 platform packages
  293. # (@esbuild/win32-x64, rolldown and rollup MSVC bindings) the
  294. # Windows toolchain resolves at runtime; nodeLinker: hoisted lays
  295. # node_modules out flat with real files because Windows Node under
  296. # Wine does not realpath pnpm's isolated-layout symlinks. Neither
  297. # override is recorded in the lockfile, so --frozen-lockfile stays
  298. # valid. --ignore-scripts skips Linux lifecycle scripts no gate in
  299. # this lane loads; the win32 binaries ship prebuilt.
  300. cat >> pnpm-workspace.yaml <<'EOF'
  301. nodeLinker: hoisted
  302. supportedArchitectures:
  303. os: [current, win32]
  304. cpu: [current, x64]
  305. EOF
  306. pnpm install --frozen-lockfile --ignore-scripts &
  307. install_pid=$!
  308. provision_wine() {
  309. set -euo pipefail
  310. # Wine from the apt cache when present; else download the full
  311. # dependency closure once and keep it for the next run. The
  312. # `wine` dispatcher package (not bare `wine64`) is what puts a
  313. # binary on PATH.
  314. if compgen -G "$HOME/wine-debs/*.deb" > /dev/null; then
  315. sudo apt-get install -y --no-install-recommends "$HOME"/wine-debs/*.deb
  316. else
  317. sudo apt-get update
  318. sudo apt-get install -y --no-install-recommends --download-only wine
  319. mkdir -p "$HOME/wine-debs"
  320. cp /var/cache/apt/archives/*.deb "$HOME/wine-debs/" 2>/dev/null || true
  321. sudo apt-get install -y --no-install-recommends wine
  322. fi
  323. WINE_BIN=''
  324. for candidate in "$(command -v wine || true)" "$(command -v wine64 || true)" /usr/lib/wine/wine64; do
  325. if [ -n "$candidate" ] && [ -x "$candidate" ]; then WINE_BIN="$candidate"; break; fi
  326. done
  327. [ -n "$WINE_BIN" ] || { echo '::error::no wine binary found after install'; exit 1; }
  328. echo "WINE_BIN=$WINE_BIN" >> "$GITHUB_ENV"
  329. # Windows Node for the repo's primary line, checksum-verified
  330. # against the same dist directory.
  331. version=$(curl -fsSL https://nodejs.org/dist/index.json \
  332. | jq -r --arg p "v${PRIMARY_NODE_VERSION}." '[.[] | select(.version | startswith($p))][0].version')
  333. echo "Windows Node: $version"
  334. curl -fsSL -o "$RUNNER_TEMP/node-win.zip" \
  335. "https://nodejs.org/dist/${version}/node-${version}-win-x64.zip"
  336. curl -fsSL "https://nodejs.org/dist/${version}/SHASUMS256.txt" \
  337. | awk -v a="node-${version}-win-x64.zip" '$2 == a { print $1 " '"$RUNNER_TEMP"'/node-win.zip" }' \
  338. | sha256sum --check -
  339. unzip -q "$RUNNER_TEMP/node-win.zip" -d "$RUNNER_TEMP/node-win"
  340. echo "NODE_WIN=$RUNNER_TEMP/node-win/node-${version}-win-x64/node.exe" >> "$GITHUB_ENV"
  341. "$WINE_BIN" wineboot --init || true
  342. wineserver -w || true
  343. }
  344. provision_wine &
  345. wine_pid=$!
  346. install_status=0
  347. wait "$install_pid" || install_status=$?
  348. wine_status=0
  349. wait "$wine_pid" || wine_status=$?
  350. if (( install_status != 0 )); then exit "$install_status"; fi
  351. exit "$wine_status"
  352. - name: Resolve entrypoints, link vue, smoke Windows Node
  353. run: |
  354. # Node under Wine cannot attach stdio to the Actions runner's pipes
  355. # (Socket open EBADF at bootstrap), so every invocation runs through
  356. # this wrapper: stdio to a regular file, replayed after exit.
  357. cat > "$RUNNER_TEMP/wine-node.sh" <<'SH'
  358. #!/usr/bin/env bash
  359. set -u
  360. log="$1"; shift
  361. "$WINE_BIN" "$NODE_WIN" "$@" < /dev/null > "$log" 2>&1
  362. status=$?
  363. tail -n 300 "$log"
  364. exit "$status"
  365. SH
  366. chmod +x "$RUNNER_TEMP/wine-node.sh"
  367. resolve() {
  368. local name="$1"; shift
  369. for p in "$@"; do
  370. if [ -f "$p" ]; then echo "$name=$PWD/$p" >> "$GITHUB_ENV"; return 0; fi
  371. done
  372. echo "::error::$name not found at any of: $*"; return 1
  373. }
  374. resolve TSC_JS node_modules/typescript/bin/tsc
  375. resolve TSDOWN_JS node_modules/tsdown/dist/run.mjs
  376. resolve VITEPRESS_JS website/node_modules/vitepress/bin/vitepress.js node_modules/vitepress/bin/vitepress.js
  377. # VitePress links vue into the site's node_modules at build time;
  378. # Wine cannot CREATE Windows symlinks (ENOTSUP) but follows
  379. # pre-existing Unix ones, so lay the link down host-side.
  380. if [ -d node_modules/vue ] && [ ! -e website/node_modules/vue ]; then
  381. mkdir -p website/node_modules
  382. ln -s ../../node_modules/vue website/node_modules/vue
  383. fi
  384. "$RUNNER_TEMP/wine-node.sh" "$RUNNER_TEMP/smoke.log" -p "'smoke: ' + process.platform + ' ' + process.arch + ' ' + process.version"
  385. # The two blocking surfaces run concurrently, the same shape run-gates
  386. # gives ci-windows-blocking on native Windows: `build` = tsc -b then
  387. # tsdown, `production site` = the VitePress build. Both statuses are
  388. # captured so one failure cannot hide the other's result.
  389. - name: Run blocking Windows gates concurrently under Wine
  390. run: |
  391. build_gate() {
  392. "$RUNNER_TEMP/wine-node.sh" "$RUNNER_TEMP/tsc.log" "$TSC_JS" -b --pretty false || return $?
  393. "$RUNNER_TEMP/wine-node.sh" "$RUNNER_TEMP/tsdown.log" "$TSDOWN_JS"
  394. }
  395. site_gate() {
  396. cd website
  397. "$RUNNER_TEMP/wine-node.sh" "$RUNNER_TEMP/site.log" "$VITEPRESS_JS" build .
  398. }
  399. start=$SECONDS
  400. build_gate > "$RUNNER_TEMP/build-gate.out" 2>&1 &
  401. build_pid=$!
  402. site_gate > "$RUNNER_TEMP/site-gate.out" 2>&1 &
  403. site_pid=$!
  404. build_status=0
  405. wait "$build_pid" || build_status=$?
  406. site_status=0
  407. wait "$site_pid" || site_status=$?
  408. echo "== build gate (exit $build_status, $((SECONDS - start))s elapsed) =="
  409. tail -n 120 "$RUNNER_TEMP/build-gate.out"
  410. echo "== production site gate (exit $site_status, $((SECONDS - start))s elapsed) =="
  411. tail -n 120 "$RUNNER_TEMP/site-gate.out"
  412. if (( build_status != 0 )); then exit "$build_status"; fi
  413. exit "$site_status"
  414. - name: Shut down wineserver
  415. if: always()
  416. run: wineserver -k 2>/dev/null || true
  417. # Master seeds the Wine apt-archive cache in the default-branch scope,
  418. # which every pull request's windows job can restore; saves from
  419. # pull-request runs are scoped to their own merge ref and help nobody
  420. # else. Runs in seconds when the image version already has a cache.
  421. wine-apt-cache:
  422. if: github.event_name == 'push' && github.ref == 'refs/heads/master'
  423. name: wine apt cache
  424. runs-on: ubuntu-latest
  425. timeout-minutes: 10
  426. steps:
  427. - name: Compose Wine apt cache key
  428. id: wine-cache-key
  429. run: echo "key=wine-debs-${ImageOS:-linux}-${ImageVersion:-v0}" >> "$GITHUB_OUTPUT"
  430. - uses: actions/cache@v4
  431. id: wine-cache
  432. with:
  433. path: ~/wine-debs
  434. key: ${{ steps.wine-cache-key.outputs.key }}
  435. - name: Download the Wine dependency closure
  436. if: steps.wine-cache.outputs.cache-hit != 'true'
  437. run: |
  438. sudo apt-get update
  439. sudo apt-get install -y --no-install-recommends --download-only wine
  440. mkdir -p "$HOME/wine-debs"
  441. cp /var/cache/apt/archives/*.deb "$HOME/wine-debs/"
  442. du -sh "$HOME/wine-debs"
  443. # Master pushes run only the serial reference jobs below.
  444. # Each host executes the complete, unsharded primary Node aggregate with one
  445. # gate worker, giving reviewers a simple cross-platform oracle for completeness
  446. # and timing.
  447. serial-linux:
  448. if: github.event_name == 'push' && github.ref == 'refs/heads/master'
  449. name: serial / linux
  450. runs-on: ubuntu-latest
  451. steps:
  452. - uses: actions/checkout@v6
  453. with:
  454. fetch-depth: 2
  455. - uses: actions/setup-node@v6
  456. with:
  457. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  458. - name: Enable corepack and resolve pnpm store path
  459. id: pnpm-store
  460. run: |
  461. corepack enable
  462. echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
  463. # Master refreshes the caches that pull requests restore without saving.
  464. - uses: actions/cache@v4
  465. with:
  466. path: ${{ steps.pnpm-store.outputs.path }}
  467. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  468. restore-keys: |
  469. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  470. - uses: actions/cache@v4
  471. with:
  472. path: .cache/eslint
  473. 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') }}
  474. restore-keys: |
  475. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-eslint-full-
  476. - name: Install (immutable)
  477. run: pnpm install --frozen-lockfile
  478. - name: Prepare bubblewrap (unrestrict userns)
  479. run: bash scripts/prepare-ci-bubblewrap.sh
  480. - name: Run complete unsharded primary Node CI serially
  481. env:
  482. DSH_ARCHIVE_BASE_REF: ${{ github.event.before }}
  483. DSH_COVERAGE_MAX_WORKERS: '1'
  484. DSH_E2E_MAX_WORKERS: '1'
  485. DSH_ESLINT_CACHE: '1'
  486. DSH_GATE_CONCURRENCY: '1'
  487. DSH_PUBLINT_CONCURRENCY: '1'
  488. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  489. run: pnpm run check:ci
  490. serial-macos:
  491. if: github.event_name == 'push' && github.ref == 'refs/heads/master'
  492. name: serial / macos
  493. runs-on: macos-latest
  494. steps:
  495. - uses: actions/checkout@v6
  496. - uses: actions/setup-node@v6
  497. with:
  498. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  499. - name: Enable corepack (pnpm)
  500. run: corepack enable
  501. - name: Install (immutable)
  502. run: pnpm install --frozen-lockfile
  503. - name: Run complete unsharded primary Node CI serially
  504. env:
  505. DSH_COVERAGE_MAX_WORKERS: '1'
  506. DSH_E2E_MAX_WORKERS: '1'
  507. DSH_GATE_CONCURRENCY: '1'
  508. DSH_PUBLINT_CONCURRENCY: '1'
  509. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  510. run: pnpm run check:ci
  511. serial-windows:
  512. if: github.event_name == 'push' && github.ref == 'refs/heads/master'
  513. name: serial / windows
  514. runs-on: windows-2025
  515. steps:
  516. - uses: actions/checkout@v6
  517. - name: Enable Developer Mode (symlink support)
  518. shell: pwsh
  519. run: >-
  520. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
  521. /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
  522. - uses: actions/setup-node@v6
  523. with:
  524. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  525. - name: Enable corepack (pnpm)
  526. shell: pwsh
  527. run: corepack enable
  528. # Master refreshes the small cache that pull requests restore without
  529. # putting package-store extraction back on the Windows critical path.
  530. - uses: actions/cache@v4
  531. with:
  532. path: .cache/eslint
  533. 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') }}
  534. restore-keys: |
  535. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-eslint-full-
  536. - name: Install (immutable)
  537. shell: pwsh
  538. run: pnpm install --frozen-lockfile
  539. - name: Run complete unsharded primary Node CI serially
  540. shell: pwsh
  541. env:
  542. DSH_COVERAGE_MAX_WORKERS: '1'
  543. DSH_E2E_MAX_WORKERS: '1'
  544. DSH_ESLINT_CACHE: '1'
  545. DSH_GATE_CONCURRENCY: '1'
  546. DSH_PUBLINT_CONCURRENCY: '1'
  547. DSH_SNAPSHOT_MAX_CONCURRENCY: '1'
  548. run: pnpm run check:ci
  549. # Manual, bounded comparison of the actual critical Linux and Windows lanes.
  550. # The named pools are restricted at the organization level to this repository.
  551. larger-runner-benchmark:
  552. if: github.event_name == 'workflow_dispatch' && inputs.suite == 'larger-runner-benchmark'
  553. runs-on: ${{ matrix.runner }}
  554. timeout-minutes: 15
  555. strategy:
  556. fail-fast: false
  557. max-parallel: 12
  558. matrix:
  559. include:
  560. - platform: linux
  561. cores: '4'
  562. runner: dsh-ubuntu-24-04-4core
  563. workload: typecheck
  564. - platform: linux
  565. cores: '8'
  566. runner: dsh-ubuntu-24-04-8core
  567. workload: typecheck
  568. - platform: linux
  569. cores: '16'
  570. runner: dsh-ubuntu-24-04-16core
  571. workload: typecheck
  572. - platform: linux
  573. cores: '32'
  574. runner: dsh-ubuntu-24-04-32core
  575. workload: typecheck
  576. - platform: linux
  577. cores: '64'
  578. runner: dsh-ubuntu-24-04-64core
  579. workload: typecheck
  580. - platform: linux
  581. cores: '96'
  582. runner: dsh-ubuntu-24-04-96core
  583. workload: typecheck
  584. - platform: windows
  585. cores: '4'
  586. runner: dsh-windows-2025-4core
  587. workload: production-site
  588. - platform: windows
  589. cores: '8'
  590. runner: dsh-windows-2025-8core
  591. workload: production-site
  592. - platform: windows
  593. cores: '16'
  594. runner: dsh-windows-2025-16core
  595. workload: production-site
  596. - platform: windows
  597. cores: '32'
  598. runner: dsh-windows-2025-32core
  599. workload: production-site
  600. - platform: windows
  601. cores: '64'
  602. runner: dsh-windows-2025-64core
  603. workload: production-site
  604. - platform: windows
  605. cores: '96'
  606. runner: dsh-windows-2025-96core
  607. workload: production-site
  608. steps:
  609. - uses: actions/checkout@v6
  610. - uses: actions/setup-node@v6
  611. with:
  612. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  613. - name: Report runner capacity
  614. run: >-
  615. node -e "const os = require('node:os');
  616. console.log(JSON.stringify({ arch: process.arch, cpus: os.cpus().length,
  617. memoryGiB: Math.round(os.totalmem() / 2 ** 30) }))"
  618. - name: Enable corepack (pnpm)
  619. run: corepack enable
  620. - name: Resolve pnpm store path
  621. if: matrix.platform == 'linux'
  622. id: pnpm-store
  623. run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
  624. - uses: actions/cache@v4
  625. if: matrix.platform == 'linux'
  626. with:
  627. path: ${{ steps.pnpm-store.outputs.path }}
  628. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  629. restore-keys: |
  630. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  631. - name: Install (immutable)
  632. run: pnpm install --frozen-lockfile
  633. - name: Run critical Linux typecheck lane
  634. if: matrix.platform == 'linux'
  635. run: pnpm run typecheck
  636. - name: Run critical Windows production-site lane
  637. if: matrix.platform == 'windows'
  638. run: pnpm run docs:build
  639. # Manual comparison of the intended low-fanout topology. Linux runs the
  640. # complete unsharded primary aggregate with bounded in-runner parallelism;
  641. # Windows runs both blocking build surfaces concurrently through run-gates.
  642. consolidated-runner-benchmark:
  643. if: github.event_name == 'workflow_dispatch' && inputs.suite == 'consolidated-runner-benchmark'
  644. runs-on: ${{ matrix.runner }}
  645. timeout-minutes: 15
  646. strategy:
  647. fail-fast: false
  648. max-parallel: 12
  649. matrix:
  650. include:
  651. - platform: linux
  652. cores: '4'
  653. runner: dsh-ubuntu-24-04-4core
  654. workers: '4'
  655. - platform: linux
  656. cores: '8'
  657. runner: dsh-ubuntu-24-04-8core
  658. workers: '8'
  659. - platform: linux
  660. cores: '16'
  661. runner: dsh-ubuntu-24-04-16core
  662. workers: '16'
  663. - platform: linux
  664. cores: '32'
  665. runner: dsh-ubuntu-24-04-32core
  666. workers: '32'
  667. - platform: linux
  668. cores: '64'
  669. runner: dsh-ubuntu-24-04-64core
  670. workers: '32'
  671. - platform: linux
  672. cores: '96'
  673. runner: dsh-ubuntu-24-04-96core
  674. workers: '32'
  675. - platform: windows
  676. cores: '4'
  677. runner: dsh-windows-2025-4core
  678. workers: '2'
  679. - platform: windows
  680. cores: '8'
  681. runner: dsh-windows-2025-8core
  682. workers: '2'
  683. - platform: windows
  684. cores: '16'
  685. runner: dsh-windows-2025-16core
  686. workers: '2'
  687. - platform: windows
  688. cores: '32'
  689. runner: dsh-windows-2025-32core
  690. workers: '2'
  691. - platform: windows
  692. cores: '64'
  693. runner: dsh-windows-2025-64core
  694. workers: '2'
  695. - platform: windows
  696. cores: '96'
  697. runner: dsh-windows-2025-96core
  698. workers: '2'
  699. steps:
  700. - uses: actions/checkout@v6
  701. - uses: actions/setup-node@v6
  702. with:
  703. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  704. - name: Report runner capacity
  705. run: >-
  706. node -e "const os = require('node:os');
  707. console.log(JSON.stringify({ arch: process.arch, cpus: os.cpus().length,
  708. memoryGiB: Math.round(os.totalmem() / 2 ** 30) }))"
  709. - name: Enable corepack (pnpm)
  710. run: corepack enable
  711. - name: Resolve pnpm store path (Linux)
  712. if: matrix.platform == 'linux'
  713. id: pnpm-store-linux
  714. run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
  715. - name: Resolve pnpm store path (Windows)
  716. if: matrix.platform == 'windows'
  717. id: pnpm-store-windows
  718. shell: pwsh
  719. run: '"path=$(pnpm store path --silent)" >> $env:GITHUB_OUTPUT'
  720. - uses: actions/cache@v4
  721. with:
  722. path: ${{ steps.pnpm-store-linux.outputs.path || steps.pnpm-store-windows.outputs.path }}
  723. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  724. restore-keys: |
  725. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  726. - uses: actions/cache@v4
  727. if: matrix.platform == 'linux'
  728. with:
  729. path: .cache/eslint
  730. 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') }}
  731. restore-keys: |
  732. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-eslint-full-
  733. - name: Install and prepare Linux
  734. if: matrix.platform == 'linux'
  735. run: |
  736. pnpm install --frozen-lockfile &
  737. install_pid=$!
  738. bash scripts/prepare-ci-bubblewrap.sh &
  739. sandbox_pid=$!
  740. install_status=0
  741. wait "$install_pid" || install_status=$?
  742. sandbox_status=0
  743. wait "$sandbox_pid" || sandbox_status=$?
  744. if (( install_status != 0 )); then exit "$install_status"; fi
  745. exit "$sandbox_status"
  746. - name: Install (immutable)
  747. if: matrix.platform == 'windows'
  748. shell: pwsh
  749. run: pnpm install --frozen-lockfile
  750. - name: Run complete unsharded primary Node CI concurrently
  751. if: matrix.platform == 'linux'
  752. env:
  753. DSH_COVERAGE_MAX_WORKERS: ${{ matrix.workers }}
  754. DSH_ESLINT_CACHE: '1'
  755. DSH_ESLINT_CONCURRENCY: ${{ matrix.workers }}
  756. DSH_GATE_CONCURRENCY: ${{ matrix.workers }}
  757. DSH_PUBLINT_CONCURRENCY: ${{ matrix.workers }}
  758. DSH_SNAPSHOT_MAX_CONCURRENCY: ${{ matrix.workers }}
  759. run: pnpm run check:ci
  760. - name: Run blocking Windows builds concurrently
  761. if: matrix.platform == 'windows'
  762. shell: pwsh
  763. env:
  764. DSH_GATE_CONCURRENCY: ${{ matrix.workers }}
  765. run: pnpm run check:ci:windows-blocking
  766. # Single stable required check for branch protection: require "all checks
  767. # passed" instead of enumerating matrix legs whose names change as lanes and
  768. # node versions evolve. Every blocking job in THIS workflow must be listed in
  769. # `needs`; observational Windows gates share the required Windows job but are
  770. # marked non-blocking inside run-gates. (`needs` cannot reach across workflow
  771. # files; e2e.yml stays its own check.)
  772. # `if: always()` is load-bearing: without it a failed dependency
  773. # would SKIP this job, and GitHub counts a skipped required check as passing
  774. # — so this job always runs and fails on any non-success result, including
  775. # 'cancelled' and 'skipped'.
  776. all-checks-passed:
  777. name: all checks passed
  778. # This bookkeeping-only verdict must not depend on custom-pool provisioning.
  779. runs-on: ubuntu-latest
  780. needs: [node-24, node-24-coverage, node-24-consumers, node-compat, python-sdk, windows]
  781. if: always() && github.event_name == 'pull_request'
  782. steps:
  783. - name: Fail if any needed job did not succeed
  784. if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')
  785. run: |
  786. echo "::error::Needed job results: ${{ join(needs.*.result, ', ') }}"
  787. exit 1
  788. - name: All checks passed
  789. run: echo "All needed jobs succeeded (${{ join(needs.*.result, ', ') }})"