Skip to content

Add a CI lint+build+coverage gate to the GitHub Actions workflow #129

Description

@mikewheeleer

Harden the CI workflow with lint, build, and coverage thresholds

Description

The repository ships a GitHub Actions workflow at .github/workflows/ci.yml and declares coverage thresholds in jest.config.js, but the campaign needs CI to actually enforce lint, a clean TypeScript build, and the coverage gate on every PR so contributions can't regress quality. This issue audits and hardens the workflow to run all three checks across supported Node versions.

Requirements and context

  • Repository scope: StableRoute-Org/Stableroute-backend only.
  • Ensure .github/workflows/ci.yml runs npm ci, npm run lint, npm run build, and npm run test:coverage on pull requests and pushes.
  • Run the matrix across the supported Node versions (>=18 per package.json engines), e.g. 18 and 20.
  • Fail the job when coverage drops below the thresholds in jest.config.js; cache npm to keep runs fast.
  • Keep the workflow name and triggers backward compatible; do not remove any existing required check.

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b enhancement/ci-quality-gate
  • Implement changes
    • Write code in: .github/workflows/ci.yml — add/confirm the lint, build, coverage, and matrix steps with npm caching.
    • Write comprehensive tests in: not applicable (CI config); validate by running npm ci && npm run lint && npm run build && npm run test:coverage locally.
    • Add documentation: describe the CI gate and badge in README.md / CONTRIBUTING.md.
    • Add comments in the workflow explaining each step.
    • Validate security: pin action versions and avoid leaking secrets in logs.
  • Test and commit

Test and commit

  • Run the four commands locally to mirror CI; confirm they all pass.
  • Cover edge cases: a coverage drop fails the gate; lint failure fails the job.
  • Paste the local command output in the PR.

Example commit message

ci: enforce lint, build, and coverage on every PR

Guidelines

  • Minimum 95 percent test coverage for impacted code.
  • Clear, reviewer-focused documentation.
  • Timeframe: 96 hours.

Community & contribution rewards

  • 💬 Join the StableRoute community on Discord for questions, reviews, and faster merges: https://discord.gg/37aCpusvx
  • ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward.

Metadata

Metadata

Assignees

Fields

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions