name: CI on: push: branches: [main] pull_request: branches: [main] jobs: backend-tests: runs-on: ubuntu-latest services: postgres: image: postgres:16 env: POSTGRES_USER: mabea POSTGRES_PASSWORD: mabea_test POSTGRES_DB: mabea_test ports: - 5432:5432 options: >- --health-cmd "pg_isready -U mabea" --health-interval 10s --health-timeout 5s --health-retries 5 env: DATABASE_URL: postgresql+asyncpg://mabea:mabea_test@localhost:5432/mabea_test JWT_SECRET_KEY: ci-test-secret-key SYSTEMKNOTEN_ID: "1" defaults: run: working-directory: backend steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: "3.11" - name: Install dependencies run: | python -m pip install --upgrade pip pip install -e ".[dev]" - name: Run migrations run: alembic upgrade head - name: Run tests with coverage gate run: pytest