-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (77 loc) · 2.32 KB
/
test.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
name: "Test"
on: push
# Our test suite should cover:
# - Compatibility with the most recent versions of Python and Django
# - At least one test run for older supported version of Python and Django
# Current configuration:
# - python 3.12, django 5.0
# - python 3.12, django 4.2
# - python 3.11, django 4.1
# - python 3.10, django 4.0
# - python 3.9, django 3.2
jobs:
lint:
name: 🧹 Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.12
cache: "pip"
cache-dependency-path: "**/pyproject.toml"
- run: pip install -e .[lint]
- name: Run ruff
run: ruff check .
test:
name: 🧪 Test
needs: lint
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
env:
DJANGO_SETTINGS_MODULE: querystring_tag.testapp.settings
strategy:
matrix:
include:
- name: dj5-py312
django: 'Django>=5,<5.1'
python: '3.12'
latest: true
experimental: false
- name: dj42-py312
django: 'Django>=4.2,<5'
python: '3.12'
experimental: false
- name: dj41-py311
django: 'Django>=4.1,<4.2'
python: '3.11'
experimental: false
- name: dj32-py39
django: 'Django>=3.2,<4.0'
python: '3.9'
experimental: false
- name: djmain-py312
django: 'git+https://github.com/django/django.git@main#egg=Django'
python: '3.12'
experimental: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.cfg') }}-${{ matrix.name }}
restore-keys: ${{ runner.os }}-pip-
- run: |
pip install -e .[test]
pip install "${{ matrix.django }}"
- if: ${{ !matrix.latest }}
run: pytest
- if: ${{ matrix.latest }}
run: pytest --junitxml=junit/test-results.xml --cov=querystring_tag
- if: ${{ matrix.latest }}
uses: codecov/codecov-action@v3
with:
name: Python 3.10