ci.yml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. jobs:
  10. checks:
  11. runs-on: ubuntu-latest
  12. strategy:
  13. fail-fast: false
  14. matrix:
  15. node: [24, 26]
  16. name: node ${{ matrix.node }}
  17. steps:
  18. - uses: actions/checkout@v6
  19. - uses: actions/setup-node@v6
  20. with:
  21. node-version: ${{ matrix.node }}
  22. - name: Enable corepack (pnpm)
  23. run: corepack enable
  24. - name: Install (immutable)
  25. run: pnpm install --frozen-lockfile
  26. - name: Constraints
  27. run: pnpm run constraints
  28. # Before lint: root typecheck validates the package/vendor reference graph
  29. # and refreshes TSC intermediates so type-aware ESLint sees the same project
  30. # boundaries as the build.
  31. - name: Typecheck (src + tests + examples)
  32. run: pnpm run typecheck
  33. # Type-aware ESLint loads every package tsconfig through the project
  34. # service and peaks at ~3.4GB; the default V8 old-space ceiling (~2GB)
  35. # OOMs it (exit 134). Raise the ceiling well above the peak.
  36. - name: Lint
  37. run: pnpm run lint
  38. env:
  39. NODE_OPTIONS: --max-old-space-size=8192
  40. # Doc-sync gates (doc-sync-enforcement RFC). doc-typecheck compiles the
  41. # fenced ts blocks against the root project-reference graph. The cordis
  42. # catalog freshness check, type-equiv check, and markdown wrap/link checks
  43. # only read source. Same `doc-sync` script the pre-push hook runs
  44. # (quality-gates RFC: one source of truth).
  45. - name: Doc-sync gates (doc code blocks + cordis catalog + type-equiv + markdown wrap/links)
  46. run: pnpm run doc-sync
  47. # Module-graph freshness: regenerate docs/module-graph.md from the
  48. # packages' peerDependencies and fail if it differs from the committed
  49. # file. Only reads source package.json — no build needed.
  50. - name: Module-graph freshness
  51. run: pnpm run verify-module-graph
  52. - name: Tests with coverage gate (per-file 100%)
  53. run: pnpm run test:coverage
  54. # ACP snapshot tests (acp-snapshot-tests RFC): boot the real acp-agent
  55. # subprocess and replay recorded session-log fixtures, diffing the
  56. # normalized stdout transcript + re-persisted log against committed
  57. # goldens. KEYLESS by design — the same `test:snapshot` script the pre-push
  58. # hook runs (one source of truth), so the full-transcript regression net
  59. # is part of every PR gate, not just local pre-push.
  60. - name: Snapshot tests (ACP transcript replay)
  61. run: pnpm run test:snapshot
  62. # Before hygiene: publint validates the packed artifacts (lib/index.js),
  63. # which only the tsdown bundling step emits, and verify-node-next-types
  64. # validates the built declarations.
  65. - name: Build (tsc -b + tsdown bundles)
  66. run: pnpm run build
  67. - name: Hygiene (knip + publint + constraints + NodeNext types)
  68. run: pnpm run hygiene
  69. - name: Demo smoke test
  70. run: |
  71. set -euo pipefail
  72. out=$(printf 'echo ci smoke\n' | timeout 60 pnpm run demo:echo 2>&1)
  73. echo "$out"
  74. echo "$out" | grep -q '\[tool call\] echo({"text":"ci smoke"})'
  75. echo "$out" | grep -q '\[tool result\] ECHO: CI SMOKE'
  76. # The JSONL backend (root ./.sessions, no cwd → _no-cwd bucket) writes a
  77. # per-run session log named main-session-<uuid>.jsonl. Assert one exists.
  78. ls .sessions/_no-cwd/main-session-*.jsonl >/dev/null
  79. rm -rf .sessions
  80. # The published `bin` is `lib/bin.js`, run under plain `node` by a real
  81. # consumer — NOT the tsx dev path the demo smoke and demo:* scripts use.
  82. # These keyless smokes boot the BUILT bins (this step runs AFTER the build)
  83. # in a temp dir that mirrors a real install, catching a regression in the
  84. # published artifact that tsx would mask. They self-skip if lib/ is absent,
  85. # so the e2e job (which does not build) does not run them.
  86. - name: Built-bin smoke test (published lib/bin.js under node)
  87. run: 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