Skip to content

Commit

Permalink
github: add CI for test using pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
sandre35 committed Jan 11, 2024
1 parent 0f54d7a commit 86cb004
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Tests

on: push

jobs:
build:
runs-on: ubuntu-latest

name: Python ${{ matrix.python-version }} / ${{ matrix.django }}
strategy:
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
django:
- django32
- django42
- django50
exclude:
- django: django50
python-version: "3.8"
- django: django50
python-version: "3.9"
- django: django32
python-version: "3.11"
- django: django32
python-version: "3.12"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip setuptools wheel
pip install tox
- name: Run tests
run: tox -v -e py-${{ matrix.django }}
1 change: 1 addition & 0 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Django<5.1
django_testproject
pytest-django
4 changes: 4 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pytest]
django_find_project = false
DJANGO_SETTINGS_MODULE = dj_pagination.tests.settings
pythonpath = . dj_pagination
13 changes: 13 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[tox]
envlist =
py{38,39}-django{32,42}
py{310}-django{32,42,50}
py{311,312}-django{42,50}

[testenv]
commands = pytest -v -Wdefault::DeprecationWarning
deps =
-rdev_requirements.txt
django32: Django==3.2.*
django42: Django==4.2.*
django50: Django==5.0.*

0 comments on commit 86cb004

Please sign in to comment.