Skip to content

Extract MFAViewSetMixin to use with Simple Token or JWT authentication #22

Extract MFAViewSetMixin to use with Simple Token or JWT authentication

Extract MFAViewSetMixin to use with Simple Token or JWT authentication #22

name: 'Lint and test'
on:
push:
jobs:
test:
runs-on: ubuntu-latest
env:
PYTHONPATH: ./testproject
DJANGO_SETTINGS_MODULE: settings
SECRET_KEY: this_is_no_secret_at_all
strategy:
matrix:
python-version: [3.8, 3.9]
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 dependencies
run: |
python -m pip install --upgrade pip
python -m pip install mypy flake8 pytest pytest-xdist flaky
if [ -f testproject/requirements.txt ]; then pip install -r testproject/requirements.txt; fi
ln -s $(pwd)/trench/ $(pwd)/testproject/trench
- name: Lint trench package with flake8
run: |
# Stop the build if there are Python syntax errors or undefined names.
flake8 ./trench/ --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide.
flake8 ./trench/ --count --exit-zero --max-complexity=10 --statistics
- name: Check trench package's type hints with mypy
run: |
mypy ./trench/
- name: Lint testproject with flake8
run: |
# Stop the build if there are Python syntax errors or undefined names.
flake8 ./testproject/ --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide.
flake8 ./testproject/ --count --exit-zero --max-complexity=10 --statistics
- name: Check testproject's type hints with mypy
run: |
mypy ./testproject/
- name: Test with pytest
run: |
python -m pytest --cov-report=xml --cov=testproject/trench testproject/tests/
# - uses: codecov/codecov-action@v1
# with:
# files: ./coverage.xml
# fail_ci_if_error: true
# name: trench
# verbose: true