The CI pipeline automatically runs on every pull request to ensure code quality, test coverage, and security before merging changes.
- Pull Requests: Automatically runs when PRs are opened or updated against
mainordevelopbranches - Push Events: Runs on direct pushes to
mainordevelopbranches - Manual: Can be triggered manually via GitHub Actions UI using
workflow_dispatch
Runs the complete test suite to verify functionality.
Steps:
- Checkout code
- Setup Node.js 18
- Install dependencies with
npm ci - Initialize database
- Run tests with
npm test
Environment:
CI: true- Indicates CI environmentMOCK_STELLAR: true- Uses mock Stellar networkAPI_KEYS: test-key-1,test-key-2- Test API keys
Generates test coverage reports and uploads them as artifacts.
Steps:
- Checkout code
- Setup Node.js 18
- Install dependencies
- Initialize database
- Run
npm run test:coverage - Upload coverage reports (30-day retention)
Artifacts:
- Coverage reports available in GitHub Actions artifacts
- Includes both text and lcov formats
Checks code quality and style using ESLint with security plugins.
Steps:
- Checkout code
- Setup Node.js 18
- Install dependencies
- Run
npm run lint:security
Configuration:
- Maximum 100 warnings allowed
- Includes security and secrets detection plugins
Audits npm dependencies for known vulnerabilities.
Steps:
- Checkout code
- Setup Node.js 18
- Install dependencies
- Run
npm audit --audit-level=critical
Note: Continues on error to not block PRs, but reports issues
Aggregates results from all jobs and provides final pass/fail status.
Behavior:
- Runs after all other jobs complete
- Checks results of test, coverage, and lint jobs
- Fails if any critical job fails
- Security job failures don't block (informational only)
When you create or update a PR, you'll see these status checks:
- ✅ Run Tests - Test suite passed
- ✅ Test Coverage - Coverage generated successfully
- ✅ Code Linting - Code quality checks passed
- ℹ️ Security Checks - Dependency audit (informational)
- ✅ CI Status - Overall pipeline status
Before pushing, you can run the same checks locally:
# Install dependencies
npm ci
# Initialize database
npm run init-db
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Run linting
npm run lint:security
# Run security audit
npm auditMOCK_STELLAR=true- Uses mock Stellar network instead of real networkAPI_KEYS=test-key-1,test-key-2- Test API keys for authentication
CI=true- Automatically set by GitHub Actions
- Dependency Caching: npm dependencies are cached between runs
- Parallel Execution: All jobs run in parallel for faster feedback
- Clean Installs: Uses
npm cifor reproducible builds
- Check which job failed in the GitHub Actions tab
- Review the job logs for specific errors
- Run the same command locally to reproduce
- Fix the issue and push again
# Run locally to see issues
npm run lint:security
# Auto-fix where possible
npm run lint:security -- --fix# Run tests locally
npm test
# Run specific test file
npm test -- path/to/test.js
# Run with verbose output
npm test -- --verbose# Generate coverage report locally
npm run test:coverage
# View HTML report
open coverage/lcov-report/index.html- Always run tests locally before pushing
- Fix linting issues before creating PR
- Check coverage for new code
- Review security warnings from audit
- Keep dependencies updated to avoid vulnerabilities
.github/workflows/ci.yml