ci.yml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 (RFC 006). 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 only reads source. Same `doc-sync` script the pre-push
  40. # hook runs (ADR 0007: one source of truth).
  41. - name: Doc-sync gates (doc code blocks + event taxonomy)
  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. test -f examples/echo-agent/main-session.jsonl
  64. rm -f examples/echo-agent/*.jsonl