ci: add metrics dependencies to backend test workflow #20
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: Backend Tests | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| test-backend: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./backend | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: devbin_test | |
| ports: | |
| - 5433:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: "0.5.16" | |
| - name: Cache uv dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/uv | |
| key: uv-${{ runner.os }}-${{ hashFiles('backend/uv.lock') }} | |
| restore-keys: uv-${{ runner.os }}- | |
| - name: Install dependencies | |
| run: uv sync --extra test --extra migrations --extra metrics | |
| - name: Run tests | |
| env: | |
| APP_DATABASE_URL: postgresql+asyncpg://postgres:postgres@localhost:5433/devbin_test | |
| APP_BASE_FOLDER_PATH: ./files/devbin_test_files | |
| APP_DEBUG: "true" | |
| APP_CORS_DOMAINS: '["http://test"]' | |
| APP_ALLOW_CORS_WILDCARD: "false" | |
| run: uv run pytest |