Skip to content

ci: build and test workflow - #46

Open
amal66 wants to merge 1 commit into
upstream-mainfrom
upstream-pr/ci-workflows
Open

ci: build and test workflow#46
amal66 wants to merge 1 commit into
upstream-mainfrom
upstream-pr/ci-workflows

Conversation

@amal66

@amal66 amal66 commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

Adds .github/workflows/ci.yml — a GitHub Actions workflow adapted from the fork's CI to this repository's backend/ + frontend/ layout. It gates every PR on the backend build today, and its test steps are written to no-op gracefully when the test script or eval harness is absent, so it is safe to merge before or after the test-harness (#43-style) and evals (#45) PRs and starts enforcing them automatically once they land.

Changes

One file, three jobs:

  • backendnpm ci, npm test --if-present, npm run build (tsc), with npm cache keyed on backend/package-lock.json
  • frontendnpm ci, npm test --if-present
  • evals — runs node evals/run.mjs --threshold 1.0 only if [ -f evals/run.mjs ], otherwise prints a skip notice

Triggers: push/pull_request on main only — this matches the fork CI's own scoping exactly, and it means pushing feature branches (including this one) spawns no Actions runs.

Adaptations from the fork's ci.yml (monorepo) to this layout, each flagged:

  • Fork's root-workspace npm ci (working-directory: .) → per-package npm ci in backend/ / frontend/ (no root workspace here)
  • Fork's npm run test:coveragenpm test --if-present (no coverage ratchet or test script exists here yet; --if-present makes the step merge-order-safe)
  • Fork's unconditional node evals/run.mjs --threshold 1.0 → the same command behind a file-existence guard
  • Retained verbatim: actions/checkout@v4, actions/setup-node@v4 with node-version: 22 + npm caching, job structure, and the evals job's explanatory comment

Fork jobs deliberately not ported (they depend on rungs that haven't merged or on fork-only infrastructure), noted here as future additions once their pieces land: npm audit --audit-level=high and the built-app smoke import (backend dist/index.js starts a server on import), lint + next build for the web app, monorepo package typecheck/test jobs, python-sdk, Supabase migration validation + deploy jobs, and the separate e2e.yml Playwright workflow (needs the fork's full demo stack).

Why

The extraction ladder ships tests (vitest harness, evals); without CI they are advisory. This workflow makes them enforceable: the backend build gates PRs immediately, and the test/eval steps switch on automatically as those PRs merge — no follow-up CI edit needed.

Testing

No actionlint was available locally (checked brew and npx); instead:

  • YAML validated by parsing with the yaml npm package via node -e (parse OK; verified on: triggers, all three jobs, step shapes, working directories)
  • Every step simulated locally on this branch's tree (plain upstream layout): backend npm ci + npm test --if-present (no-ops, exit 0) + npm run build (tsc, green); frontend npm ci + npm test --if-present (no-ops, exit 0)
  • Evals guard exercised in both states: with evals/ absent it prints the skip notice and exits 0; with evals/ present (checked out from the evals PR branch) it runs the harness and exits 0
  • Trigger scoping confirmed: pushing this branch produced no Actions runs

Provenance

All lines are mechanical ports of amal66/mike@origin/main (commit b3166dd); exceptions: the layout adaptations flagged above (per-package npm ci, npm test --if-present in place of test:coverage, the if [ -f evals/run.mjs ] guard and its skip message, and the header/step comments describing this adaptation). No new jobs, actions, or logic beyond what the fork's ci.yml contains.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CEguyEgXa9JjCciXCcVemC

Adds .github/workflows/ci.yml with three jobs adapted from the
amal66/mike fork's CI to this repository's backend/ + frontend/ layout:

- backend: npm ci, npm test --if-present, npm run build (tsc)
- frontend: npm ci, npm test --if-present
- evals: runs evals/run.mjs --threshold 1.0 only if the file exists

Test steps no-op gracefully on a tree without a test script or evals/,
so the workflow is safe to merge before or after the test-harness and
evals PRs while still gating the backend build on every PR.

Triggers are scoped to push/pull_request on main only (matching the
fork's own CI scoping), so feature-branch pushes do not spawn runs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CEguyEgXa9JjCciXCcVemC
willchen96 pushed a commit to Open-Legal-Products/mike that referenced this pull request Jul 22, 2026
Ported from amal66#46 onto current main, extended for this tree:
backend job runs npm ci, tests (--if-present, so it is safe to merge in any
order relative to the test-harness PR) and tsc build; frontend job runs
tests, eslint as an advisory step (main currently carries 23 lint errors —
flip to blocking once burned down), and a production next build with
placeholder NEXT_PUBLIC_* env (verified locally that the build succeeds and
contacts nothing); evals job runs node evals/run.mjs when present, else
skips.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
eliziff pushed a commit to eliziff/Beaver that referenced this pull request Jul 29, 2026
Ported from amal66/mike#46 onto current main, extended for this tree:
backend job runs npm ci, tests (--if-present, so it is safe to merge in any
order relative to the test-harness PR) and tsc build; frontend job runs
tests, eslint as an advisory step (main currently carries 23 lint errors —
flip to blocking once burned down), and a production next build with
placeholder NEXT_PUBLIC_* env (verified locally that the build succeeds and
contacts nothing); evals job runs node evals/run.mjs when present, else
skips.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
duncanmcqueen pushed a commit to duncanmcqueen/mike that referenced this pull request Aug 3, 2026
Ported from amal66#46 onto current main, extended for this tree:
backend job runs npm ci, tests (--if-present, so it is safe to merge in any
order relative to the test-harness PR) and tsc build; frontend job runs
tests, eslint as an advisory step (main currently carries 23 lint errors —
flip to blocking once burned down), and a production next build with
placeholder NEXT_PUBLIC_* env (verified locally that the build succeeds and
contacts nothing); evals job runs node evals/run.mjs when present, else
skips.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant