Files
deepseek-harness/.github/workflows/ci.yml
T
Tianyi Cui fa7d1df6f2 build: run doc-sync gates in the local pre-push hook too
The doc-sync gates were CI-only, so the AGENTS.md doc-sync promise could be
missed locally until after push. Add a shared `doc-sync` package.json script
(doc-typecheck + verify-event-taxonomy) wired into the lefthook pre-push job,
and point the CI step at the same script — one source of truth per ADR 0007.
Addresses PR review finding.
2026-06-14 10:40:20 +08:00

74 lines
2.3 KiB
YAML

name: CI
on:
push:
branches: [main, master]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
checks:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [24, 26]
name: node ${{ matrix.node }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Enable corepack (yarn 4)
run: corepack enable
- name: Install (immutable)
run: yarn install --immutable
- name: Constraints
run: yarn constraints
# Before lint: the type-aware ESLint config resolves vendor packages via
# their built declarations (tsconfig.typecheck.json -> vendor/*/lib),
# which `yarn typecheck` emits. Lint on a fresh checkout would otherwise
# see unresolved types and erupt with no-unsafe-* errors.
- name: Typecheck (src + tests + examples)
run: yarn typecheck
- name: Lint
run: yarn lint
# Doc-sync gates (RFC 006). doc-typecheck compiles the fenced ts blocks in
# the docs and resolves vendor packages via their built declarations, which
# the typecheck step above emits — so it runs after typecheck. The event
# taxonomy check only reads source. Same `doc-sync` script the pre-push
# hook runs (ADR 0007: one source of truth).
- name: Doc-sync gates (doc code blocks + event taxonomy)
run: yarn doc-sync
- name: Tests with coverage gate (per-file 100%)
run: yarn test:coverage
# Before hygiene: publint validates the packed artifacts (lib/index.js),
# which only the tsdown bundling step emits.
- name: Build (tsc -b + tsdown bundles)
run: yarn build
- name: Hygiene (knip + publint)
run: yarn knip && yarn publint
- name: Demo smoke test
run: |
set -euo pipefail
out=$(printf 'echo ci smoke\n' | timeout 60 node --expose-internals --import tsx examples/echo-agent/start.ts 2>&1)
echo "$out"
echo "$out" | grep -q '\[tool call\] echo({"text":"ci smoke"})'
echo "$out" | grep -q '\[tool result\] ECHO: CI SMOKE'
test -f examples/echo-agent/main-session.jsonl
rm -f examples/echo-agent/*.jsonl