This repository uses GitHub Actions for continuous integration and deployment. The workflows are configured to ensure code quality and prevent broken code from being merged.
- Triggers: Push to
main,master, ordevelopbranches, and all pull requests - Jobs:
- Test: Runs on Node.js 18.x and 20.x matrix
- Installs dependencies with
yarn - Runs ESLint for code quality
- Executes Jest tests
- Generates test coverage reports
- Uploads coverage to Codecov (optional)
- Installs dependencies with
- Build: Runs after tests pass
- Builds the Next.js application to ensure it compiles successfully
- Test: Runs on Node.js 18.x and 20.x matrix
- Triggers: Pull requests to
main,master, ordevelopbranches - Purpose: Provides a single required status check for branch protection
- Jobs: Combines linting, testing, and building into one required check
To enforce these checks before merging, configure branch protection rules in your GitHub repository:
- Go to your repository on GitHub
- Navigate to Settings → Branches
- Click Add rule or edit existing rules
- For the branch name pattern, enter:
main(ormaster/developas appropriate) - Enable the following options:
- ✅ Require a pull request before merging
- ✅ Require status checks to pass before merging
- ✅ Require branches to be up to date before merging
- ✅ Require conversation resolution before merging
- In the Status checks section, add:
Required CI Checks(from branch-protection.yml)test (18.x)andtest (20.x)(from ci.yml)build(from ci.yml)
- Optionally enable:
- ✅ Restrict pushes that create files larger than 100 MB
- ✅ Require signed commits
The following test commands are available:
yarn test- Run all testsyarn test:watch- Run tests in watch modeyarn test:coverage- Run tests with coverage reportyarn test:domains- Run domain-specific testsyarn test:integration- Run integration tests
The workflow includes optional Codecov integration. To enable:
- Sign up at codecov.io
- Add your repository
- Get your repository token
- Add
CODECOV_TOKENto your repository secrets
- Ensure you're using the same Node.js version locally
- Check that all dependencies are properly specified in
package.json - Verify that tests don't depend on local environment variables
- Check that all TypeScript types are properly defined
- Ensure all imports are correctly resolved
- Verify that environment variables needed for build are available
- Ensure the workflow files are on the default branch
- Check that the workflow names match exactly in branch protection settings
- Verify that the workflows have been triggered at least once