| 1 |
name: code |
| 2 |
|
| 3 |
on: |
| 4 |
pull_request: |
| 5 |
push: |
| 6 |
branches: |
| 7 |
- master |
| 8 |
paths: |
| 9 |
- pyproject.toml |
| 10 |
- uv.lock |
| 11 |
- "**.py" |
| 12 |
|
| 13 |
jobs: |
| 14 |
django-tests: |
| 15 |
runs-on: ubuntu-latest |
| 16 |
strategy: |
| 17 |
max-parallel: 4 |
| 18 |
matrix: |
| 19 |
python-version: ["3.12", "3.13", "3.14"] |
| 20 |
django-version: ["5.2", "6.0"] |
| 21 |
psycopg-version: ["psycopg", "psycopg2"] |
| 22 |
services: |
| 23 |
postgres: |
| 24 |
image: postgres:18 |
| 25 |
env: |
| 26 |
POSTGRES_PASSWORD: postgres |
| 27 |
ports: |
| 28 |
- 5432:5432 |
| 29 |
options: --name postgres --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 |
| 30 |
steps: |
| 31 |
- uses: actions/checkout@v3 |
| 32 |
- name: Install uv |
| 33 |
uses: astral-sh/setup-uv@v4 |
| 34 |
with: |
| 35 |
version: "latest" |
| 36 |
- name: Set up Python ${{ matrix.python-version }} |
| 37 |
uses: actions/setup-python@v4 |
| 38 |
with: |
| 39 |
python-version: ${{ matrix.python-version }} |
| 40 |
- name: Install Dependencies |
| 41 |
run: uv sync --group dev |
| 42 |
- name: Install Django specific version ${{ matrix.django-version }} |
| 43 |
run: uv pip install "Django~=${{ matrix.django-version }}" |
| 44 |
- name: Install psycopg specific version ${{ matrix.psycopg-version }} |
| 45 |
run: uv pip install ${{ matrix.psycopg-version }} |
| 46 |
- name: Run Tests |
| 47 |
run: | |
| 48 |
uv run pytest --cov="django_pgschemas" sandbox/tests |
| 49 |
uv run coverage lcov -o ./coverage/lcov.info |
| 50 |
- name: Upload coverage to Coveralls in parallel |
| 51 |
uses: coverallsapp/github-action@master |
| 52 |
with: |
| 53 |
github-token: ${{ secrets.GITHUB_TOKEN }} |
| 54 |
flag-name: run-py${{ matrix.python-version }}-Django${{ matrix.django-version }}-${{ matrix.psycopg-version }} |
| 55 |
parallel: true |
| 56 |
finish: |
| 57 |
needs: django-tests |
| 58 |
runs-on: ubuntu-latest |
| 59 |
steps: |
| 60 |
- name: Finish report to Coveralls |
| 61 |
uses: coverallsapp/github-action@master |
| 62 |
with: |
| 63 |
github-token: ${{ secrets.GITHUB_TOKEN }} |
| 64 |
parallel-finished: true |