Further eliminate technical debt: complete type safety #102
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test-backend: | |
| runs-on: ubuntu-latest | |
| services: | |
| mongodb: | |
| image: mongo:7 | |
| ports: | |
| - 27017:27017 | |
| options: >- | |
| --health-cmd "mongosh --eval 'db.runCommand({ ping: 1 })'" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: backend/package-lock.json | |
| - name: Install backend dependencies | |
| run: | | |
| cd backend | |
| npm ci | |
| - name: Build backend | |
| run: | | |
| cd backend | |
| npm run build | |
| - name: Run backend tests | |
| run: | | |
| cd backend | |
| npm test -- --ci --coverage | |
| env: | |
| JWT_SECRET: test_secret_for_ci | |
| MONGO_URI: mongodb://localhost:27017/taskpilot-test | |
| NODE_ENV: test | |
| test-frontend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install frontend dependencies | |
| run: | | |
| cd frontend | |
| npm ci | |
| - name: Build frontend | |
| run: | | |
| cd frontend | |
| npm run build | |
| env: | |
| VITE_API_URL: http://localhost:4000/graphql | |
| - name: Run frontend tests | |
| run: | | |
| cd frontend | |
| npm test -- --run --coverage | |
| env: | |
| CI: true | |
| # Deployment: | |
| # Railway automatically deploys when changes are pushed to main branch | |
| # - Frontend: https://frontend-production-352e.up.railway.app | |
| # - Backend: https://backend-production.up.railway.app | |
| # Both services use Docker for deployment with health checks |