-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Run tests | ||
|
||
env: | ||
DEFAULT_PYTHON: 3.9 | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test: | ||
name: Python ${{ matrix.python_version }} | ||
runs-on: ubuntu-latest | ||
env: | ||
TOX_POSARGS: -- --cov=. --cov-report=xml | ||
strategy: | ||
matrix: | ||
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python_version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python_version }} | ||
cache: "pip" | ||
cache-dependency-path: "requirements.txt" | ||
|
||
- name: Upgrade packaging tools | ||
run: python -m pip install --upgrade pip setuptools wheel | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-add-repository ppa:ubuntugis/ppa | ||
sudo apt-get update | ||
sudo apt-get install gdal-bin libgdal-dev | ||
python -m pip install --upgrade codecov tox | ||
- name: Run tox targets for Python ${{ matrix.python_version }} | ||
run: tox run -f py$(echo ${{ matrix.python_version }} | tr -d .) ${{ env.TOX_POSARGS }} | ||
|
||
- name: Upload Coverage to Codecov | ||
if: ${{ matrix.python_version == env.DEFAULT_PYTHON }} | ||
uses: codecov/codecov-action@v4 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ djangorestframework | |
isort | ||
psycopg2 | ||
pytest | ||
pytest-cov | ||
pyyaml | ||
requests | ||
requests-cache | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[tox] | ||
envlist = | ||
py38-django{32,40,41,42} | ||
py39-django{32,40,41,42} | ||
py310-django{32,40,41,42,main} | ||
py311-django{40,41,42,main} | ||
py312-django{40,41,42,main} | ||
|
||
[testenv] | ||
description = run unit tests | ||
commands = | ||
pytest {posargs} | ||
setenv = | ||
PYTHONDONTWRITEBYTECODE=1 | ||
PYTHONWARNINGS=once | ||
# Use constraints to ensure that the Django version doesn't get overridden when installing | ||
# package requirements, e.g. DRF might override it. | ||
constrain_package_deps = true | ||
deps = | ||
django32: Django>=3.2,<4.0 | ||
django40: Django>=4.0,<4.1 | ||
django41: Django>=4.1,<4.2 | ||
django42: Django>=4.2,<5.0 | ||
djangomain: https://github.com/django/django/archive/main.tar.gz | ||
-rrequirements.txt | ||
|
||
[testenv:{py310,py311,py312}-djangomain] | ||
ignore_outcome = true |