-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
48 lines (40 loc) · 1.8 KB
/
.gitlab-ci.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
image: "python:3.9.5"
variables:
MODULE_PATH: "./open_crypto"
before_script:
- python --version
- pip install .
- export PYTHONPATH="$MODULE_PATH"
stages:
- static_analysis
- test
hinting:
stage: static_analysis
script:
- pip install mypy
- shopt -s globstar
- mypy --strict --show-error-codes --ignore-missing-imports --disallow-untyped-defs --disable-error-code valid-type --disable-error-code misc --disable-error-code no-redef --disable-error-code import --disable-error-code assignment --disable-error-code no-any-return --disable-error-code name-defined --disable-error-code comparison-overlap --disable-error-code arg-type --disable-error-code operator --disable-error-code call-overload --disable-error-code index --disable-error-code attr-defined --disable-error-code return --disable-error-code no-untyped-call --disable-error-code union-attr --disable-error-code type-arg --disable-error-code var-annotated --disable-error-code dict-item --disable-error-code return-value $MODULE_PATH/**/*.py
linting:
stage: static_analysis
script:
- pip install pylint
- shopt -s globstar
- pylint --disable=R,C0301,C0201,W0511,W0613,W0703,E1121,W0614,C0302,E1101,W0401,W1113,W0603 $MODULE_PATH/**/*.py
validating:
stage: static_analysis
script:
- python $MODULE_PATH/validate.py all && python $MODULE_PATH/model/validating/csv_export_template_validator.py && python open_crypto/model/validating/request_template_validator.py
unit_testing:
stage: test
script:
- pip install pytest
- pytest -v
unit_testing_coverage:
stage: test
variables:
MIN_COVERAGE: 60
script:
- pip install pytest
- pip install coverage
- coverage run -m pytest -v
- coverage report --show-missing --fail-under=$MIN_COVERAGE --include=$MODULE_PATH/* --omit=$MODULE_PATH/tests/*