Merge pull request #72 from DRYTRIX/dependabot/npm_and_yarn/frontend/… #177
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: | |
| jobs: | |
| backend: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: catmap | |
| POSTGRES_PASSWORD: catmap | |
| POSTGRES_DB: catmap | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| DATABASE_URL: postgresql+psycopg://catmap:catmap@localhost:5432/catmap | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: "3.12" | |
| - name: Install deps | |
| working-directory: backend | |
| run: pip install -r requirements-dev.txt | |
| - name: Lint (ruff) | |
| working-directory: backend | |
| run: ruff check app tests | |
| - name: Test (pytest) | |
| working-directory: backend | |
| run: pytest | |
| - name: Audit dependencies (pip-audit) | |
| working-directory: backend | |
| run: pip-audit -r requirements.txt | |
| continue-on-error: true | |
| frontend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: "22" | |
| - name: Install deps | |
| working-directory: frontend | |
| # Uses package-lock.json when present (commit it for reproducible builds). | |
| run: npm install | |
| - name: Unit tests (vitest) | |
| working-directory: frontend | |
| run: npm test | |
| - name: Build | |
| working-directory: frontend | |
| run: npm run build | |
| - name: Audit dependencies (npm audit) | |
| working-directory: frontend | |
| run: npm audit --audit-level=high | |
| continue-on-error: true | |
| e2e: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: "22" | |
| - name: Install deps | |
| working-directory: frontend | |
| run: npm install | |
| - name: Install Playwright browsers | |
| working-directory: frontend | |
| run: npx playwright install --with-deps chromium | |
| - name: Run e2e tests (Playwright) | |
| working-directory: frontend | |
| run: npm run e2e | |
| - name: Upload Playwright report | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: playwright-report | |
| path: frontend/playwright-report/ | |
| retention-days: 7 | |
| docker: | |
| runs-on: ubuntu-latest | |
| needs: [backend, frontend] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Build backend image | |
| run: docker build -t catmap-backend ./backend | |
| - name: Build frontend image | |
| run: docker build -t catmap-frontend ./frontend |