Skip to content

Add CI/CD pipeline with GitHub Actions#1

Open
Sauhard74 wants to merge 10 commits intomainfrom
feat/ci-pipeline
Open

Add CI/CD pipeline with GitHub Actions#1
Sauhard74 wants to merge 10 commits intomainfrom
feat/ci-pipeline

Conversation

@Sauhard74
Copy link
Collaborator

@Sauhard74 Sauhard74 commented Feb 21, 2026

Summary

  • Add GitHub Actions CI workflow with 4 parallel jobs: lint, type-check, build, test
  • Test job includes PostgreSQL (pgvector/pg17) and Redis service containers
  • Uses pnpm 9 + Node.js 22, concurrency groups with cancel-in-progress
  • Runs on push to main and all PRs targeting main

TRD Phase 1 Deliverable

CI/CD pipeline (GitHub Actions: lint, type-check, test, build)

Test plan

  • Verify CI runs on PR creation
  • Confirm all 4 jobs pass independently
  • Verify service containers (Postgres + Redis) start correctly for test job

Set up continuous integration with four parallel jobs:
- Lint (ESLint + Prettier format check)
- Type check (TypeScript strict)
- Build (full Turborepo build)
- Test (with PostgreSQL pgvector/pg17 and Redis service containers)

Uses pnpm 9, Node.js 22, and concurrency groups with cancel-in-progress
to avoid redundant runs on rapid pushes.
@OSCxSST OSCxSST deleted a comment from Jenish-1235 Feb 21, 2026
Lint and typecheck run in parallel first. Test (which already
runs pnpm build internally) only starts if both pass, avoiding
wasted compute on code that fails basic checks.
Merge queue is now enabled on main via rulesets. CI runs on
pull_request and merge_group events. The push trigger is no
longer needed since merge queue tests the merge result before
merging to main.
CI: add 85% test coverage thresholds via vitest configs, diff
coverage check on changed lines using diff-cover, merge_group
trigger for merge queue, staged jobs with needs.

CD: build and push Docker images (api + dashboard) to GHCR on
merge to main. Multi-stage Dockerfiles using pnpm deploy for
api and Next.js standalone output for dashboard.
Pipes diff-cover output to a report file and uploads all
per-package coverage directories, merged lcov, and diff-cover
report as downloadable artifacts. Retained for 30 days.
pnpm/action-setup@v4 conflicts when both version key in workflow
and packageManager field in package.json are set. Removed explicit
version so it reads pnpm@9.15.4 from packageManager automatically.
checkout v4 -> v6, setup-node v4 -> v6, upload-artifact v4 -> v6
@Jenish-1235 Jenish-1235 disabled auto-merge February 21, 2026 23:17
next lint auto-adds allowJs and .next/types/**/*.ts to
tsconfig.json, which then causes format:check to fail
on the modified file. Adding these values upfront prevents
the runtime modification.
contents: read
packages: write

jobs:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if api and dashboard is separate concerns, then why are we running cd job for both everytime ? Any alternative approach ?

@Jenish-1235
Copy link
Member

@Sauhard74 test job failing due to minimum 85 percent coverage. Let's allow failure true for now. Once this PR merges, would request the first step to be taken as adding tests for pending code and then resetting to allow failure false before pushing other feature changes.

@Jenish-1235
Copy link
Member

or else remove the merge queue for now, hence we can add test from other PRs and then we will reenable here and merge this CI CD later.

Coverage thresholds will be added per-package alongside their
test files in subsequent PRs. passWithNoTests prevents vitest
from failing when no test files exist yet.
- Add 85% coverage thresholds (lines/functions/branches/statements)
  to all vitest configs
- Add tests for core/config.ts: normalizeRankingWeights,
  validateStalenessConfig
- Add tests for core/constants.ts: value assertions, weight sum
  invariant, staleness ordering
- Exclude scaffold server.ts from api coverage (rewritten in PR #5)
@Sauhard74 Sauhard74 self-assigned this Feb 22, 2026
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.

2 participants