Skip to content

chore: add pytest and github workflows #37

chore: add pytest and github workflows

chore: add pytest and github workflows #37

Workflow file for this run

name: Run Pytest
on: [push, pull_request]
env:
UV_SYSTEM_PYTHON: 1
jobs:
test:
name: Test on Python ${{ matrix.python-version }} and Django ${{ matrix.django-version }}
runs-on: ubuntu-latest
outputs:
failing-test: ${{ steps.test.outputs.fail }}
strategy:
matrix:
include:
# Django 4.2 combinations - supports Python 3.8-3.12
- python-version: "3.8"
django-version: "django>=4.2,<5.0"
- python-version: "3.9"
django-version: "django>=4.2,<5.0"
- python-version: "3.10"
django-version: "django>=4.2,<5.0"
- python-version: "3.11"
django-version: "django>=4.2,<5.0"
- python-version: "3.12"
django-version: "django>=4.2,<5.0"
# Django 5.0 combinations - requires Python 3.10+
- python-version: "3.11"
django-version: "django>=5.0.6,<5.1"
- python-version: "3.12"
django-version: "django>=5.0.6,<5.1"
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: '${{ matrix.python-version }}'
- name: Install the project
run: |
uv sync --all-extras --dev
uv add '${{ matrix.django-version }}; python_version == "${{ matrix.python-version }}"'
- name: Run tests
id: test
run: |
uv run python -m django --version
uv run pytest