Add uuid to identify disasters #6
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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| lint-test-build: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgis/postgis:15-3.4 | |
| ports: | |
| - 5432:5432 | |
| env: | |
| POSTGRES_DB: disasters_test | |
| POSTGRES_USER: disasters | |
| POSTGRES_PASSWORD: disasters_pass | |
| options: >- | |
| --health-cmd "pg_isready -U disasters" --health-interval 10s --health-timeout 5s --health-retries 5 | |
| env: | |
| POSTGRES_URI: postgresql://disasters:disasters_pass@localhost:5432/disasters_test | |
| NODE_ENV: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint | |
| run: npm run lint | |
| - name: Run tests with coverage | |
| run: npm run test:ci | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage/lcov.info | |
| continue-on-error: true | |
| - name: Build Docker image | |
| run: docker build -t disasters-api . |