fix: add missing package init files for CI #2
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 CI | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| python-tests: | |
| name: Python + Postgres tests | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: mlis | |
| POSTGRES_PASSWORD: mlis | |
| POSTGRES_DB: mlis | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U mlis -d mlis" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| env: | |
| TEST_DATABASE_URL: postgresql+psycopg://mlis:mlis@localhost:5432/mlis | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e ".[test]" | |
| - name: Install PostgreSQL client | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y postgresql-client | |
| - name: Apply database schema | |
| run: | | |
| PGPASSWORD=mlis psql -h localhost -U mlis -d mlis -v ON_ERROR_STOP=1 -f db/init/001_schema.sql | |
| - name: Run unit tests | |
| run: pytest tests/unit -q | |
| - name: Run integration tests | |
| run: pytest tests/integration -q |