@@ -34,13 +34,22 @@ jobs:
34
34
--health-retries 5
35
35
36
36
steps :
37
- - uses : actions/checkout@v2
37
+ - name : Checkout
38
+ uses : actions/checkout@v3
39
+
40
+ - name : Install Python package dependencies
41
+ run : |
42
+ python -m pip install -U pip pipenv
43
+ pipenv install --system --dev
38
44
39
- - name : Install dependencies
45
+ - name : Run Code Quality Checks
40
46
run : |
41
- python -m pip install -U pip poetry
42
- poetry config virtualenvs.create false
43
- poetry install
47
+ # stop the build if there are Python syntax errors or undefined names
48
+ flake8 service tests --count --select=E9,F63,F7,F82 --show-source --statistics
49
+ # check for complexity. The GitHub editor is 127 chars wide
50
+ flake8 service tests --count --max-complexity=10 --max-line-length=127 --statistics
51
+ # Run pylint on the service
52
+ pylint service tests --max-line-length=127
44
53
45
54
- name : Create the test database
46
55
run : |
@@ -49,11 +58,16 @@ jobs:
49
58
curl -X PUT http://admin:pass@couchdb:5984/test
50
59
51
60
- name : Run unit tests with pytest
52
- run : pytest --pspec --cov=service --cov-fail-under=95 --disable-warnings
61
+ run : pytest --pspec --cov=service --cov-fail-under=95 --disable-warnings --cov-report=xml
53
62
env :
54
63
FLASK_APP : " wsgi:app"
55
64
BINDING_CLOUDANT : ' {"username":"admin","password":"pass","host":"couchdb","port":5984,"url":"http://admin:pass@couchdb:5984"}'
56
65
57
- - name : Upload code coverage
58
- uses : codecov/codecov-action@v3.1.4
66
+ - name : Install packages required by Codecov
67
+ run : apt-get update && apt-get install -y git curl gpg
59
68
69
+ - name : Upload coverage reports to Codecov
70
+ uses : codecov/codecov-action@v5
71
+ with :
72
+ token : ${{ secrets.CODECOV_TOKEN }}
73
+ slug : nyu-devops/lab-flask-restplus-swagger
0 commit comments