forked from jazzband/django-two-factor-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (88 loc) · 2.73 KB
/
ci.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
89
90
91
92
93
94
95
96
97
98
99
100
name: build
on: [push]
jobs:
build:
name: Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }} (${{ matrix.variant }})
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental == 'true' }}
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8']
django-version: ['2.2', '3.0', '3.1']
variant: [normal, yubikey, custom_user]
experimental: ['true', 'false']
exclude:
- python-version: '3.5'
django-version: '3.0'
- python-version: '3.5'
django-version: '3.1'
- python-version: '3.5'
django-version: master
- django-version: '2.2'
experimental: 'true'
- django-version: '3.0'
experimental: 'true'
- django-version: '3.1'
experimental: 'true'
- django-version: master
experimental: 'false'
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Tox and any other packages
run: pip install tox tox-gh-actions codecov
- name: Test with tox
run: tox
env:
DJANGO: ${{matrix.django-version}}
VARIANT: ${{matrix.variant}}
- name: Generate coverage XML report
run: coverage xml
- name: Codecov
uses: codecov/[email protected]
env:
PYTHON: ${{matrix.python-version}}
DJANGO: ${{matrix.django-version}}
VARIANT: ${{matrix.variant}}
with:
fail_ci_if_error: true
env_vars: PTYHON,DJANGO,VARIANT
code_quality:
name: Code Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Tox
run: pip install tox
- name: isort
run: tox -e isort
- name: flake8
run: tox -e flake8
publish:
name: Publish package to PyPI
runs-on: ubuntu-latest
needs:
- build
- code_quality
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Build sdist and wheel
run: |
pip install pip setuptools wheel --upgrade
python setup.py sdist bdist_wheel
- name: Publish a Python distribution to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}