name: CI on: [push, pull_request] jobs: test-sqlite: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Check Python syntax run: python -m py_compile modern/backend/*.py - name: Install dependencies run: python -m pip install -r modern/backend/requirements_full.txt - name: Run migrations and tests (sqlite) run: | export DATABASE_URL=sqlite:///./modern/ci_test.db alembic -c modern/alembic.ini upgrade head PYTHONPATH=. pytest -q test-postgres: runs-on: ubuntu-latest services: postgres: image: postgres:15 env: POSTGRES_PASSWORD: postgres ports: - 5432:5432 options: >- --health-cmd "pg_isready -U postgres" --health-interval 10s --health-timeout 5s --health-retries 5 steps: - uses: actions/checkout@v4 - name: Check Python syntax run: python -m py_compile modern/backend/*.py - name: Install dependencies run: python -m pip install -r modern/backend/requirements_full.txt - name: Run migrations and tests (postgres) run: | export DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres alembic -c modern/alembic.ini upgrade head PYTHONPATH=. pytest -q test-mysql: runs-on: ubuntu-latest services: mysql: image: mysql:8 env: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: test ports: - 3306:3306 options: >- --health-cmd "mysqladmin ping -h localhost -uroot -proot" --health-interval 10s --health-timeout 5s --health-retries 5 steps: - uses: actions/checkout@v4 - name: Check Python syntax run: python -m py_compile modern/backend/*.py - name: Install dependencies run: python -m pip install -r modern/backend/requirements_full.txt - name: Run migrations and tests (mysql) run: | export DATABASE_URL=mysql+pymysql://root:root@localhost:3306/test alembic -c modern/alembic.ini upgrade head PYTHONPATH=. pytest -q