-
Notifications
You must be signed in to change notification settings - Fork 27
63 lines (60 loc) · 1.63 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
name: test
on:
pull_request:
push:
branches:
- master
jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11.0"
- run: pip install pre-commit
- run: pre-commit run --all-files
env:
SKIP: rst
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.9.18", "3.10.13", "3.11.7", "3.12.1" ]
django-version: [ "4.2", "5.0", "5.1" ]
exclude:
# Django v5 drops Python <3.10 support
- django-version: 5.0
python-version: 3.9.18
- django-version: 5.1
python-version: 3.9.18
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
- uses: snok/install-poetry@v1
with:
virtualenvs-create: false
version: 1.2.2
- run: |
pip install virtualenv
virtualenv .venv
source .venv/bin/activate
pip install pip setuptools wheel -U
poetry install --no-interaction --no-root
- run: |
source .venv/bin/activate
pip install "Django==${{ matrix.django-version }}"
- name: Run tests
run: |
source .venv/bin/activate
coverage run -m pytest tests
coverage xml
coverage report
- uses: codecov/codecov-action@v2
with:
file: ./coverage.xml
fail_ci_if_error: true
if: matrix.python-version == '3.11'