Skip to content

Precommit-hooks (#97) #285

Precommit-hooks (#97)

Precommit-hooks (#97) #285

Workflow file for this run

name: test and lint
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
workflow_call:
jobs:
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"
- name: Install dependencies
run: poetry install --with dev
- name: check ruff
run: poetry run ruff check $(git ls-files '*.py')
- name: lint code
run: poetry run pylint $(git ls-files '*.py') --fail-under 7.0 --verbose
- name: check docstyle (Google styledoc)
run: poetry run pydocstyle $(git ls-files '*.py') --verbose --convention=google
- name: check changelog
run: poetry run changelogmanager --error-format github validate
- name: run mypy
run: poetry run mypy $(git ls-files '*.py')
- name: check black formatting
run: poetry run black --check --verbose $(git ls-files '*.py')
- name: check sorted order
run: poetry run isort $(git ls-files '*.py') --check-only
test:
timeout-minutes: 5
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install dependencies
run: poetry install --with dev,github-actions
- name: Run tests
run: poetry run pytest --cov --cov-fail-under 90 --cov-report term-missing