-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (44 loc) · 1.54 KB
/
python-checks.yaml
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
55
name: Test and Lint Python code
on:
pull_request:
branches:
- main
paths:
- "**.py"
- "pyproject.toml"
- "poetry.lock"
# Allow manual triggering through GitHub
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
name: Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install Dependencies
run: poetry install
if: steps.cache.outputs.cache-hit != 'true'
- name: isort - check import formatting
run: PYTHONPATH=src/ poetry run python -m isort --check --diff --profile black src
- name: Black - check code formatting
run: PYTHONPATH=src/ poetry run python -m black --check --diff src
- name: pylint - static code analysis
run: PYTHONPATH=src/ poetry run python -m pylint src/
- name: mypy - static type checking
# Takes configuration from pyproject.toml
run: PYTHONPATH=src/ poetry run python -m mypy
# - name: pytest - run the tests
# run: PYTHONPATH=src/ poetry run python -m pytest -v --cov=src/ tests/
# - name: Run Coverage
# run: PYTHONPATH=src/ poetry run python -m coverage report -m;
# - name: Generate test coverage XML Report
# run: PYTHONPATH=src/ poetry run python -m coverage xml