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.
Harden the CI workflow with lint, build, and coverage thresholds
Description
The repository ships a GitHub Actions workflow at
.github/workflows/ci.ymland declares coverage thresholds injest.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
.github/workflows/ci.ymlrunsnpm ci,npm run lint,npm run build, andnpm run test:coverageon pull requests and pushes.>=18perpackage.jsonengines), e.g. 18 and 20.jest.config.js; cache npm to keep runs fast.Suggested execution
git checkout -b enhancement/ci-quality-gate.github/workflows/ci.yml— add/confirm the lint, build, coverage, and matrix steps with npm caching.npm ci && npm run lint && npm run build && npm run test:coveragelocally.README.md/CONTRIBUTING.md.Test and commit
Example commit message
ci: enforce lint, build, and coverage on every PRGuidelines
Community & contribution rewards