This repository includes a GitHub Actions CI pipeline that automatically validates code quality, type safety, and builds on every push and pull request to the main branch.
- Push events to the
mainbranch - Pull requests targeting the
mainbranch
- Code Checkout - Retrieves the latest code from the repository
- Node.js Setup - Configures Node.js (18.x, 20.x, 22.x) with npm dependency caching
- Dependencies Installation - Installs project dependencies using
npm ci - Linting - Runs ESLint to check code quality and style consistency
- Type Checking - Validates TypeScript types using
tsc --noEmit - Build - Compiles the project to ensure it builds successfully
- Artifact Upload - Saves build output for download and inspection
The following npm scripts are configured for the CI pipeline:
{
"lint": "eslint . --ext .ts,.tsx,.js,.jsx",
"type-check": "tsc --noEmit",
"build": "vite build"
}- Build files: The compiled application is uploaded as an artifact named
build-files-{commit-sha} - Retention: Artifacts are kept for 7 days
- Contents: Optimized production build located in the
dist/directory
Located at .github/workflows/ci.yml
- Multi-Node Support: Tests across Node.js LTS versions (18.x, 20.x, 22.x)
- Enhanced Caching: Caches both npm and package-lock.json for optimal performance
- Dependency Caching: Speeds up subsequent runs with intelligent cache strategies
- Parallel Jobs: Runs tests across multiple Node.js versions simultaneously
- Artifact Management: Automatic upload of build results
When a testing framework is added to the project, uncomment the following step in the workflow:
- name: Run tests
run: npm testIntegration with code coverage tools can be added:
- name: Generate coverage report
run: npm run coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4Add build performance tracking:
- name: Bundle Analysis
run: npm run analyze
- name: Performance Budget Check
run: npm run perf-budget- Enhanced Caching: Uses
cache-dependency-path: package-lock.jsonfor more precise cache invalidation - Fast Installation:
npm ciensures reproducible builds and faster installs thannpm install - Parallel Execution: Multiple Node.js versions tested simultaneously for faster feedback
- Multi-Node Compatibility: Tests across Node.js 18.x, 20.x, and 22.x to ensure broad compatibility
- Deterministic Builds: Uses exact dependency versions from package-lock.json
- Build Artifacts: Preserves build output with commit SHA for debugging and deployment
- Code Quality: ESLint ensures consistent code style and catches potential issues
- Type Safety: TypeScript compilation validates type correctness
- Build Verification: Ensures the application builds successfully before deployment
- Lint failures: Fix ESLint errors before pushing
- Type errors: Resolve TypeScript compilation issues
- Build failures: Ensure all dependencies are properly installed
Before pushing, run the same checks locally:
npm run lint
npm run type-check
npm run build- Dependencies: Keep GitHub Actions up to date
- Node.js Version: Update when new LTS versions are released
- Scripts: Ensure npm scripts remain functional as the project evolves