| 1 |
--- |
| 2 |
name: Django Rest Framework Gis CI Build |
| 3 |
|
| 4 |
on: |
| 5 |
push: |
| 6 |
branches: |
| 7 |
- master |
| 8 |
pull_request: |
| 9 |
branches: |
| 10 |
- master |
| 11 |
|
| 12 |
jobs: |
| 13 |
build: |
| 14 |
name: Python==${{ matrix.env.python }} | ${{ matrix.env.TOXENV }} |
| 15 |
runs-on: ubuntu-24.04 |
| 16 |
|
| 17 |
services: |
| 18 |
postgres: |
| 19 |
image: postgis/postgis:17-3.5-alpine |
| 20 |
env: |
| 21 |
POSTGRES_PASSWORD: postgres |
| 22 |
POSTGRES_USER: postgres |
| 23 |
POSTGRES_DB: django_restframework_gis |
| 24 |
ports: |
| 25 |
- 5432:5432 |
| 26 |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 |
| 27 |
|
| 28 |
strategy: |
| 29 |
fail-fast: false |
| 30 |
matrix: |
| 31 |
env: |
| 32 |
# DRF 3.14 |
| 33 |
- python: "3.10" |
| 34 |
TOXENV: py310-django42-djangorestframework314-djangofilter235 |
| 35 |
- python: "3.11" |
| 36 |
TOXENV: py311-django42-djangorestframework314 |
| 37 |
# DRF 3.15 |
| 38 |
- python: "3.10" |
| 39 |
TOXENV: py310-django50-djangorestframework315 |
| 40 |
- python: "3.11" |
| 41 |
TOXENV: py311-django50-djangorestframework315 |
| 42 |
- python: "3.12" |
| 43 |
TOXENV: py312-django50-djangorestframework315 |
| 44 |
- python: "3.13" |
| 45 |
TOXENV: py313-django50-djangorestframework315 |
| 46 |
- python: "3.10" |
| 47 |
TOXENV: py310-django51-djangorestframework315 |
| 48 |
- python: "3.11" |
| 49 |
TOXENV: py311-django51-djangorestframework315 |
| 50 |
- python: "3.12" |
| 51 |
TOXENV: py312-django51-djangorestframework315 |
| 52 |
- python: "3.13" |
| 53 |
TOXENV: py313-django51-djangorestframework315 |
| 54 |
- python: "3.10" |
| 55 |
TOXENV: py310-django52-djangorestframework315 |
| 56 |
- python: "3.11" |
| 57 |
TOXENV: py311-django52-djangorestframework315 |
| 58 |
- python: "3.12" |
| 59 |
TOXENV: py312-django52-djangorestframework315 |
| 60 |
- python: "3.13" |
| 61 |
TOXENV: py313-django52-djangorestframework315 |
| 62 |
# DRF 3.16 |
| 63 |
- python: "3.11" |
| 64 |
TOXENV: py311-django50-djangorestframework316 |
| 65 |
- python: "3.12" |
| 66 |
TOXENV: py312-django50-djangorestframework316 |
| 67 |
- python: "3.13" |
| 68 |
TOXENV: py313-django50-djangorestframework316 |
| 69 |
- python: "3.11" |
| 70 |
TOXENV: py311-django51-djangorestframework316 |
| 71 |
- python: "3.12" |
| 72 |
TOXENV: py312-django51-djangorestframework316 |
| 73 |
- python: "3.13" |
| 74 |
TOXENV: py313-django51-djangorestframework316 |
| 75 |
- python: "3.11" |
| 76 |
TOXENV: py311-django52-djangorestframework316 |
| 77 |
- python: "3.12" |
| 78 |
TOXENV: py312-django52-djangorestframework316 |
| 79 |
- python: "3.13" |
| 80 |
TOXENV: py313-django52-djangorestframework316 |
| 81 |
# DRF 3.17 |
| 82 |
- python: "3.11" |
| 83 |
TOXENV: py311-django50-djangorestframework317 |
| 84 |
- python: "3.12" |
| 85 |
TOXENV: py312-django50-djangorestframework317 |
| 86 |
- python: "3.13" |
| 87 |
TOXENV: py313-django50-djangorestframework317 |
| 88 |
- python: "3.11" |
| 89 |
TOXENV: py311-django51-djangorestframework317-djangofilter251 |
| 90 |
- python: "3.12" |
| 91 |
TOXENV: py312-django51-djangorestframework317 |
| 92 |
- python: "3.13" |
| 93 |
TOXENV: py313-django51-djangorestframework317 |
| 94 |
- python: "3.11" |
| 95 |
TOXENV: py311-django52-djangorestframework317 |
| 96 |
- python: "3.12" |
| 97 |
TOXENV: py312-django52-djangorestframework317 |
| 98 |
- python: "3.13" |
| 99 |
TOXENV: py313-django52-djangorestframework317 |
| 100 |
- python: "3.12" |
| 101 |
TOXENV: py312-django60-djangorestframework317 |
| 102 |
- python: "3.13" |
| 103 |
TOXENV: py313-django60-djangorestframework317 |
| 104 |
# DRF 3.18 |
| 105 |
- python: "3.11" |
| 106 |
TOXENV: py311-django52-djangorestframework318 |
| 107 |
- python: "3.12" |
| 108 |
TOXENV: py312-django52-djangorestframework318-djangofilter261 |
| 109 |
- python: "3.13" |
| 110 |
TOXENV: py313-django52-djangorestframework318 |
| 111 |
- python: "3.12" |
| 112 |
TOXENV: py312-django60-djangorestframework318-djangofilter261 |
| 113 |
- python: "3.13" |
| 114 |
TOXENV: py313-django60-djangorestframework318 |
| 115 |
# Django 6.1 |
| 116 |
- python: "3.12" |
| 117 |
TOXENV: py312-django61-djangorestframework318-djangofilter261 |
| 118 |
- python: "3.13" |
| 119 |
TOXENV: py313-django61-djangorestframework318 |
| 120 |
steps: |
| 121 |
- uses: actions/checkout@v7 |
| 122 |
with: |
| 123 |
ref: ${{ github.event.pull_request.head.sha }} |
| 124 |
|
| 125 |
- name: Set up Python ${{ matrix.env.python }} |
| 126 |
uses: actions/setup-python@v7 |
| 127 |
with: |
| 128 |
python-version: ${{ matrix.env.python }} |
| 129 |
cache: "pip" |
| 130 |
cache-dependency-path: | |
| 131 |
**/requirements*.txt |
| 132 |
|
| 133 |
- name: Install Dependencies |
| 134 |
id: deps |
| 135 |
run: | |
| 136 |
sudo apt -qq update |
| 137 |
sudo apt -qq -y install binutils libproj-dev gdal-bin |
| 138 |
pip install -U pip wheel setuptools |
| 139 |
pip install -U -r requirements-test.txt |
| 140 |
pip install tox docutils pygments twine |
| 141 |
|
| 142 |
- name: QA checks |
| 143 |
run: | |
| 144 |
./run-qa-checks |
| 145 |
|
| 146 |
- name: Tests |
| 147 |
if: ${{ !cancelled() && steps.deps.conclusion == 'success' }} |
| 148 |
run: | |
| 149 |
tox -e ${{ matrix.env.TOXENV }} |
| 150 |
coverage combine |
| 151 |
coverage xml |
| 152 |
env: |
| 153 |
POSTGRES_HOST: localhost |
| 154 |
|
| 155 |
- name: Upload Coverage |
| 156 |
if: ${{ success() }} |
| 157 |
uses: coverallsapp/github-action@v2 |
| 158 |
with: |
| 159 |
parallel: true |
| 160 |
format: cobertura |
| 161 |
flag-name: python-${{ matrix.env.env }} |
| 162 |
github-token: ${{ secrets.GITHUB_TOKEN }} |
| 163 |
|
| 164 |
coveralls: |
| 165 |
needs: build |
| 166 |
runs-on: ubuntu-latest |
| 167 |
steps: |
| 168 |
- name: Coveralls Finished |
| 169 |
uses: coverallsapp/github-action@v2 |
| 170 |
with: |
| 171 |
parallel-finished: true |