-
-
Notifications
You must be signed in to change notification settings - Fork 120
88 lines (86 loc) · 2.33 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
name: Tests
# yamllint disable-line rule:truthy
on:
push:
branches:
- main
- v*
pull_request:
branches:
- main
- v*
release:
types:
- released
jobs:
typing:
name: Typing
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
cache: poetry
- name: Install Deps
run: poetry install
- run: echo "$(poetry env info --path)/bin" >> $"GITHUB_PATH"
- id: venv
run: echo "python-path=$(poetry env info --path)/bin/python3" >> "$GITHUB_OUTPUT"
- name: Check for pyright errors
uses: jakebailey/pyright-action@v1
with:
python-path: ${{ steps.venv.outputs.python-path }}
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
django-version:
- 4.2.*
- 5.0.*
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
mode:
- std
- geos
exclude:
# Django 5.0 only supports python 3.10+
- django-version: 5.0.*
python-version: '3.8'
- django-version: 5.0.*
python-version: '3.9'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install OS Dependencies
if: ${{ matrix.mode == 'geos' }}
uses: daaku/gh-action-apt-install@v4
with:
packages: binutils gdal-bin libproj-dev libsqlite3-mod-spatialite
- name: Install Poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v5
with:
cache: poetry
python-version: ${{ matrix.python-version }}
- name: Install Deps
run: poetry install
- name: Install Django ${{ matrix.django-version }}
run: poetry run pip install "django==${{ matrix.django-version }}"
- name: Test with pytest
run: poetry run pytest --showlocals -vvv --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}