-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (54 loc) · 1.75 KB
/
test.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
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@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
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.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
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