ci.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. - name: Lint
  34. run: pnpm run lint
  35. # Doc-sync gates (doc-sync-enforcement RFC). doc-typecheck compiles the
  36. # fenced ts blocks against the root project-reference graph. The cordis
  37. # catalog freshness check, type-equiv check, and markdown wrap/link checks
  38. # only read source. Same `doc-sync` script the pre-push hook runs
  39. # (quality-gates RFC: one source of truth).
  40. - name: Doc-sync gates (doc code blocks + cordis catalog + type-equiv + markdown wrap/links)
  41. run: pnpm run doc-sync
  42. # Module-graph freshness: regenerate docs/module-graph.md from the
  43. # packages' peerDependencies and fail if it differs from the committed
  44. # file. Only reads source package.json — no build needed.
  45. - name: Module-graph freshness
  46. run: pnpm run verify-module-graph
  47. - name: Tests with coverage gate (per-file 100%)
  48. run: pnpm run test:coverage
  49. # ACP snapshot tests (acp-snapshot-tests RFC): boot the real acp-agent
  50. # subprocess and replay recorded session-log fixtures, diffing the
  51. # normalized stdout transcript + re-persisted log against committed
  52. # goldens. KEYLESS by design — the same `test:snapshot` script the pre-push
  53. # hook runs (one source of truth), so the full-transcript regression net
  54. # is part of every PR gate, not just local pre-push.
  55. - name: Snapshot tests (ACP transcript replay)
  56. run: pnpm run test:snapshot
  57. # Before hygiene: publint validates the packed artifacts (lib/index.js),
  58. # which only the tsdown bundling step emits, and verify-node-next-types
  59. # validates the built declarations.
  60. - name: Build (tsc -b + tsdown bundles)
  61. run: pnpm run build
  62. - name: Hygiene (knip + publint + constraints + NodeNext types)
  63. run: pnpm run hygiene
  64. - name: Demo smoke test
  65. run: |
  66. set -euo pipefail
  67. out=$(printf 'echo ci smoke\n' | timeout 60 pnpm run demo:echo 2>&1)
  68. echo "$out"
  69. echo "$out" | grep -q '\[tool call\] echo({"text":"ci smoke"})'
  70. echo "$out" | grep -q '\[tool result\] ECHO: CI SMOKE'
  71. # The JSONL backend (root ./.sessions, no cwd → _no-cwd bucket) writes a
  72. # per-run session log named main-session-<uuid>.jsonl. Assert one exists.
  73. ls .sessions/_no-cwd/main-session-*.jsonl >/dev/null
  74. rm -rf .sessions
  75. # The published `bin` is `lib/bin.js`, run under plain `node` by a real
  76. # consumer — NOT the tsx dev path the demo smoke and demo:* scripts use.
  77. # These keyless smokes boot the BUILT bins (this step runs AFTER the build)
  78. # in a temp dir that mirrors a real install, catching a regression in the
  79. # published artifact that tsx would mask. They self-skip if lib/ is absent,
  80. # so the e2e job (which does not build) does not run them.
  81. - name: Built-bin smoke test (published lib/bin.js under node)
  82. 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