1
+ version : 2.1
2
+
3
+ orbs :
4
+ codecov :
codecov/[email protected]
5
+
6
+ jobs :
7
+ build :
8
+ parameters :
9
+ version :
10
+ type : string
11
+ docker :
12
+ - image : cimg/python:<< parameters.version >>
13
+ steps :
14
+ - checkout
15
+ - restore_cache :
16
+ key : v1-<< parameters.version >>-min-dependency-cache-{{ checksum "dev-requirements.txt" }}
17
+ - run :
18
+ name : install python dependencies
19
+ command : |
20
+ python3 -m venv venv
21
+ . venv/bin/activate
22
+ pip install --upgrade pip
23
+ pip install -r dev-requirements.txt
24
+ - save_cache :
25
+ key : v1-<< parameters.version >>-min-dependency-cache-{{ checksum "dev-requirements.txt" }}
26
+ paths :
27
+ - " venv"
28
+ - run :
29
+ name : test if package installs
30
+ command : |
31
+ . venv/bin/activate
32
+ python3 setup.py install
33
+ test-module :
34
+ parameters :
35
+ module :
36
+ type : string
37
+ docker :
38
+ - image : cimg/python:3.8
39
+ steps :
40
+ - checkout
41
+ - restore_cache :
42
+ key : v1-3.8-dependency-cache-{{ checksum "dev-requirements.txt" }}
43
+ - run :
44
+ name : install python dependencies
45
+ command : |
46
+ python3 -m venv venv
47
+ . venv/bin/activate
48
+ pip install -r dev-requirements.txt
49
+ pip install -e .
50
+ - save_cache :
51
+ key : v1-3.8-dependency-cache-{{ checksum "dev-requirements.txt" }}
52
+ paths :
53
+ - " venv"
54
+ - run :
55
+ name : run code linting
56
+ command : |
57
+ . venv/bin/activate
58
+ black --check --diff ./<< parameters.module >>
59
+ - run :
60
+ name : run tests and coverage
61
+ command : |
62
+ . venv/bin/activate
63
+ pytest --junitxml=test-reports/junit.xml --cov-report=xml --cov=./<< parameters.module >> ./<< parameters.module >>
64
+ - store_test_results :
65
+ path : test-reports
66
+ - store_artifacts :
67
+ path : test-reports
68
+ - codecov/upload :
69
+ file : " coverage.xml"
70
+ deploy :
71
+ docker :
72
+ - image : cimg/python:3.8
73
+ steps :
74
+ - checkout
75
+ - restore_cache :
76
+ key : v1-3.8-dependency-cache-{{ checksum "dev-requirements.txt" }}
77
+ - run :
78
+ name : install python dependencies
79
+ command : |
80
+ python3 -m venv venv
81
+ . venv/bin/activate
82
+ pip install -r dev-requirements.txt
83
+ pip install -e .
84
+ - save_cache :
85
+ key : v1-3.8-dependency-cache-{{ checksum "dev-requirements.txt" }}
86
+ paths :
87
+ - " venv"
88
+ - run :
89
+ name : verify git tag vs. version
90
+ command : |
91
+ python3 -m venv venv
92
+ . venv/bin/activate
93
+ python setup.py verify
94
+ - run :
95
+ name : init .pypirc
96
+ command : |
97
+ echo -e "[pypi]" >> ~/.pypirc
98
+ echo -e "username = $PYPI_USERNAME" >> ~/.pypirc
99
+ echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc
100
+ - run :
101
+ name : create packages
102
+ command : |
103
+ python setup.py sdist
104
+ - run :
105
+ name : upload to pypi
106
+ command : |
107
+ . venv/bin/activate
108
+ twine upload dist/*
109
+ workflows :
110
+ build-test-deploy :
111
+ jobs :
112
+ - build :
113
+ name : " v3.6"
114
+ version : " 3.6"
115
+ - build :
116
+ name : " v3.7"
117
+ version : " 3.7"
118
+ - build :
119
+ name : " v3.8"
120
+ version : " 3.8"
121
+ - test-module :
122
+ name : " proglearn"
123
+ module : " proglearn"
124
+ requires :
125
+ - " v3.8"
126
+ - deploy :
127
+ requires :
128
+ - " proglearn"
129
+ filters :
130
+ tags :
131
+ only : /[0-9]+(\.[0-9]+)*/
132
+ branches :
133
+ ignore : /.*/
0 commit comments