-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (63 loc) · 1.64 KB
/
code-quality.yml
File metadata and controls
77 lines (63 loc) · 1.64 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Code Quality Check
on:
push:
branches: [ main, develop ]
paths:
- 'src/**'
- 'tests/**'
pull_request:
branches: [ main, develop ]
paths:
- 'src/**'
- 'tests/**'
jobs:
quality:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install quality tools
run: |
pip install flake8 black isort mypy bandit
- name: Run flake8
run: |
flake8 src/ --max-line-length=88 --extend-ignore=E203,W503 --exclude=*.pyc,__pycache__
- name: Run black
run: |
black --check src/
- name: Run isort
run: |
isort --check src/
- name: Run mypy
run: |
mypy src/ --strict
- name: Run bandit
run: |
bandit -r src/ --skip B101,B303,B305,B311,B404,B506,B603,B607,B701,B703,B807
- name: Run pylint
run: |
pip install pylint
pylint src/ --rcfile=.pylintrc
- name: Run radon
run: |
pip install radon
radon cc -a -nc src/
radon mi -s src/
radon raw -s src/
- name: Run pytest with coverage
run: |
pip install pytest pytest-cov
python -m pytest tests/ --cov=src --cov-report=xml:coverage.xml --cov-report=term-missing
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
file: coverage.xml
name: code-quality
flags: code-quality
fail_ci_if_error: true