CI / typecheck + build (turbo) (push) Canceled after 0s
Added a real test suite (32 tests, 0 external services) using bun:test with in-process module mocking for @mcpedia/db, @mcpedia/queue, @mcpedia/core. Enablers: - apps/api: extracted createApp(deps?) factory + dashboard.ts module from index.ts so the HTTP surface is unit-testable (real queue is lazy-imported). - packages/core: exported shouldCreateRevision pure predicate; restoreRevision gained an opts.reindex seam for the chunk-rebuild contract. - apps/mcp: renamed smoke.test.ts -> smoke.ts (bun test now owns .test.ts), updated stale assertions (10 tools, 4 docs in docs section). - infra: turbo test task (cache:false), test scripts across packages, @types/bun + tsconfig base types, CI 'Test' step after Build. Packages with tests: embeddings(5), parser(5), search(8), core(4), mcp(6 auth-gates), api(8 contracts). All green: typecheck(4/4), test(6/6 pkgs), build(web). Live API verified /health, /metrics, /dashboard, /hooks/* auth gate on temp port.
50 lines
1.4 KiB
YAML
50 lines
1.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
# Cancel in-progress runs for the same ref so a fresh push supersedes them.
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
name: typecheck + build (turbo)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: "1.3.14"
|
|
|
|
- name: Install dependencies
|
|
run: bun install --frozen-lockfile
|
|
|
|
# Real build: typecheck + turbo run build across all workspace packages
|
|
# (incl. the Next.js web app). A green run means the whole monorepo
|
|
# compiles and the web app prerenders.
|
|
- name: Typecheck
|
|
run: bun run typecheck
|
|
|
|
- name: Build
|
|
run: bun run build
|
|
|
|
# Smoke: verify the MCP server + resources load and the indexer/module
|
|
# graph resolves. Requires no external services (Redis/Postgres) — pure
|
|
# module load + in-memory smoke test.
|
|
- name: MCP smoke test
|
|
run: bun --cwd apps/mcp run smoke
|
|
|
|
# Unit tests across all packages + apps. CI has no Postgres/Redis, so
|
|
# tests use bun:test module mocking to stub @mcpedia/db, @mcpedia/queue,
|
|
# and @mcpedia/embeddings — no live I/O.
|
|
- name: Test
|
|
run: bun run test
|