Repository navigation
55 lines (50 loc) · 1.97 KB
/
Copy pathpython-app.yml
File metadata and controls
55 lines (50 loc) · 1.97 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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python application
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
NODE_VERSION: '10.x' # set this to the node version to use
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: npm install
run: |
sudo npm install
sudo npm install -g jscpd@3.2.1
- name: Static Analysis
run: |
pylint guardrails/ test/
jscpd --min-tokens 20 --reporters "json" --mode "strict" --format "python" -o . .
python3 test_resource/jscpd_parser.py --j 10 #Allowed duplication is 10% with 20 token size
- name: Cyclomatic complexity
run: |
python3 -m lizard guardrails -X> CC.xml
python3 test_resource/cyclo_gate.py --c 10 #Allowed cyclomatic complexity is less than 10
- name: Dead Code
run: |
python3 -m vulture guardrails
- name: Tests & Coverage
run: |
pytest test -p no:logging --cov-config=.coveragerc --cov=guardrails
coverage report --fail-under=90 #Coverage should be above 90%
codecov
- name: Mutation Tests
run: |
mutmut run > mutmut.log || true # Checking mutation on main file as the travis max execution time is overshooting
mutmut junitxml --suspicious-policy=ignore --untested-policy=ignore > mutmut.xml
python3 test_resource/mutmut_parse.py --m 20 #Mutation (failure+disables+error) allowed 20% of total mutants