-
Notifications
You must be signed in to change notification settings - Fork 97
40 lines (35 loc) · 1.02 KB
/
code_quality.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
# Workflow to check code quality and complexity
name: Code Quality
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
# runs-on: self-hosted
strategy:
matrix:
python-version: [3.7]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install radon
pip install flake8
pip install flake8-polyfill
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Code complexity
run: |
# Runs Radon quality check
radon cc python --total-average --show-complexity
- name: Code quality with flake8
run: |
# Runs code quality check
flake8 python --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics