Skip to content

Fix tests

Fix tests #152

Workflow file for this run

name: Lint & Test
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9.7"
- name: Install poetry
run: |
pip install poetry
- name: Set Poetry config
run: |
poetry config virtualenvs.in-project false
poetry config virtualenvs.path ~/.virtualenvs
- name: Install Dependencies
run: poetry install
if: steps.cache.outputs.cache-hit != 'true'
- name: Lint
run: |
poetry run codespell src/ tests/ || true # --ignore-words-list="" --skip=""
poetry run black --check --diff --color .
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
poetry run flake8 . --count --ignore=E203,W503,E501,F841 --exit-zero --max-complexity=10 --max-line-length=88 --show-source --statistics
poetry run isort --check-only --profile black .
test:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9.7"
- name: Install poetry
run: |
pip install poetry
- name: Set Poetry config
run: |
poetry config virtualenvs.in-project false
poetry config virtualenvs.path ~/.virtualenvs
- name: Install Dependencies
run: poetry install
if: steps.cache.outputs.cache-hit != 'true'
- name: Test
run: |
poetry run pytest --cov=./ --cov-report=xml
shopt -s globstar && poetry run pyupgrade --py39-plus **/*.py || true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: false