ci.yml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  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. # Redirect the Node compile cache (enabled by pnpm and TypeScript) off
  54. # the root partition's /tmp before the first pnpm call in this lane —
  55. # see .agents/notes/implemented/process/2026-08-28-ci-node-compile-cache-data-disk.md.
  56. - name: Redirect Node compile cache to runner temp
  57. run: echo "NODE_COMPILE_CACHE=${{ runner.temp }}/node-compile-cache" >> "$GITHUB_ENV"
  58. - uses: pnpm/action-setup@v4
  59. with:
  60. dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
  61. - uses: actions/setup-node@v6
  62. with:
  63. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  64. - name: Configure pnpm store path
  65. id: pnpm-store
  66. run: |
  67. store_root="$HOME/.local/share/pnpm/store"
  68. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  69. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  70. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  71. # Pull requests consume the default-branch cache but do not put cache
  72. # compression and upload on the paid latency-critical path. Skipped
  73. # under failover — see the coverage lane's identical rationale.
  74. - uses: actions/cache/restore@v4
  75. if: vars.DSH_CI_FAILOVER_LINUX != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
  76. with:
  77. path: ${{ steps.pnpm-store.outputs.path }}
  78. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  79. restore-keys: |
  80. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  81. - name: Install (immutable)
  82. run: pnpm install --frozen-lockfile
  83. - name: Run static gates
  84. env:
  85. DSH_ARCHIVE_BASE_REF: ${{ github.event.pull_request.base.sha }}
  86. run: pnpm run check:ci:static
  87. node-24-coverage:
  88. if: github.event_name == 'pull_request'
  89. runs-on: >-
  90. ${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted'
  91. && github.event.pull_request.user.login != 'dependabot[bot]'
  92. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  93. || 'dsh-ubuntu-24-04-16core' }}
  94. name: node 24 / coverage
  95. env:
  96. # Partitioning replaces the instrumented share; this budget gives the
  97. # exempt-heavy gate two workers on both hosted and failover runners.
  98. DSH_COVERAGE_MAX_WORKERS: '6'
  99. DSH_COVERAGE_PARTITIONS: '4'
  100. DSH_GATE_CONCURRENCY: '3'
  101. # A gate failure aborts the sibling gate instead of waiting out its
  102. # multi-minute instrumented run.
  103. DSH_GATE_FAIL_FAST: '1'
  104. steps:
  105. - uses: actions/checkout@v6
  106. with:
  107. persist-credentials: false
  108. # Redirect the Node compile cache (enabled by pnpm and TypeScript) off
  109. # the root partition's /tmp before the first pnpm call in this lane —
  110. # see .agents/notes/implemented/process/2026-08-28-ci-node-compile-cache-data-disk.md.
  111. - name: Redirect Node compile cache to runner temp
  112. run: echo "NODE_COMPILE_CACHE=${{ runner.temp }}/node-compile-cache" >> "$GITHUB_ENV"
  113. - uses: pnpm/action-setup@v4
  114. with:
  115. dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
  116. - uses: actions/setup-node@v6
  117. with:
  118. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  119. - name: Configure pnpm store path
  120. id: pnpm-store
  121. run: |
  122. store_root="$HOME/.local/share/pnpm/store"
  123. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  124. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  125. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  126. # Skipped under failover: the self-hosted VM's persistent pnpm store
  127. # already serves warm installs, while restoring the hosted archive
  128. # would spend ~52 s pulling ~180 MB into that populated store.
  129. - uses: actions/cache/restore@v4
  130. if: vars.DSH_CI_FAILOVER_LINUX != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
  131. with:
  132. path: ${{ steps.pnpm-store.outputs.path }}
  133. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  134. restore-keys: |
  135. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  136. - name: Install dependencies and prepare bubblewrap
  137. run: |
  138. pnpm install --frozen-lockfile &
  139. install_pid=$!
  140. bash scripts/prepare-ci-bubblewrap.sh &
  141. sandbox_pid=$!
  142. install_status=0
  143. wait "$install_pid" || install_status=$?
  144. sandbox_status=0
  145. wait "$sandbox_pid" || sandbox_status=$?
  146. if (( install_status != 0 )); then exit "$install_status"; fi
  147. exit "$sandbox_status"
  148. - name: Run exhaustive coverage
  149. run: pnpm run check:ci:coverage
  150. node-24-bench:
  151. if: github.event_name == 'pull_request'
  152. runs-on: ubuntu-24.04
  153. name: node 24 / benchmarks
  154. # Wall-clock budgets need an otherwise idle runner, so this job runs the
  155. # benchmark lane alone instead of joining a concurrent gate aggregate.
  156. timeout-minutes: 15
  157. steps:
  158. - uses: actions/checkout@v6
  159. with:
  160. persist-credentials: false
  161. - uses: pnpm/action-setup@v4
  162. with:
  163. dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
  164. - uses: actions/setup-node@v6
  165. with:
  166. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  167. - name: Configure pnpm store path
  168. id: pnpm-store
  169. run: |
  170. store_root="$HOME/.local/share/pnpm/store"
  171. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  172. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  173. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  174. - uses: actions/cache/restore@v4
  175. with:
  176. path: ${{ steps.pnpm-store.outputs.path }}
  177. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  178. restore-keys: |
  179. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  180. - name: Install (immutable)
  181. run: pnpm install --frozen-lockfile
  182. - name: Run performance benchmarks
  183. env:
  184. DSH_GATE_VERBOSE: '1'
  185. run: pnpm run check:ci:bench
  186. node-24-consumers:
  187. if: github.event_name == 'pull_request'
  188. runs-on: >-
  189. ${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted'
  190. && github.event.pull_request.user.login != 'dependabot[bot]'
  191. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  192. || 'dsh-ubuntu-24-04-16core' }}
  193. name: node 24 / snapshots and artifacts
  194. env:
  195. DSH_GATE_CONCURRENCY: '10'
  196. DSH_NODE_COMPAT_SKIP_TYPECHECK: '1'
  197. DSH_OXLINT_THREADS: '8'
  198. DSH_PUBLINT_CONCURRENCY: '8'
  199. DSH_WEB_SNAPSHOT_WORKERS: '6'
  200. # A failing gate aborts its running siblings: a failing build stops the
  201. # independent Node compatibility smoke, and a failing reader (e.g.
  202. # publint) stops the remaining artifact consumers.
  203. DSH_GATE_FAIL_FAST: '1'
  204. # Failover halves snapshot concurrency for the shared 64-core VM.
  205. DSH_SNAPSHOT_MAX_CONCURRENCY: ${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted' && github.event.pull_request.user.login != 'dependabot[bot]' && '12' || '32' }}
  206. steps:
  207. - uses: actions/checkout@v6
  208. with:
  209. persist-credentials: false
  210. # Redirect the Node compile cache (enabled by pnpm and TypeScript) off
  211. # the root partition's /tmp before the first pnpm call in this lane —
  212. # see .agents/notes/implemented/process/2026-08-28-ci-node-compile-cache-data-disk.md.
  213. - name: Redirect Node compile cache to runner temp
  214. run: echo "NODE_COMPILE_CACHE=${{ runner.temp }}/node-compile-cache" >> "$GITHUB_ENV"
  215. - uses: pnpm/action-setup@v4
  216. with:
  217. dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
  218. - uses: actions/setup-node@v6
  219. with:
  220. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  221. - name: Configure pnpm store path
  222. id: pnpm-store
  223. run: |
  224. store_root="$HOME/.local/share/pnpm/store"
  225. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  226. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  227. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  228. # Pull requests restore the pnpm store and Playwright caches without paying
  229. # compression and upload on the required path. No master job saves these
  230. # hosted cache keys, so each restore-keys fallback hits the matching archived
  231. # entry until it evicts, after which the store is cold. Skipped under failover
  232. # — the self-hosted VM's persistent store is already warm.
  233. - uses: actions/cache/restore@v4
  234. if: vars.DSH_CI_FAILOVER_LINUX != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
  235. with:
  236. path: ${{ steps.pnpm-store.outputs.path }}
  237. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  238. restore-keys: |
  239. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  240. # Skipped under failover: the VM's persistent browser cache is already warm.
  241. - uses: actions/cache/restore@v4
  242. if: vars.DSH_CI_FAILOVER_LINUX != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
  243. with:
  244. path: ~/.cache/ms-playwright
  245. key: ${{ runner.os }}-playwright-${{ hashFiles('pnpm-lock.yaml') }}
  246. restore-keys: |
  247. ${{ runner.os }}-playwright-
  248. - name: Install dependencies and prepare bubblewrap
  249. run: |
  250. pnpm install --frozen-lockfile &
  251. install_pid=$!
  252. bash scripts/prepare-ci-bubblewrap.sh &
  253. sandbox_pid=$!
  254. install_status=0
  255. wait "$install_pid" || install_status=$?
  256. sandbox_status=0
  257. wait "$sandbox_pid" || sandbox_status=$?
  258. if (( install_status != 0 )); then exit "$install_status"; fi
  259. exit "$sandbox_status"
  260. - name: Install Playwright Chromium and hosted dependencies
  261. if: vars.DSH_CI_FAILOVER_LINUX != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
  262. run: pnpm --filter @deepseek-ai/dsh-web-frontend exec playwright install --with-deps chromium
  263. # The persistent VM image owns Playwright's Linux system packages; do
  264. # not mutate the shared host with apt on every failover run.
  265. - name: Install Playwright Chromium on the failover VM
  266. if: vars.DSH_CI_FAILOVER_LINUX == 'selfhosted' && github.event.pull_request.user.login != 'dependabot[bot]'
  267. run: pnpm --filter @deepseek-ai/dsh-web-frontend exec playwright install chromium
  268. - name: Run compatibility, snapshot, and artifact gates
  269. run: pnpm run check:ci:consumers
  270. node-compat:
  271. if: github.event_name == 'pull_request'
  272. # This job admits only repository-owned PR code to the persistent shared VM.
  273. runs-on: >-
  274. ${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted'
  275. && github.event.pull_request.head.repo.full_name == github.repository
  276. && github.event.pull_request.head.repo.fork == false
  277. && github.event.pull_request.user.login != 'dependabot[bot]'
  278. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  279. || matrix.runner }}
  280. name: ${{ matrix.name }}
  281. env:
  282. DSH_GATE_CONCURRENCY: ${{ matrix.gate_concurrency }}
  283. DSH_NODE_COMPAT_SKIP_TYPECHECK: '1'
  284. # A failed smoke aborts the remaining compatibility gates instead of
  285. # letting the build-backed legs run against an already-red aggregate.
  286. DSH_GATE_FAIL_FAST: '1'
  287. strategy:
  288. fail-fast: false
  289. matrix:
  290. include:
  291. - node: '22.19'
  292. name: node 22.19
  293. runner: ubuntu-latest
  294. gate_concurrency: '1'
  295. # Pinned inside 24.0-24.11.1: those releases carry the v1 internal
  296. # loader while reporting major 24, and every other job tracks the
  297. # latest 24, which is v2. A bare `24` here would retest that same v2.
  298. - node: '24.9'
  299. name: node 24.9
  300. runner: ubuntu-latest
  301. gate_concurrency: '1'
  302. - node: 26
  303. name: node 26
  304. runner: ubuntu-latest
  305. gate_concurrency: '1'
  306. steps:
  307. - uses: actions/checkout@v6
  308. with:
  309. persist-credentials: false
  310. # Shared hosts keep version installs and generated caches inside runner temp.
  311. - name: Isolate compatibility caches
  312. if: runner.environment == 'self-hosted'
  313. run: |
  314. echo "NODE_COMPILE_CACHE=$RUNNER_TEMP/node-compile-cache" >> "$GITHUB_ENV"
  315. echo "npm_config_devdir=$RUNNER_TEMP/node-gyp" >> "$GITHUB_ENV"
  316. echo "PNPM_CONFIG_STORE_DIR=$HOME/.local/share/pnpm/store" >> "$GITHUB_ENV"
  317. - uses: pnpm/action-setup@v4
  318. with:
  319. dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
  320. - uses: actions/setup-node@v6
  321. env:
  322. # The runner overwrites RUNNER_* step env before starting JavaScript actions.
  323. NODE_OPTIONS: ${{ runner.environment == 'self-hosted' && '--import=./scripts/ci-compatible-toolcache.mjs' || '' }}
  324. with:
  325. node-version: ${{ matrix.node }}
  326. cache: ${{ runner.environment == 'github-hosted' && 'pnpm' || '' }}
  327. package-manager-cache: false
  328. - name: Verify isolated Node installation
  329. if: runner.environment == 'self-hosted'
  330. run: |
  331. node_path=$(node -p process.execPath)
  332. echo "Node executable: $node_path"
  333. case "$node_path" in
  334. "$RUNNER_TEMP/node-compat-toolcache/"*) ;;
  335. *) echo "::error::Node compatibility installation is outside runner temp"; exit 1 ;;
  336. esac
  337. - name: Install (immutable)
  338. run: pnpm install --frozen-lockfile
  339. - name: Run compatibility smokes
  340. env:
  341. DSH_BUILD_CLIENT_PROFILE: official
  342. run: pnpm run check:node-compat
  343. # Kept out of the gate aggregate: the shape a Node release carries only
  344. # changes with the Node version, so this belongs to the version matrix
  345. # rather than to every commit's checks.
  346. - name: Check Loader internal shape detection
  347. run: pnpm exec vitest run packages/boot/app-boot/tests/loader-shape.compat.spec.ts
  348. python-sdk:
  349. if: github.event_name == 'pull_request'
  350. runs-on: ubuntu-latest
  351. name: python 3.10 / keyless SDK
  352. steps:
  353. - uses: actions/checkout@v6
  354. - uses: actions/setup-python@v6.3.0
  355. with:
  356. python-version: '3.10'
  357. cache: pip
  358. - name: Install uv
  359. run: python -m pip install uv==0.11.23
  360. - name: Run complete keyless Python suite
  361. run: uv run --python 3.10 --group test --project python/sdk pytest
  362. # The reusable builder owns each published executable, wheel, clean-install,
  363. # keyless black-box, and trusted real-API path. Linux/Windows x64 block PRs;
  364. # Linux ARM64 and both macOS architectures run in ci-master.yml.
  365. python-runtime:
  366. if: github.event_name == 'pull_request'
  367. name: python runtime / release-shaped matrix
  368. uses: ./.github/workflows/build-exe-for-python-sdk.yml
  369. with:
  370. targets: node24-linux-x64,node24-win-x64
  371. ci: true
  372. secrets:
  373. DEEPSEEK_API_KEY_EXTERNAL: ${{ secrets.DEEPSEEK_API_KEY_EXTERNAL }}
  374. # Every pull request also gets real Windows-kernel signals. The former
  375. # monolithic windows-native job is split into smaller jobs so one slow
  376. # coverage gate does not hold up build/static results, while the total
  377. # per-job process count stays lower. Observational checks are non-blocking.
  378. # Dependabot PRs are excluded from the self-hosted pool and stay queued for
  379. # the hosted runner.
  380. windows-build:
  381. if: github.event_name == 'pull_request'
  382. runs-on: >-
  383. ${{ vars.DSH_CI_FAILOVER_WINDOWS == 'selfhosted'
  384. && github.event.pull_request.user.login != 'dependabot[bot]'
  385. && fromJSON('["self-hosted", "dsh-win-ci", "windows"]')
  386. || 'dsh-windows-2025-16core' }}
  387. name: windows node 24 / build
  388. timeout-minutes: 60
  389. env:
  390. # A failing build or site aborts the sibling gate on the same runner.
  391. DSH_GATE_FAIL_FAST: '1'
  392. steps:
  393. - uses: actions/checkout@v6
  394. with:
  395. persist-credentials: false
  396. - name: Enable Developer Mode (symlink support)
  397. shell: pwsh
  398. run: >-
  399. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
  400. /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
  401. - uses: pnpm/action-setup@v4
  402. with:
  403. dest: ${{ runner.temp }}/setup-pnpm-js-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
  404. - uses: actions/setup-node@v6
  405. with:
  406. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  407. - name: Install (immutable)
  408. shell: pwsh
  409. # See 2026-08-30-windows-refs-store-block-clone-install for the
  410. # ReFS block-clone rationale; detect the workspace filesystem and
  411. # pass --package-import-method=clone only on ReFS.
  412. run: >-
  413. $drive = (Split-Path -Qualifier $env:GITHUB_WORKSPACE).TrimEnd(':');
  414. $fs = (Get-Volume -DriveLetter $drive).FileSystem;
  415. if ($fs -eq 'ReFS') {
  416. corepack pnpm install --frozen-lockfile --package-import-method=clone
  417. } else {
  418. pnpm install --frozen-lockfile
  419. }
  420. - name: Run blocking Windows builds
  421. shell: pwsh
  422. run: pnpm run check:ci:windows-blocking
  423. windows-coverage:
  424. if: github.event_name == 'pull_request'
  425. runs-on: >-
  426. ${{ vars.DSH_CI_FAILOVER_WINDOWS == 'selfhosted'
  427. && github.event.pull_request.user.login != 'dependabot[bot]'
  428. && fromJSON('["self-hosted", "dsh-win-ci", "windows"]')
  429. || 'dsh-windows-2025-16core' }}
  430. name: windows node 24 / coverage
  431. timeout-minutes: 120
  432. env:
  433. DSH_COVERAGE_MAX_WORKERS: '6'
  434. DSH_COVERAGE_PARTITIONS: '4'
  435. DSH_COVERAGE_TEST_TIMEOUT_MS: '90000'
  436. DSH_GATE_CONCURRENCY: '3'
  437. # A gate failure aborts the sibling gate instead of waiting out its
  438. # multi-minute instrumented run.
  439. DSH_GATE_FAIL_FAST: '1'
  440. steps:
  441. - uses: actions/checkout@v6
  442. with:
  443. persist-credentials: false
  444. # Checkout removes the gitignored duration history, so restore it from
  445. # the GitHub cache before coverage and save the updated one afterwards.
  446. # The coordinator then weights partitions by measured durations on the
  447. # second run instead of degrading to a file-count split. GitHub cache
  448. # entries are immutable, so the save key is unique per run and the
  449. # restore matches the newest entry through the stable prefix.
  450. - name: Restore coverage duration history
  451. uses: actions/cache/restore@v4
  452. with:
  453. path: .coverage-times.json
  454. key: coverage-times-${{ github.run_id }}
  455. restore-keys: |
  456. coverage-times-
  457. - name: Enable Developer Mode (symlink support)
  458. shell: pwsh
  459. run: >-
  460. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
  461. /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
  462. - uses: pnpm/action-setup@v4
  463. with:
  464. dest: ${{ runner.temp }}/setup-pnpm-js-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
  465. - uses: actions/setup-node@v6
  466. with:
  467. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  468. - name: Install (immutable)
  469. shell: pwsh
  470. # See 2026-08-30-windows-refs-store-block-clone-install for the
  471. # ReFS block-clone rationale; detect the workspace filesystem and
  472. # pass --package-import-method=clone only on ReFS.
  473. run: >-
  474. $drive = (Split-Path -Qualifier $env:GITHUB_WORKSPACE).TrimEnd(':');
  475. $fs = (Get-Volume -DriveLetter $drive).FileSystem;
  476. if ($fs -eq 'ReFS') {
  477. corepack pnpm install --frozen-lockfile --package-import-method=clone
  478. } else {
  479. pnpm install --frozen-lockfile
  480. }
  481. # No build before coverage, matching the Linux lane: workspace imports
  482. # resolve to src through the tsconfig paths map, and the lib-consuming
  483. # suites (webworker-packer image-loadable, webworker-runtime
  484. # transform-corpus, client ui-trajectory client-bundle) self-skip on
  485. # unbuilt checkouts.
  486. - name: Run Windows coverage
  487. shell: pwsh
  488. run: pnpm run check:ci:coverage
  489. - name: Save coverage duration history
  490. # Coverage flakes must not prevent the cache from building; the
  491. # measured durations remain useful even when a partition failed. The
  492. # per-run key keeps every save a fresh immutable cache entry.
  493. if: always()
  494. uses: actions/cache/save@v4
  495. with:
  496. path: .coverage-times.json
  497. key: coverage-times-${{ github.run_id }}
  498. windows-native-tests:
  499. if: github.event_name == 'pull_request'
  500. runs-on: >-
  501. ${{ vars.DSH_CI_FAILOVER_WINDOWS == 'selfhosted'
  502. && github.event.pull_request.user.login != 'dependabot[bot]'
  503. && fromJSON('["self-hosted", "dsh-win-ci", "windows"]')
  504. || 'dsh-windows-2025-16core' }}
  505. name: windows node 24 / native tests
  506. timeout-minutes: 60
  507. steps:
  508. - uses: actions/checkout@v6
  509. with:
  510. persist-credentials: false
  511. - name: Enable Developer Mode (symlink support)
  512. shell: pwsh
  513. run: >-
  514. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
  515. /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
  516. - uses: pnpm/action-setup@v4
  517. with:
  518. dest: ${{ runner.temp }}/setup-pnpm-js-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
  519. - uses: actions/setup-node@v6
  520. with:
  521. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  522. - name: Install (immutable)
  523. shell: pwsh
  524. # See 2026-08-30-windows-refs-store-block-clone-install for the
  525. # ReFS block-clone rationale; detect the workspace filesystem and
  526. # pass --package-import-method=clone only on ReFS.
  527. run: >-
  528. $drive = (Split-Path -Qualifier $env:GITHUB_WORKSPACE).TrimEnd(':');
  529. $fs = (Get-Volume -DriveLetter $drive).FileSystem;
  530. if ($fs -eq 'ReFS') {
  531. corepack pnpm install --frozen-lockfile --package-import-method=clone
  532. } else {
  533. pnpm install --frozen-lockfile
  534. }
  535. - name: Run Windows-specific native tests
  536. shell: pwsh
  537. run: >-
  538. pnpm exec vitest run
  539. --no-file-parallelism
  540. --testTimeout 90000
  541. packages/shell/tool-pwsh/tests/loader.spec.ts
  542. packages/workflow/workflow-worker-thread/tests/workflow-worker-thread.spec.ts
  543. packages/workflow/tool-ralph/tests/integration.spec.ts
  544. packages/subprocess/subprocess-local/tests/process-exit.spec.ts
  545. windows-observational:
  546. if: github.event_name == 'pull_request'
  547. continue-on-error: true
  548. runs-on: >-
  549. ${{ vars.DSH_CI_FAILOVER_WINDOWS == 'selfhosted'
  550. && github.event.pull_request.user.login != 'dependabot[bot]'
  551. && fromJSON('["self-hosted", "dsh-win-ci", "windows"]')
  552. || 'dsh-windows-2025-16core' }}
  553. name: windows node 24 / observational
  554. timeout-minutes: 60
  555. env:
  556. DSH_PUBLINT_CONCURRENCY: '8'
  557. steps:
  558. - uses: actions/checkout@v6
  559. with:
  560. persist-credentials: false
  561. - name: Enable Developer Mode (symlink support)
  562. shell: pwsh
  563. run: >-
  564. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
  565. /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
  566. - uses: pnpm/action-setup@v4
  567. with:
  568. dest: ${{ runner.temp }}/setup-pnpm-js-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
  569. - uses: actions/setup-node@v6
  570. with:
  571. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  572. - name: Install (immutable)
  573. shell: pwsh
  574. # See 2026-08-30-windows-refs-store-block-clone-install for the
  575. # ReFS block-clone rationale; detect the workspace filesystem and
  576. # pass --package-import-method=clone only on ReFS.
  577. run: >-
  578. $drive = (Split-Path -Qualifier $env:GITHUB_WORKSPACE).TrimEnd(':');
  579. $fs = (Get-Volume -DriveLetter $drive).FileSystem;
  580. if ($fs -eq 'ReFS') {
  581. corepack pnpm install --frozen-lockfile --package-import-method=clone
  582. } else {
  583. pnpm install --frozen-lockfile
  584. }
  585. - name: Run Windows observational gates
  586. shell: pwsh
  587. run: pnpm run check:ci:windows-observational
  588. # Single stable required check for branch protection: require "all checks
  589. # passed" instead of enumerating matrix legs whose names change as lanes and
  590. # node versions evolve. Every blocking job in THIS workflow must be listed in
  591. # `needs`. Native Windows build and process checks are required; Wine and
  592. # the deferred Python runtime targets live in ci-master.yml and do not
  593. # participate in this PR verdict. `needs` cannot cross workflow files.
  594. # `if: always()` is load-bearing: without it a failed dependency
  595. # would SKIP this job, and GitHub counts a skipped required check as passing
  596. # — so this job always runs and fails on any non-success result, including
  597. # 'cancelled' and 'skipped'.
  598. all-checks-passed:
  599. name: all checks passed
  600. # This bookkeeping-only verdict must not depend on custom-pool
  601. # provisioning — and under Linux failover it follows the same selector as
  602. # the worker jobs it aggregates, so a standard-hosted outage cannot strand
  603. # the branch-protection verdict either. It retargets with the Linux switch
  604. # (DSH_CI_FAILOVER_LINUX), not the Windows one, because it aggregates the
  605. # required Linux workers and runs on the vm-backup pool.
  606. runs-on: >-
  607. ${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted'
  608. && github.event.pull_request.user.login != 'dependabot[bot]'
  609. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  610. || 'ubuntu-latest' }}
  611. needs: [node-24, node-24-coverage, node-24-bench, node-24-consumers, node-compat, python-sdk, python-runtime, windows-build, windows-native-tests]
  612. if: always() && github.event_name == 'pull_request'
  613. steps:
  614. - name: Fail if any needed job did not succeed
  615. if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')
  616. run: |
  617. echo "::error::Needed job results: ${{ join(needs.*.result, ', ') }}"
  618. exit 1
  619. - name: All checks passed
  620. run: echo "All needed jobs succeeded (${{ join(needs.*.result, ', ') }})"