integration tests that hit actual database #18
Workflow file for this run
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: | |
| branches: [main] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install ruff mypy django-stubs django | |
| - name: Ruff check | |
| run: ruff check . | |
| - name: Ruff format check | |
| run: ruff format --check . | |
| - name: Type check | |
| run: mypy src/paradedb | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.13"] | |
| django-version: ["6.0"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install "Django~=${{ matrix.django-version }}.0" | |
| pip install -e ".[dev]" | |
| # Tests SQL generation only - no database required | |
| - name: Run tests | |
| run: pytest --cov=paradedb --cov-report=xml | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: false | |
| integration: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| services: | |
| paradedb: | |
| image: paradedb/paradedb:0.21.4-pg17 | |
| ports: | |
| - 5432:5432 | |
| env: | |
| PARADEDB_INTEGRATION: "1" | |
| PARADEDB_TEST_DSN: postgresql://postgres@localhost:5432/postgres | |
| PGPASSWORD: postgres | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.13 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Wait for ParadeDB | |
| env: | |
| PARADEDB_TEST_DSN: ${{ env.PARADEDB_TEST_DSN }} | |
| run: | | |
| python - <<'PY' | |
| import os | |
| import time | |
| import psycopg | |
| dsn = os.environ["PARADEDB_TEST_DSN"] | |
| for _ in range(30): | |
| try: | |
| with psycopg.connect(dsn) as conn: | |
| with conn.cursor() as cur: | |
| cur.execute("SELECT 1;") | |
| break | |
| except Exception: | |
| time.sleep(2) | |
| else: | |
| raise SystemExit("ParadeDB did not become ready in time") | |
| PY | |
| - name: Run integration tests | |
| env: | |
| PARADEDB_INTEGRATION: ${{ env.PARADEDB_INTEGRATION }} | |
| PARADEDB_TEST_DSN: ${{ env.PARADEDB_TEST_DSN }} | |
| PGPASSWORD: ${{ env.PGPASSWORD }} | |
| run: pytest -m integration |