Precommit-hooks #282
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |