ci.yml 28 KB

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