ci.yml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. name: CI
  2. on:
  3. push:
  4. branches: [main, master]
  5. pull_request:
  6. concurrency:
  7. group: ${{ github.workflow }}-${{ github.ref }}
  8. cancel-in-progress: true
  9. permissions:
  10. contents: read
  11. env:
  12. PRIMARY_NODE_VERSION: '24'
  13. jobs:
  14. quality:
  15. runs-on: ubuntu-latest
  16. name: quality / ${{ matrix.name }}
  17. strategy:
  18. fail-fast: false
  19. matrix:
  20. include:
  21. - name: constraints
  22. command: pnpm run constraints
  23. - name: typecheck
  24. command: pnpm run typecheck
  25. - name: lint
  26. command: |
  27. # Root typecheck validates the package/vendor reference graph and
  28. # refreshes TSC intermediates before type-aware ESLint loads the
  29. # project graph.
  30. pnpm run typecheck
  31. NODE_OPTIONS=--max-old-space-size=8192 pnpm run lint
  32. - name: coverage
  33. command: pnpm run test:coverage
  34. - name: snapshots
  35. command: pnpm run test:snapshot
  36. - name: demo smoke
  37. command: |
  38. set -euo pipefail
  39. out=$(printf 'echo ci smoke\n' | timeout 60 pnpm run demo:echo 2>&1)
  40. echo "$out"
  41. echo "$out" | grep -q '\[tool call\] echo({"text":"ci smoke"})'
  42. echo "$out" | grep -q '\[tool result\] ECHO: CI SMOKE'
  43. # The JSONL backend (root ./.sessions, no cwd -> _no-cwd bucket)
  44. # writes a per-run session log named main-session-<uuid>.jsonl.
  45. ls .sessions/_no-cwd/main-session-*.jsonl >/dev/null
  46. rm -rf .sessions
  47. steps:
  48. - uses: actions/checkout@v6
  49. - uses: actions/setup-node@v6
  50. with:
  51. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  52. - name: Enable corepack (pnpm)
  53. run: corepack enable
  54. - name: Resolve pnpm store path
  55. id: pnpm-store
  56. run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
  57. - uses: actions/cache@v4
  58. with:
  59. path: ${{ steps.pnpm-store.outputs.path }}
  60. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  61. restore-keys: |
  62. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  63. - name: Install (immutable)
  64. run: pnpm install --frozen-lockfile
  65. - name: Run ${{ matrix.name }}
  66. run: ${{ matrix.command }}
  67. docs:
  68. runs-on: ubuntu-latest
  69. name: docs / ${{ matrix.name }}
  70. strategy:
  71. fail-fast: false
  72. matrix:
  73. include:
  74. - name: doc-typecheck
  75. command: pnpm run doc-typecheck
  76. - name: cordis catalog
  77. command: pnpm run verify-cordis-catalog
  78. - name: tool catalog
  79. command: pnpm run verify-tool-catalog
  80. - name: persistence catalog
  81. command: pnpm run verify-persistence-catalog
  82. - name: doc graphs
  83. command: pnpm run verify-doc-graphs
  84. - name: markdown wrap
  85. command: pnpm run verify-md-wrap
  86. - name: markdown links
  87. command: pnpm run verify-md-links
  88. - name: doc refs
  89. command: pnpm run verify-doc-refs
  90. - name: package paths
  91. command: pnpm run verify-package-paths
  92. - name: mermaid
  93. command: pnpm run verify-mermaid
  94. - name: rfc classification
  95. command: pnpm run verify-rfc-classification
  96. - name: rfc format
  97. command: pnpm run verify-rfc-format
  98. - name: type equivalence
  99. command: pnpm run verify-type-equiv
  100. - name: translation pairing
  101. command: pnpm run verify-translation-pairing
  102. - name: doc budgets
  103. command: pnpm run verify-doc-budgets
  104. - name: module graph
  105. command: pnpm run verify-module-graph
  106. steps:
  107. - uses: actions/checkout@v6
  108. - uses: actions/setup-node@v6
  109. with:
  110. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  111. - name: Enable corepack (pnpm)
  112. run: corepack enable
  113. - name: Resolve pnpm store path
  114. id: pnpm-store
  115. run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
  116. - uses: actions/cache@v4
  117. with:
  118. path: ${{ steps.pnpm-store.outputs.path }}
  119. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  120. restore-keys: |
  121. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  122. - name: Install (immutable)
  123. run: pnpm install --frozen-lockfile
  124. - name: Run ${{ matrix.name }}
  125. run: ${{ matrix.command }}
  126. build:
  127. runs-on: ubuntu-latest
  128. name: build
  129. steps:
  130. - uses: actions/checkout@v6
  131. - uses: actions/setup-node@v6
  132. with:
  133. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  134. - name: Enable corepack (pnpm)
  135. run: corepack enable
  136. - name: Resolve pnpm store path
  137. id: pnpm-store
  138. run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
  139. - uses: actions/cache@v4
  140. with:
  141. path: ${{ steps.pnpm-store.outputs.path }}
  142. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  143. restore-keys: |
  144. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  145. - name: Install (immutable)
  146. run: pnpm install --frozen-lockfile
  147. - name: Build (tsc -b + tsdown bundles)
  148. run: pnpm run build
  149. - uses: actions/upload-artifact@v4
  150. with:
  151. name: build-output
  152. path: |
  153. packages/*/*/lib
  154. vendor/*/lib
  155. if-no-files-found: error
  156. retention-days: 1
  157. artifact-gate:
  158. runs-on: ubuntu-latest
  159. name: artifact / ${{ matrix.name }}
  160. needs: build
  161. strategy:
  162. fail-fast: false
  163. matrix:
  164. include:
  165. - name: hygiene
  166. command: pnpm run hygiene
  167. - name: built-bin smoke
  168. command: pnpm exec vitest run --config vitest.e2e.config.ts packages/ui/stdio-agent/tests/built-bin.e2e.ts packages/ui/acp-agent/tests/built-bin.e2e.ts
  169. steps:
  170. - uses: actions/checkout@v6
  171. - uses: actions/setup-node@v6
  172. with:
  173. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  174. - name: Enable corepack (pnpm)
  175. run: corepack enable
  176. - name: Resolve pnpm store path
  177. id: pnpm-store
  178. run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
  179. - uses: actions/cache@v4
  180. with:
  181. path: ${{ steps.pnpm-store.outputs.path }}
  182. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  183. restore-keys: |
  184. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  185. - name: Install (immutable)
  186. run: pnpm install --frozen-lockfile
  187. - uses: actions/download-artifact@v4
  188. with:
  189. name: build-output
  190. - name: Run ${{ matrix.name }}
  191. run: ${{ matrix.command }}
  192. node-compat:
  193. runs-on: ubuntu-latest
  194. name: node ${{ matrix.node }} compatibility
  195. strategy:
  196. fail-fast: false
  197. matrix:
  198. node: [26]
  199. steps:
  200. - uses: actions/checkout@v6
  201. - uses: actions/setup-node@v6
  202. with:
  203. node-version: ${{ matrix.node }}
  204. - name: Enable corepack (pnpm)
  205. run: corepack enable
  206. - name: Resolve pnpm store path
  207. id: pnpm-store
  208. run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
  209. - uses: actions/cache@v4
  210. with:
  211. path: ${{ steps.pnpm-store.outputs.path }}
  212. key: ${{ runner.os }}-node-${{ matrix.node }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  213. restore-keys: |
  214. ${{ runner.os }}-node-${{ matrix.node }}-pnpm-
  215. - name: Install (immutable)
  216. run: pnpm install --frozen-lockfile
  217. - name: Typecheck (src + tests + examples)
  218. run: pnpm run typecheck
  219. - name: Unit tests
  220. run: pnpm run test