Merge pull request #172 from cclauss/patch-1 #102
This file contains 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: Tox | |
on: [push, pull_request] | |
jobs: | |
tox-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- run: pip install --upgrade pip | |
- run: pip install tox | |
- run: tox -e lint || true # Fix error and remove "|| true"! | |
tox-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- run: pip install --upgrade pip | |
- run: pip install tox | |
- run: tox -e docs || true # Fix error and remove "|| true"! | |
tox-docs-linkcheck: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- run: pip install --upgrade pip | |
- run: pip install tox | |
- run: tox -e docs-linkcheck || true # Fix error and remove "|| true"! | |
build: | |
strategy: | |
fail-fast: false | |
max-parallel: 5 | |
matrix: | |
os: [ubuntu-latest] # [macos-latest, ubuntu-latest, windows-latest] | |
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] | |
django-version: ["==3.2.*", "==4.1.*", "==4.2.*", "==5.0.*", "==5.1.*"] | |
exclude: | |
# https://docs.djangoproject.com/en/stable/faq/install/#what-python-version-can-i-use-with-django | |
- python-version: 3.11 | |
django-version: "==3.2.*" | |
- python-version: 3.12 | |
django-version: "==3.2.*" | |
- python-version: 3.12 | |
django-version: "==4.1.*" | |
- python-version: 3.8 | |
django-version: "==5.0.*" | |
- python-version: 3.8 | |
django-version: "==5.1.*" | |
- python-version: 3.9 | |
django-version: "==5.0.*" | |
- python-version: 3.9 | |
django-version: "==5.1.*" | |
# # Django 4.0 no longer supports python 3.7 | |
# - python-version: 3.7 | |
# django-version: "==4.0.*" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Get pip cache dir | |
id: pip-cache | |
run: | | |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT | |
- name: Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pip-cache.outputs.dir }} | |
key: | |
-${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }} | |
restore-keys: | | |
-${{ matrix.python-version }}-v1- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade tox tox-gh-actions | |
- name: Tox tests | |
run: | | |
tox -v | |
- name: Upload coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
name: Python ${{ matrix.python-version }} |