-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (60 loc) · 1.81 KB
/
ci.yml
File metadata and controls
77 lines (60 loc) · 1.81 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: Continuous integration
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
check-code-formatting:
name: Check code formatting
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Black & Flake8 & MyPy & Bandit
run: |
pip install \
bandit==1.6.2 \
black==22.3.0 \
flake8==3.8.3 \
flake8-docstrings==1.5.0 \
mypy==0.812
- name: Run Black
run: black --config=pyproject.toml --check .
- name: Run Flake8
run: flake8
--docstring-convention=google
--max-line-length=89
--max-complexity=18
--ignore=E203,E731,E402,E501,C901,W291,W503,D107,D102,D202,D205
.
- name: Run Bandit
run: bandit -s B101,B108,B301,B322,B403,B404,B601,B603,B607 .
- name: Run Mypy
run: mypy --ignore-missing-imports --allow-redefinition .
testing:
name: Testing
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install archipel client
run: pip3 install --user .
shell: bash
- name: Run pytest
run: python -m pytest --cov=i2_client --cov-report term-missing --disable-warnings .
- name: Code coverage
if: success()
run: |
MIN_COVERAGE="94.00"
coverage report
CODECOV=$(coverage report | grep TOTAL)
CODECOV=$(echo ${CODECOV##* } | sed 's/.$//')
if [ $(echo $CODECOV'>='$MIN_COVERAGE | bc -l) -eq 0 ]; then
echo "Not enough code coverage ($CODECOV% < $MIN_COVERAGE%)"
exit 1
fi