ci.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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: the type-aware ESLint config resolves vendor packages via
  29. # their built declarations (tsconfig.typecheck.json -> vendor/*/lib),
  30. # which `pnpm run typecheck` emits. Lint on a fresh checkout would otherwise
  31. # see unresolved types and erupt with no-unsafe-* errors.
  32. - name: Typecheck (src + tests + examples)
  33. run: pnpm run typecheck
  34. - name: Lint
  35. run: pnpm run lint
  36. # Doc-sync gates (doc-sync-enforcement RFC). doc-typecheck compiles the fenced ts blocks in
  37. # the docs and resolves vendor packages via their built declarations, which
  38. # the typecheck step above emits — so it runs after typecheck. The event
  39. # taxonomy check and the markdown wrap check only read source. Same
  40. # `doc-sync` script the pre-push hook runs (quality-gates RFC: one source of truth).
  41. - name: Doc-sync gates (doc code blocks + event taxonomy + markdown wrap)
  42. run: pnpm run doc-sync
  43. # Module-graph freshness: regenerate docs/module-graph.md from the
  44. # packages' peerDependencies and fail if it differs from the committed
  45. # file. Only reads source package.json — no build needed.
  46. - name: Module-graph freshness
  47. run: pnpm run verify-module-graph
  48. - name: Tests with coverage gate (per-file 100%)
  49. run: pnpm run test:coverage
  50. # Before hygiene: publint validates the packed artifacts (lib/index.js),
  51. # which only the tsdown bundling step emits.
  52. - name: Build (tsc -b + tsdown bundles)
  53. run: pnpm run build
  54. - name: Hygiene (knip + publint)
  55. run: pnpm run knip && pnpm run publint
  56. - name: Demo smoke test
  57. run: |
  58. set -euo pipefail
  59. out=$(printf 'echo ci smoke\n' | timeout 60 node --expose-internals --import tsx examples/echo-agent/start.ts 2>&1)
  60. echo "$out"
  61. echo "$out" | grep -q '\[tool call\] echo({"text":"ci smoke"})'
  62. echo "$out" | grep -q '\[tool result\] ECHO: CI SMOKE'
  63. # The JSONL backend (root ./.sessions, no cwd → _no-cwd bucket) writes a
  64. # per-run session log named main-session-<uuid>.jsonl. Assert one exists.
  65. ls .sessions/_no-cwd/main-session-*.jsonl >/dev/null
  66. rm -rf .sessions