ci.yml 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723
  1. name: CI
  2. on:
  3. pull_request:
  4. permissions:
  5. contents: read
  6. env:
  7. PRIMARY_NODE_VERSION: '24'
  8. # CI runs must never report to the production telemetry endpoint baked
  9. # into apps/cli/cordis.yml (AppCLIEntry disables the row when set).
  10. DSH_TELEMETRY_DISABLED: '1'
  11. # Cancel a superseded pull-request run on a new push so a fresh head does not
  12. # queue a second full 9-job run behind a stale one (paid enterprise runners
  13. # would otherwise stack with no auto-cancellation).
  14. concurrency:
  15. group: ${{ github.workflow }}-${{ github.ref }}
  16. cancel-in-progress: true
  17. jobs:
  18. # Three enterprise jobs isolate coverage, static analysis, and the
  19. # build-backed consumer tail. The consumer job owns the only Linux build so
  20. # all three jobs enter runner allocation independently.
  21. #
  22. # FAILOVER (Linux): each Linux enterprise job resolves its pool through the
  23. # DSH_CI_FAILOVER_LINUX repository variable. Unset (normal), the expressions
  24. # pick the hosted enterprise pools below. Setting the variable to
  25. # 'selfhosted' (repo Settings → Actions → Variables; writer-manageable
  26. # repository state — not PR-editable, no merge required) retargets all
  27. # three onto the in-house
  28. # vm-backup pool and re-running the failed jobs is the entire switch —
  29. # see .agents/notes/implemented/process/2026-07-26-ci-failover-runbook.md. The
  30. # in-house pool's readiness is re-proven on every master push by the
  31. # serial-linux-selfhosted standby lane in ci-master.yml. The Windows failover
  32. # switch is the separate DSH_CI_FAILOVER_WINDOWS variable on the windows-native
  33. # job below.
  34. node-24:
  35. if: github.event_name == 'pull_request'
  36. runs-on: >-
  37. ${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted'
  38. && github.event.pull_request.user.login != 'dependabot[bot]'
  39. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  40. || 'dsh-ubuntu-24-04-16core' }}
  41. name: node 24 / static
  42. env:
  43. DSH_GATE_CONCURRENCY: '8'
  44. # Stop the aggregate at the first blocking gate failure so a red run
  45. # does not keep burning enterprise runner time on the remaining gates.
  46. DSH_GATE_FAIL_FAST: '1'
  47. steps:
  48. # Fetch complete history so the archive gate can read the trusted PR base from a reused shallow checkout.
  49. - uses: actions/checkout@v6
  50. with:
  51. fetch-depth: 0
  52. persist-credentials: false
  53. - uses: pnpm/action-setup@v4
  54. with:
  55. dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
  56. - uses: actions/setup-node@v6
  57. with:
  58. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  59. - name: Configure pnpm store path
  60. id: pnpm-store
  61. run: |
  62. store_root="$HOME/.local/share/pnpm/store"
  63. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  64. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  65. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  66. # Pull requests consume the default-branch cache but do not put cache
  67. # compression and upload on the paid latency-critical path. Skipped
  68. # under failover — see the coverage lane's identical rationale.
  69. - uses: actions/cache/restore@v4
  70. if: vars.DSH_CI_FAILOVER_LINUX != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
  71. with:
  72. path: ${{ steps.pnpm-store.outputs.path }}
  73. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  74. restore-keys: |
  75. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  76. - name: Install (immutable)
  77. run: pnpm install --frozen-lockfile
  78. - name: Run static gates
  79. env:
  80. DSH_ARCHIVE_BASE_REF: ${{ github.event.pull_request.base.sha }}
  81. run: pnpm run check:ci:static
  82. node-24-coverage:
  83. if: github.event_name == 'pull_request'
  84. runs-on: >-
  85. ${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted'
  86. && github.event.pull_request.user.login != 'dependabot[bot]'
  87. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  88. || 'dsh-ubuntu-24-04-16core' }}
  89. name: node 24 / coverage
  90. env:
  91. # Partitioning replaces the instrumented share; this budget gives the
  92. # exempt-heavy gate two workers on both hosted and failover runners.
  93. DSH_COVERAGE_MAX_WORKERS: '6'
  94. DSH_COVERAGE_PARTITIONS: '4'
  95. DSH_GATE_CONCURRENCY: '3'
  96. # A gate failure aborts the sibling gate instead of waiting out its
  97. # multi-minute instrumented run.
  98. DSH_GATE_FAIL_FAST: '1'
  99. steps:
  100. - uses: actions/checkout@v6
  101. with:
  102. persist-credentials: false
  103. - uses: pnpm/action-setup@v4
  104. with:
  105. dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
  106. - uses: actions/setup-node@v6
  107. with:
  108. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  109. - name: Configure pnpm store path
  110. id: pnpm-store
  111. run: |
  112. store_root="$HOME/.local/share/pnpm/store"
  113. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  114. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  115. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  116. # Skipped under failover: the self-hosted VM's persistent pnpm store
  117. # already serves warm installs, while restoring the hosted archive
  118. # would spend ~52 s pulling ~180 MB into that populated store.
  119. - uses: actions/cache/restore@v4
  120. if: vars.DSH_CI_FAILOVER_LINUX != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
  121. with:
  122. path: ${{ steps.pnpm-store.outputs.path }}
  123. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  124. restore-keys: |
  125. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  126. - name: Install dependencies and prepare bubblewrap
  127. run: |
  128. pnpm install --frozen-lockfile &
  129. install_pid=$!
  130. bash scripts/prepare-ci-bubblewrap.sh &
  131. sandbox_pid=$!
  132. install_status=0
  133. wait "$install_pid" || install_status=$?
  134. sandbox_status=0
  135. wait "$sandbox_pid" || sandbox_status=$?
  136. if (( install_status != 0 )); then exit "$install_status"; fi
  137. exit "$sandbox_status"
  138. - name: Run exhaustive coverage
  139. run: pnpm run check:ci:coverage
  140. node-24-bench:
  141. if: github.event_name == 'pull_request'
  142. runs-on: >-
  143. ${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted'
  144. && github.event.pull_request.user.login != 'dependabot[bot]'
  145. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  146. || 'dsh-ubuntu-24-04-16core' }}
  147. name: node 24 / benchmarks
  148. # Wall-clock budgets need an otherwise idle runner, so this job runs the
  149. # benchmark lane alone instead of joining a concurrent gate aggregate.
  150. timeout-minutes: 30
  151. steps:
  152. - uses: actions/checkout@v6
  153. with:
  154. persist-credentials: false
  155. - uses: pnpm/action-setup@v4
  156. with:
  157. dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
  158. - uses: actions/setup-node@v6
  159. with:
  160. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  161. - name: Configure pnpm store path
  162. id: pnpm-store
  163. run: |
  164. store_root="$HOME/.local/share/pnpm/store"
  165. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  166. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  167. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  168. - uses: actions/cache/restore@v4
  169. if: vars.DSH_CI_FAILOVER_LINUX != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
  170. with:
  171. path: ${{ steps.pnpm-store.outputs.path }}
  172. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  173. restore-keys: |
  174. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  175. - name: Install (immutable)
  176. run: pnpm install --frozen-lockfile
  177. - name: Run performance benchmarks
  178. run: pnpm run check:ci:bench
  179. node-24-consumers:
  180. if: github.event_name == 'pull_request'
  181. runs-on: >-
  182. ${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted'
  183. && github.event.pull_request.user.login != 'dependabot[bot]'
  184. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  185. || 'dsh-ubuntu-24-04-16core' }}
  186. name: node 24 / snapshots and artifacts
  187. env:
  188. DSH_GATE_CONCURRENCY: '10'
  189. DSH_NODE_COMPAT_SKIP_TYPECHECK: '1'
  190. DSH_OXLINT_THREADS: '8'
  191. DSH_PUBLINT_CONCURRENCY: '8'
  192. DSH_WEB_SNAPSHOT_WORKERS: '6'
  193. # A failing gate aborts its running siblings: a failing build stops the
  194. # independent Node compatibility smoke, and a failing reader (e.g.
  195. # publint) stops the remaining artifact consumers.
  196. DSH_GATE_FAIL_FAST: '1'
  197. # Failover halves snapshot concurrency for the shared 64-core VM.
  198. DSH_SNAPSHOT_MAX_CONCURRENCY: ${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted' && github.event.pull_request.user.login != 'dependabot[bot]' && '12' || '32' }}
  199. steps:
  200. - uses: actions/checkout@v6
  201. with:
  202. persist-credentials: false
  203. - uses: pnpm/action-setup@v4
  204. with:
  205. dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
  206. - uses: actions/setup-node@v6
  207. with:
  208. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  209. - name: Configure pnpm store path
  210. id: pnpm-store
  211. run: |
  212. store_root="$HOME/.local/share/pnpm/store"
  213. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  214. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  215. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  216. # Pull requests restore the pnpm store and Playwright caches without paying
  217. # compression and upload on the required path. No master job saves these
  218. # hosted cache keys, so each restore-keys fallback hits the matching archived
  219. # entry until it evicts, after which the store is cold. Skipped under failover
  220. # — the self-hosted VM's persistent store is already warm.
  221. - uses: actions/cache/restore@v4
  222. if: vars.DSH_CI_FAILOVER_LINUX != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
  223. with:
  224. path: ${{ steps.pnpm-store.outputs.path }}
  225. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  226. restore-keys: |
  227. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  228. # Skipped under failover: the VM's persistent browser cache is already warm.
  229. - uses: actions/cache/restore@v4
  230. if: vars.DSH_CI_FAILOVER_LINUX != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
  231. with:
  232. path: ~/.cache/ms-playwright
  233. key: ${{ runner.os }}-playwright-${{ hashFiles('pnpm-lock.yaml') }}
  234. restore-keys: |
  235. ${{ runner.os }}-playwright-
  236. - name: Install dependencies and prepare bubblewrap
  237. run: |
  238. pnpm install --frozen-lockfile &
  239. install_pid=$!
  240. bash scripts/prepare-ci-bubblewrap.sh &
  241. sandbox_pid=$!
  242. install_status=0
  243. wait "$install_pid" || install_status=$?
  244. sandbox_status=0
  245. wait "$sandbox_pid" || sandbox_status=$?
  246. if (( install_status != 0 )); then exit "$install_status"; fi
  247. exit "$sandbox_status"
  248. - name: Install Playwright Chromium and hosted dependencies
  249. if: vars.DSH_CI_FAILOVER_LINUX != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
  250. run: pnpm --filter @deepseek-ai/dsh-web-frontend exec playwright install --with-deps chromium
  251. # The persistent VM image owns Playwright's Linux system packages; do
  252. # not mutate the shared host with apt on every failover run.
  253. - name: Install Playwright Chromium on the failover VM
  254. if: vars.DSH_CI_FAILOVER_LINUX == 'selfhosted' && github.event.pull_request.user.login != 'dependabot[bot]'
  255. run: pnpm --filter @deepseek-ai/dsh-web-frontend exec playwright install chromium
  256. - name: Run compatibility, snapshot, and artifact gates
  257. run: pnpm run check:ci:consumers
  258. node-compat:
  259. if: github.event_name == 'pull_request'
  260. # Each compatibility contract receives an independent standard hosted job.
  261. runs-on: ${{ matrix.runner }}
  262. name: ${{ matrix.name }}
  263. env:
  264. DSH_GATE_CONCURRENCY: ${{ matrix.gate_concurrency }}
  265. DSH_NODE_COMPAT_SKIP_TYPECHECK: '1'
  266. # A failed smoke aborts the remaining compatibility gates instead of
  267. # letting the build-backed legs run against an already-red aggregate.
  268. DSH_GATE_FAIL_FAST: '1'
  269. strategy:
  270. fail-fast: false
  271. matrix:
  272. include:
  273. - node: '22.19'
  274. name: node 22.19
  275. runner: ubuntu-latest
  276. gate_concurrency: '1'
  277. # Pinned inside 24.0-24.11.1: those releases carry the v1 internal
  278. # loader while reporting major 24, and every other job tracks the
  279. # latest 24, which is v2. A bare `24` here would retest that same v2.
  280. - node: '24.9'
  281. name: node 24.9
  282. runner: ubuntu-latest
  283. gate_concurrency: '1'
  284. - node: 26
  285. name: node 26
  286. runner: ubuntu-latest
  287. gate_concurrency: '1'
  288. steps:
  289. - uses: actions/checkout@v6
  290. - uses: pnpm/action-setup@v4
  291. with:
  292. dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
  293. - uses: actions/setup-node@v6
  294. with:
  295. node-version: ${{ matrix.node }}
  296. cache: pnpm
  297. - name: Install (immutable)
  298. run: pnpm install --frozen-lockfile
  299. - name: Run compatibility smokes
  300. env:
  301. DSH_BUILD_CLIENT_PROFILE: official
  302. run: pnpm run check:node-compat
  303. # Kept out of the gate aggregate: the shape a Node release carries only
  304. # changes with the Node version, so this belongs to the version matrix
  305. # rather than to every commit's checks.
  306. - name: Check Loader internal shape detection
  307. run: pnpm exec vitest run packages/boot/app-boot/tests/loader-shape.compat.spec.ts
  308. python-sdk:
  309. if: github.event_name == 'pull_request'
  310. runs-on: ubuntu-latest
  311. name: python 3.10 / keyless SDK
  312. steps:
  313. - uses: actions/checkout@v6
  314. - uses: actions/setup-python@v6.3.0
  315. with:
  316. python-version: '3.10'
  317. cache: pip
  318. - name: Install uv
  319. run: python -m pip install uv==0.11.23
  320. - name: Run complete keyless Python suite
  321. run: uv run --python 3.10 --group test --project python/sdk pytest
  322. # The reusable builder owns each published executable, wheel, clean-install,
  323. # keyless black-box, and trusted real-API path. All native release targets are
  324. # required because a platform wheel cannot be validated by another carrier.
  325. python-runtime:
  326. if: github.event_name == 'pull_request'
  327. name: python runtime / release-shaped matrix
  328. uses: ./.github/workflows/build-exe-for-python-sdk.yml
  329. with:
  330. targets: node24-linux-x64,node24-linux-arm64,node24-macos-arm64,node24-macos-x64,node24-win-x64
  331. ci: true
  332. secrets:
  333. DEEPSEEK_API_KEY_EXTERNAL: ${{ secrets.DEEPSEEK_API_KEY_EXTERNAL }}
  334. # The required pull-request Windows signal: the two blocking win32 surfaces
  335. # (workspace build, production site) execute with real, checksum-verified
  336. # Windows Node under Wine on standard hosted Linux. The independent
  337. # windows-native job below keeps the complete native-kernel inventory —
  338. # including the observational portability gates this lane does not run —
  339. # on real Windows. This job only provisions runner state (caches,
  340. # apt); scripts/wine-windows-gates.sh owns the gate logic and is the same
  341. # script the optional local gate `pnpm run check:windows-wine` runs.
  342. # Current topology and fidelity limits live in
  343. # .agents/notes/implemented/process/2026-08-08-native-windows-pull-request-ci.md
  344. windows:
  345. if: github.event_name == 'pull_request'
  346. runs-on: ubuntu-latest
  347. name: windows node 24 / wine blocking
  348. timeout-minutes: 15
  349. steps:
  350. - uses: actions/checkout@v6
  351. with:
  352. persist-credentials: false
  353. - uses: pnpm/action-setup@v4
  354. with:
  355. dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
  356. - uses: actions/setup-node@v6
  357. with:
  358. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  359. - name: Configure pnpm store path
  360. id: pnpm-store
  361. run: |
  362. store_root="$HOME/.local/share/pnpm/store"
  363. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  364. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  365. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  366. - uses: actions/cache/restore@v4
  367. with:
  368. path: ${{ steps.pnpm-store.outputs.path }}
  369. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  370. restore-keys: |
  371. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  372. # Master's wine-apt-cache job in ci-master.yml seeds the default-branch
  373. # scope every pull request can read; a save from this job only reaches
  374. # reruns of the same merge ref.
  375. - name: Compose Wine apt cache key
  376. id: wine-cache-key
  377. run: echo "key=wine-debs-${ImageOS:-linux}-${ImageVersion:-v0}" >> "$GITHUB_OUTPUT"
  378. - uses: actions/cache@v4
  379. with:
  380. path: ~/wine-debs
  381. key: ${{ steps.wine-cache-key.outputs.key }}
  382. # Runner provisioning only — a developer machine installs Wine through
  383. # its own package manager; the gate script assumes a wine binary and
  384. # fails loud without one. Wine from the apt cache when present; else
  385. # download the full dependency closure once and keep it for the next
  386. # run. The `wine` dispatcher package (not bare `wine64`) is what puts a
  387. # binary on PATH.
  388. - name: Install Wine
  389. run: |
  390. if compgen -G "$HOME/wine-debs/*.deb" > /dev/null; then
  391. # The restored archive is the full --download-only closure of
  392. # `wine` for this runner image, so installing the .debs directly
  393. # with dpkg needs no repository access. apt-get would instead
  394. # re-download the same 100+ MB closure from the mirror, which has
  395. # stalled the job past its budget on a degraded runner network.
  396. # If the archive cannot satisfy the closure, fall back to the apt
  397. # network install.
  398. if ! sudo DEBIAN_FRONTEND=noninteractive dpkg -i "$HOME"/wine-debs/*.deb; then
  399. sudo DEBIAN_FRONTEND=noninteractive dpkg --configure -a || true
  400. sudo apt-get install -y --no-install-recommends "$HOME"/wine-debs/*.deb
  401. fi
  402. else
  403. sudo apt-get update
  404. sudo apt-get install -y --no-install-recommends --download-only wine
  405. mkdir -p "$HOME/wine-debs"
  406. cp /var/cache/apt/archives/*.deb "$HOME/wine-debs/" 2>/dev/null || true
  407. sudo apt-get install -y --no-install-recommends wine
  408. fi
  409. - name: Run the Wine Windows gates
  410. run: bash scripts/wine-windows-gates.sh
  411. - name: Shut down wineserver
  412. if: always()
  413. run: wineserver -k 2>/dev/null || true
  414. # Every pull request also gets real Windows-kernel signals. The former
  415. # monolithic windows-native job is split into smaller jobs so one slow
  416. # coverage gate does not hold up build/static results, while the total
  417. # per-job process count stays lower. Observational checks are non-blocking.
  418. # Dependabot PRs are excluded from the self-hosted pool and stay queued for
  419. # the hosted runner.
  420. windows-build:
  421. if: github.event_name == 'pull_request'
  422. runs-on: >-
  423. ${{ vars.DSH_CI_FAILOVER_WINDOWS == 'selfhosted'
  424. && github.event.pull_request.user.login != 'dependabot[bot]'
  425. && fromJSON('["self-hosted", "dsh-win-ci", "windows"]')
  426. || 'dsh-windows-2025-16core' }}
  427. name: windows node 24 / build
  428. timeout-minutes: 60
  429. env:
  430. # A failing build or site aborts the sibling gate on the same runner.
  431. DSH_GATE_FAIL_FAST: '1'
  432. steps:
  433. - uses: actions/checkout@v6
  434. with:
  435. persist-credentials: false
  436. - name: Enable Developer Mode (symlink support)
  437. shell: pwsh
  438. run: >-
  439. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
  440. /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
  441. - uses: pnpm/action-setup@v4
  442. with:
  443. dest: ${{ runner.temp }}/setup-pnpm-js-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
  444. - uses: actions/setup-node@v6
  445. with:
  446. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  447. - name: Install (immutable)
  448. shell: pwsh
  449. # See 2026-08-30-windows-refs-store-block-clone-install for the
  450. # ReFS block-clone rationale; detect the workspace filesystem and
  451. # pass --package-import-method=clone only on ReFS.
  452. run: >-
  453. $drive = (Split-Path -Qualifier $env:GITHUB_WORKSPACE).TrimEnd(':');
  454. $fs = (Get-Volume -DriveLetter $drive).FileSystem;
  455. if ($fs -eq 'ReFS') {
  456. corepack pnpm install --frozen-lockfile --package-import-method=clone
  457. } else {
  458. pnpm install --frozen-lockfile
  459. }
  460. - name: Run blocking Windows builds
  461. shell: pwsh
  462. run: pnpm run check:ci:windows-blocking
  463. windows-coverage:
  464. if: github.event_name == 'pull_request'
  465. runs-on: >-
  466. ${{ vars.DSH_CI_FAILOVER_WINDOWS == 'selfhosted'
  467. && github.event.pull_request.user.login != 'dependabot[bot]'
  468. && fromJSON('["self-hosted", "dsh-win-ci", "windows"]')
  469. || 'dsh-windows-2025-16core' }}
  470. name: windows node 24 / coverage
  471. timeout-minutes: 120
  472. env:
  473. DSH_COVERAGE_MAX_WORKERS: '6'
  474. DSH_COVERAGE_PARTITIONS: '4'
  475. DSH_COVERAGE_TEST_TIMEOUT_MS: '90000'
  476. DSH_GATE_CONCURRENCY: '3'
  477. # A gate failure aborts the sibling gate instead of waiting out its
  478. # multi-minute instrumented run.
  479. DSH_GATE_FAIL_FAST: '1'
  480. steps:
  481. - uses: actions/checkout@v6
  482. with:
  483. persist-credentials: false
  484. # Checkout removes the gitignored duration history, so restore it from
  485. # the GitHub cache before coverage and save the updated one afterwards.
  486. # The coordinator then weights partitions by measured durations on the
  487. # second run instead of degrading to a file-count split. GitHub cache
  488. # entries are immutable, so the save key is unique per run and the
  489. # restore matches the newest entry through the stable prefix.
  490. - name: Restore coverage duration history
  491. uses: actions/cache/restore@v4
  492. with:
  493. path: .coverage-times.json
  494. key: coverage-times-${{ github.run_id }}
  495. restore-keys: |
  496. coverage-times-
  497. - name: Enable Developer Mode (symlink support)
  498. shell: pwsh
  499. run: >-
  500. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
  501. /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
  502. - uses: pnpm/action-setup@v4
  503. with:
  504. dest: ${{ runner.temp }}/setup-pnpm-js-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
  505. - uses: actions/setup-node@v6
  506. with:
  507. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  508. - name: Install (immutable)
  509. shell: pwsh
  510. # See 2026-08-30-windows-refs-store-block-clone-install for the
  511. # ReFS block-clone rationale; detect the workspace filesystem and
  512. # pass --package-import-method=clone only on ReFS.
  513. run: >-
  514. $drive = (Split-Path -Qualifier $env:GITHUB_WORKSPACE).TrimEnd(':');
  515. $fs = (Get-Volume -DriveLetter $drive).FileSystem;
  516. if ($fs -eq 'ReFS') {
  517. corepack pnpm install --frozen-lockfile --package-import-method=clone
  518. } else {
  519. pnpm install --frozen-lockfile
  520. }
  521. # No build before coverage, matching the Linux lane: workspace imports
  522. # resolve to src through the tsconfig paths map, and the lib-consuming
  523. # suites (webworker-packer image-loadable, webworker-runtime
  524. # transform-corpus, client ui-trajectory client-bundle) self-skip on
  525. # unbuilt checkouts.
  526. - name: Run Windows coverage
  527. shell: pwsh
  528. run: pnpm run check:ci:coverage
  529. - name: Save coverage duration history
  530. # Coverage flakes must not prevent the cache from building; the
  531. # measured durations remain useful even when a partition failed. The
  532. # per-run key keeps every save a fresh immutable cache entry.
  533. if: always()
  534. uses: actions/cache/save@v4
  535. with:
  536. path: .coverage-times.json
  537. key: coverage-times-${{ github.run_id }}
  538. windows-native-tests:
  539. if: github.event_name == 'pull_request'
  540. runs-on: >-
  541. ${{ vars.DSH_CI_FAILOVER_WINDOWS == 'selfhosted'
  542. && github.event.pull_request.user.login != 'dependabot[bot]'
  543. && fromJSON('["self-hosted", "dsh-win-ci", "windows"]')
  544. || 'dsh-windows-2025-16core' }}
  545. name: windows node 24 / native tests
  546. timeout-minutes: 60
  547. steps:
  548. - uses: actions/checkout@v6
  549. with:
  550. persist-credentials: false
  551. - name: Enable Developer Mode (symlink support)
  552. shell: pwsh
  553. run: >-
  554. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
  555. /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
  556. - uses: pnpm/action-setup@v4
  557. with:
  558. dest: ${{ runner.temp }}/setup-pnpm-js-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
  559. - uses: actions/setup-node@v6
  560. with:
  561. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  562. - name: Install (immutable)
  563. shell: pwsh
  564. # See 2026-08-30-windows-refs-store-block-clone-install for the
  565. # ReFS block-clone rationale; detect the workspace filesystem and
  566. # pass --package-import-method=clone only on ReFS.
  567. run: >-
  568. $drive = (Split-Path -Qualifier $env:GITHUB_WORKSPACE).TrimEnd(':');
  569. $fs = (Get-Volume -DriveLetter $drive).FileSystem;
  570. if ($fs -eq 'ReFS') {
  571. corepack pnpm install --frozen-lockfile --package-import-method=clone
  572. } else {
  573. pnpm install --frozen-lockfile
  574. }
  575. - name: Run Windows-specific native tests
  576. shell: pwsh
  577. run: >-
  578. pnpm exec vitest run
  579. --no-file-parallelism
  580. --testTimeout 90000
  581. packages/shell/tool-pwsh/tests/loader.spec.ts
  582. packages/workflow/workflow-worker-thread/tests/workflow-worker-thread.spec.ts
  583. packages/workflow/tool-ralph/tests/integration.spec.ts
  584. packages/subprocess/subprocess-local/tests/process-exit.spec.ts
  585. windows-observational:
  586. if: github.event_name == 'pull_request'
  587. continue-on-error: true
  588. runs-on: >-
  589. ${{ vars.DSH_CI_FAILOVER_WINDOWS == 'selfhosted'
  590. && github.event.pull_request.user.login != 'dependabot[bot]'
  591. && fromJSON('["self-hosted", "dsh-win-ci", "windows"]')
  592. || 'dsh-windows-2025-16core' }}
  593. name: windows node 24 / observational
  594. timeout-minutes: 60
  595. env:
  596. DSH_PUBLINT_CONCURRENCY: '8'
  597. steps:
  598. - uses: actions/checkout@v6
  599. with:
  600. persist-credentials: false
  601. - name: Enable Developer Mode (symlink support)
  602. shell: pwsh
  603. run: >-
  604. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
  605. /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
  606. - uses: pnpm/action-setup@v4
  607. with:
  608. dest: ${{ runner.temp }}/setup-pnpm-js-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
  609. - uses: actions/setup-node@v6
  610. with:
  611. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  612. - name: Install (immutable)
  613. shell: pwsh
  614. # See 2026-08-30-windows-refs-store-block-clone-install for the
  615. # ReFS block-clone rationale; detect the workspace filesystem and
  616. # pass --package-import-method=clone only on ReFS.
  617. run: >-
  618. $drive = (Split-Path -Qualifier $env:GITHUB_WORKSPACE).TrimEnd(':');
  619. $fs = (Get-Volume -DriveLetter $drive).FileSystem;
  620. if ($fs -eq 'ReFS') {
  621. corepack pnpm install --frozen-lockfile --package-import-method=clone
  622. } else {
  623. pnpm install --frozen-lockfile
  624. }
  625. - name: Run Windows observational gates
  626. shell: pwsh
  627. run: pnpm run check:ci:windows-observational
  628. # Single stable required check for branch protection: require "all checks
  629. # passed" instead of enumerating matrix legs whose names change as lanes and
  630. # node versions evolve. Every blocking job in THIS workflow must be listed in
  631. # `needs`. The required Wine job is listed as `windows`; `windows-native` is
  632. # deliberately absent so its independent result never delays or changes this
  633. # verdict. (`needs` cannot reach across workflow files; the master-only jobs in
  634. # ci-master.yml are intentionally not part of this PR verdict.)
  635. # `if: always()` is load-bearing: without it a failed dependency
  636. # would SKIP this job, and GitHub counts a skipped required check as passing
  637. # — so this job always runs and fails on any non-success result, including
  638. # 'cancelled' and 'skipped'.
  639. all-checks-passed:
  640. name: all checks passed
  641. # This bookkeeping-only verdict must not depend on custom-pool
  642. # provisioning — and under Linux failover it follows the same selector as
  643. # the worker jobs it aggregates, so a standard-hosted outage cannot strand
  644. # the branch-protection verdict either. It retargets with the Linux switch
  645. # (DSH_CI_FAILOVER_LINUX), not the Windows one, because it aggregates the
  646. # required Linux workers and runs on the vm-backup pool.
  647. runs-on: >-
  648. ${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted'
  649. && github.event.pull_request.user.login != 'dependabot[bot]'
  650. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  651. || 'ubuntu-latest' }}
  652. needs: [node-24, node-24-coverage, node-24-bench, node-24-consumers, node-compat, python-sdk, python-runtime, windows, windows-build, windows-native-tests]
  653. if: always() && github.event_name == 'pull_request'
  654. steps:
  655. - name: Fail if any needed job did not succeed
  656. if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')
  657. run: |
  658. echo "::error::Needed job results: ${{ join(needs.*.result, ', ') }}"
  659. exit 1
  660. - name: All checks passed
  661. run: echo "All needed jobs succeeded (${{ join(needs.*.result, ', ') }})"