-
Notifications
You must be signed in to change notification settings - Fork 31
79 lines (74 loc) · 2.42 KB
/
python-package.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
name: Python package
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
# python: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
python: ["3.11", "3.12"]
django: [
# "Django>=1.11,<2.0",
# "Django>=2.0,<2.1",
# "Django>=2.1,<2.2",
# "Django>=2.2,<3.0",
# "Django>=3.0,<3.1",
# "Django>=3.1,<3.2",
# "Django>=3.2,<4.0",
# "Django>=4.0,<4.1",
"dj41": "Django>=4.1,<4.2",
"dj42": "Django>=4.2,<5.0",
]
exclude:
- django: "dj41", "dj42"
python: "3.11"
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install pytest, pytest-django and pytest-lazy-fixture, django and impostor
run: |
pip install pytest==7.4.3 pytest-django==4.5.0 pytest-lazy-fixture==0.6.3
pip install "${{ matrix.django }}"
pip install -e .
- name: Run tests
run: pytest -v tests/
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
- name: Install Tox and any other packages
run: |
pip install flake8
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Install Coverage
run: |
pip install django pytest==7.4.3 pytest-django==4.7.0 pytest-lazy-fixture==0.6.3 pytest-cov==4.1.0
pip install -e .
- name: Execute coverage
run: |
# execute tests with coverage
pytest --cov-report=xml --cov=impostor tests/
export CODECOV_TOKEN="${{ secrets.CODECOV_TOKEN }}"
bash <(curl -s https://codecov.io/bash)