ci.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. - name: Tests with coverage gate (per-file 100%)
  37. run: yarn test:coverage
  38. # Before hygiene: publint validates the packed artifacts (lib/index.js),
  39. # which only the tsdown bundling step emits.
  40. - name: Build (tsc -b + tsdown bundles)
  41. run: yarn build
  42. - name: Hygiene (knip + publint)
  43. run: yarn knip && yarn publint
  44. - name: Demo smoke test
  45. run: |
  46. set -euo pipefail
  47. out=$(printf 'echo ci smoke\n' | timeout 60 node --expose-internals --import tsx examples/echo-agent/start.ts 2>&1)
  48. echo "$out"
  49. echo "$out" | grep -q '\[tool call\] echo({"text":"ci smoke"})'
  50. echo "$out" | grep -q '\[tool result\] ECHO: CI SMOKE'
  51. test -f examples/echo-agent/main-session.jsonl
  52. rm -f examples/echo-agent/*.jsonl