Seed repository for the GitHub Actions CI/CD CheckPoint in CSP-451 — Computer Systems
Projects. The pipeline lints, formats, tests with coverage thresholds, runs npm audit,
and analyses the source with GitHub CodeQL on every push and pull request. Dependabot
keeps npm packages and GitHub Actions versions current.
- Install Node.js 20 LTS (18+ is acceptable).
- Install deps:
npm ci
- Run checks:
npm run format:check npm run lint npm test # runs Jest with coverage thresholds npm run audit:check
- Run the app:
Then visit http://localhost:3000
npm start
This repository ships with two workflows:
.github/workflows/ci.yml— formats, lints, tests with coverage threshold, and runsnpm auditon every push and pull request..github/workflows/codeql.yml— runs GitHub CodeQL on every push and pull request tomain, plus a weekly scheduled scan every Monday at 06:00 UTC.
Triggers:
- Pushes to
mainordevelop - Pull requests to
main - Manual trigger via the GitHub Actions tab
- GitHub CodeQL — semantic security analysis for JavaScript with the
security-and-qualityquery suite. Results appear under the repository's Security tab. - Dependabot (
.github/dependabot.yml) — opens weekly pull requests for npm and GitHub Actions version bumps and ships security alerts. npm audit— theauditjob in CI fails the build on advisories at moderate severity or higher.
- Jest with
--ci --coverageproduces an lcov report undercoverage/that is uploaded as a workflow artifact. - Coverage threshold gate is enforced in
package.json(JestcoverageThreshold). The build fails if coverage drops below: statements 80%, lines 80%, functions 80%, branches 70%. - Supertest drives Express HTTP assertions inside Jest.
Students will:
- Clone the seed and run the full quality pipeline locally.
- Add a new
/healthendpoint with Jest + supertest tests. - Push the work through a feature branch and pull request.
- Confirm the CI, CodeQL, and Dependabot configurations all behave correctly on the PR.
- Drive a red-then-green debug cycle and capture it on the PR timeline.
- Configure branch protection so the CI checks gate every merge to
main.