ci.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 (yarn 4)
  23. run: corepack enable
  24. - name: Install (immutable)
  25. run: yarn install --immutable
  26. - name: Constraints
  27. run: yarn constraints
  28. # Before lint: the type-aware ESLint config resolves vendor packages via
  29. # their built declarations (tsconfig.typecheck.json -> vendor/*/lib),
  30. # which `yarn 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: yarn typecheck
  34. - name: Lint
  35. run: yarn 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: yarn doc-sync
  43. - name: Tests with coverage gate (per-file 100%)
  44. run: yarn test:coverage
  45. # Before hygiene: publint validates the packed artifacts (lib/index.js),
  46. # which only the tsdown bundling step emits.
  47. - name: Build (tsc -b + tsdown bundles)
  48. run: yarn build
  49. - name: Hygiene (knip + publint)
  50. run: yarn knip && yarn publint
  51. - name: Demo smoke test
  52. run: |
  53. set -euo pipefail
  54. out=$(printf 'echo ci smoke\n' | timeout 60 node --expose-internals --import tsx examples/echo-agent/start.ts 2>&1)
  55. echo "$out"
  56. echo "$out" | grep -q '\[tool call\] echo({"text":"ci smoke"})'
  57. echo "$out" | grep -q '\[tool result\] ECHO: CI SMOKE'
  58. test -f examples/echo-agent/main-session.jsonl
  59. rm -f examples/echo-agent/*.jsonl