feat: implement Express server with configuration, middleware, and ro… #1
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: Tests | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| jobs: | |
| lint-and-type-check: | |
| name: Lint and Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| - run: npm ci | |
| - run: npm run lint | |
| - run: npm run type-check | |
| - run: npm run format:check | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| - run: npm ci | |
| - run: npm run test:unit | |
| - run: npm run test:coverage | |
| - uses: codecov/codecov-action@v3 | |
| with: | |
| files: ./coverage/lcov.info | |
| fail_ci_if_error: false | |
| integration-tests: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:15-alpine | |
| env: | |
| POSTGRES_DB: test_db | |
| POSTGRES_USER: test_user | |
| POSTGRES_PASSWORD: test_pass | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| redis: | |
| image: redis:7-alpine | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 6379:6379 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| - run: npm ci | |
| - run: npm run test:integration | |
| env: | |
| DB_HOST: localhost | |
| DB_PORT: 5432 | |
| DB_NAME: test_db | |
| DB_USER: test_user | |
| DB_PASSWORD: test_pass | |
| REDIS_HOST: localhost | |
| REDIS_PORT: 6379 | |
| security-audit: | |
| name: Security Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| - run: npm ci | |
| - run: npm audit --audit-level=moderate | |
| continue-on-error: true | |
| - name: Upload audit results | |
| if: failure() | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: npm-audit-results | |
| path: npm-audit.json | |