Skip to content

Add CI pipeline with test, lint, and build checks on every PR #31

Description

@Just-Bamford

Summary

The core repo has 28 passing tests across backend and frontend, an
ESLint config, and a TypeScript build — but no CI pipeline. There is
no GitHub Actions workflow file anywhere in the repo. This means every
PR merged to main could silently break tests, introduce lint errors, or
fail the TypeScript build without any automated check catching it before
merge. For a project handling cryptographic voter data, a broken test
suite merging silently is a serious quality gap.

Scope

  • Add a .github/workflows/ci.yml workflow that runs on every PR
    targeting main
  • Specify Node.js 20.x in the workflow using
    uses: actions/setup-node@v4 with node-version: '20' — this
    matches the required version in the README
  • The workflow should run in sequence: install dependencies, lint,
    build, test
  • Backend steps: cd backend && npm install, npm run lint,
    npm run build, npm run test:backend — requires a PostgreSQL
    service container in the workflow
  • Frontend steps: cd frontend && npm install, npm run lint,
    npm run build, npm run test:frontend
  • Add a PostgreSQL service in the workflow using
    services: postgres:15 with the same credentials as .env.example
    so backend tests can run against a real database
  • Run Prisma migrations before backend tests:
    npx prisma migrate deploy
  • Add a CI badge to the README pointing to the workflow status

Relevant Files

  • .github/workflows/ci.yml (new file)
  • README.md
  • backend/package.json
  • frontend/package.json

Acceptance Criteria

  • CI workflow runs on every PR to main
  • Backend lint, build, and tests all run and pass
  • Frontend lint, build, and tests all run and pass
  • PostgreSQL service container is correctly configured
  • Prisma migrations run before backend tests
  • CI badge added to README and resolves green
  • A PR with a failing test is blocked from merging by the workflow

Out of Scope

  • Deployment automation — CI only, no CD
  • Coverage reporting — a separate issue

Note for Contributors

The PostgreSQL service container must use the exact same DATABASE_URL
format as .env.example. Do not hardcode credentials differently from
what the test suite expects — the tests should pass locally and in CI
with the same configuration.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions