| 1 |
name: test |
| 2 |
on: [push, pull_request] |
| 3 |
jobs: |
| 4 |
formatting: |
| 5 |
runs-on: ubuntu-latest |
| 6 |
steps: |
| 7 |
- uses: actions/checkout@v6 |
| 8 |
|
| 9 |
- name: Install uv |
| 10 |
uses: astral-sh/setup-uv@v7 |
| 11 |
with: |
| 12 |
python-version: "3.12" |
| 13 |
|
| 14 |
- name: Run ruff |
| 15 |
run: uvx ruff check |
| 16 |
|
| 17 |
|
| 18 |
typecheck: |
| 19 |
runs-on: ubuntu-latest |
| 20 |
steps: |
| 21 |
- uses: actions/checkout@v6 |
| 22 |
|
| 23 |
- name: Install uv |
| 24 |
uses: astral-sh/setup-uv@v7 |
| 25 |
with: |
| 26 |
python-version: "3.12" |
| 27 |
|
| 28 |
- name: Run mypy |
| 29 |
run: uvx mypy dj_database_url |
| 30 |
|
| 31 |
- name: Run pyright |
| 32 |
run: uvx pyright dj_database_url |
| 33 |
|
| 34 |
test: |
| 35 |
runs-on: ubuntu-latest |
| 36 |
needs: [formatting, typecheck] |
| 37 |
strategy: |
| 38 |
fail-fast: false |
| 39 |
matrix: |
| 40 |
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
| 41 |
django-version: ["4.2", "5.2", "6.0"] |
| 42 |
exclude: |
| 43 |
# django 4.x is not compatible with python 3.13 or higher |
| 44 |
- python-version: "3.13" |
| 45 |
django-version: "4.2" |
| 46 |
- python-version: "3.14" |
| 47 |
django-version: "4.2" |
| 48 |
# django 6.x is not compatible with python 3.11 or lower |
| 49 |
- python-version: "3.10" |
| 50 |
django-version: "6.0" |
| 51 |
- python-version: "3.11" |
| 52 |
django-version: "6.0" |
| 53 |
|
| 54 |
steps: |
| 55 |
- uses: actions/checkout@v4 |
| 56 |
|
| 57 |
- name: Install uv and set the Python version |
| 58 |
uses: astral-sh/setup-uv@v7 |
| 59 |
with: |
| 60 |
python-version: ${{ matrix.python-version }} |
| 61 |
activate-environment: 'true' |
| 62 |
|
| 63 |
- name: Install dependencies |
| 64 |
run: | |
| 65 |
uv pip install "Django~=${{ matrix.django-version }}.0" |
| 66 |
|
| 67 |
- name: Run Tests |
| 68 |
run: | |
| 69 |
echo "$(python --version) / Django $(django-admin --version)" |
| 70 |
uvx coverage run --source=dj_database_url --branch -m unittest discover -v |
| 71 |
uvx coverage report |
| 72 |
uvx coverage xml |
| 73 |
|
| 74 |
- uses: codecov/codecov-action@v4 |