@@ -2,41 +2,73 @@ version: 2
22jobs :
33 build :
44 docker :
5- - image : circleci/python:3.6 .1
5+ - image : circleci/python:3.7 .1
66 environment :
77 CC_TEST_REPORTER_ID : 9f8a5da723397006023534dc6c5e32fc95d38bf7a92ae0e43530dba2a726722e
88 steps :
99 - checkout
1010 - run :
11- command : |
12- sudo apt install python-pip
13- sudo pip install -U pip pipenv
11+ name : Install OS dependencies
12+ command : make setup-os
1413 - run :
14+ name : Install Code Climate Test Reporter Tool
1515 command : |
1616 curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
1717 chmod +x ./cc-test-reporter
1818 - run :
19- command : |
20- pipenv --python python3.6
21- pipenv install --dev
22- - run :
23- command : |
24- pipenv run pytest
25- ./cc-test-reporter format-coverage coverage/coverage.xml -t coverage.py
26- ./cc-test-reporter upload-coverage
19+ name : Install package dependencies
20+ command : make setup
2721 - run :
2822 command : |
2923 ./cc-test-reporter before-build
3024 - run :
31- command : |
32- pipenv run pytest
25+ name : Run unit tests
26+ command : make test
3327 - run :
28+ name : Upload test coverage to Code Climate
3429 command : |
35- pipenv run flake8
30+ ./cc-test-reporter format-coverage coverage.xml -t coverage.py
31+ ./cc-test-reporter upload-coverage
3632 - run :
37- command : |
38- pipenv run safety check
33+ command : |
34+ ./cc-test-reporter after-build -t coverage.py
35+ - run :
36+ command : make check
3937 - store_artifacts :
40- path : htmlcov
4138 destination : htmlcov
42-
39+ path : htmlcov
40+ deploy :
41+ docker :
42+ - image : circleci/python:3.7.1
43+ steps :
44+ - checkout
45+ - run :
46+ name : Install OS dependencies
47+ command : make setup-os
48+ - run :
49+ name : Install package dependencies
50+ command : make setup
51+ - run :
52+ name : init .pypirc
53+ command : |
54+ echo -e "[pypi]" >> ~/.pypirc
55+ echo -e "repository = https://upload.pypi.org/legacy/"
56+ - run :
57+ name : Publish Package on Pypi
58+ command : make release
59+ workflows :
60+ version : 2
61+ build_and_deploy :
62+ jobs :
63+ - build :
64+ filters :
65+ tags :
66+ only : /.*/
67+ - deploy :
68+ requires :
69+ - build
70+ filters :
71+ tags :
72+ only : /[0-9]+(\.[0-9]+)*/
73+ branches :
74+ ignore : /.*/
0 commit comments