11---
22version : 2.1
3+ commands :
4+ cleanup :
5+ steps :
6+ - run :
7+ shell : /bin/bash
8+ name : " Cleanup"
9+ command : |
10+ make clean
11+ when : always
12+
13+ parameters :
14+ python-version :
15+ type : string
16+ default : " 3.12"
17+
318jobs :
419 build :
520 docker :
6- - image : cimg/python:3.10
7- - image : cimg/python:3.11
8- - image : cimg/python:3.12
21+ - image : cimg/python:<< pipeline.parameters.python-version >>
922 resource_class : medium
1023 environment :
1124 CI : cicleci
3952
4053 test :
4154 docker :
42- - image : cimg/python:3.10
43- - image : cimg/python:3.11
44- - image : cimg/python:3.12
55+ - image : cimg/python:<< pipeline.parameters.python-version >>
4556 parallelism : 2
4657 resource_class : medium
4758 environment :
@@ -60,36 +71,18 @@ jobs:
6071 command : |
6172 python3 -m pip install --upgrade --user -r ./tests/requirements.txt || : ;
6273 when : on_success
63- - run :
64- shell : /bin/bash
65- name : " clean up for test"
66- command : |
67- make clean
68- when : always
74+ - cleanup
6975 - run :
7076 shell : /bin/bash
7177 name : " Unit Tests"
7278 command : |
7379 make test
7480 when : on_success
75- - run :
76- shell : /bin/bash
77- name : " clean up from test"
78- command : |
79- make clean
80- when : always
81- - run :
82- shell : /bin/bash
83- name : " clean up from FAIL"
84- command : |
85- make clean
86- when : on_fail
81+ - cleanup
8782
8883 pytest :
8984 docker :
90- - image : cimg/python:3.10
91- - image : cimg/python:3.11
92- - image : cimg/python:3.12
85+ - image : cimg/python:<< pipeline.parameters.python-version >>
9386 parallelism : 2
9487 resource_class : medium
9588 environment :
@@ -116,12 +109,7 @@ jobs:
116109 command : |
117110 python3 -m pip install --upgrade --user -r ./tests/requirements.txt || : ;
118111 when : on_success
119- - run :
120- shell : /bin/bash
121- name : " clean up for pytest"
122- command : |
123- make clean
124- when : always
112+ - cleanup
125113 - run :
126114 shell : /bin/bash
127115 name : " pytest Unit Tests"
@@ -134,22 +122,11 @@ jobs:
134122 - store_artifacts :
135123 path : test-reports
136124 when : on_success
137- - run :
138- shell : /bin/bash
139- name : " clean up from pytest"
140- command : |
141- make clean
142- when : always
143- - run :
144- shell : /bin/bash
145- name : " clean up from FAIL"
146- command : |
147- make clean
148- when : on_fail
125+ - cleanup
149126
150127 lint :
151128 docker :
152- - image : cimg/python:3.11
129+ - image : cimg/python:<< pipeline.parameters.python-version >>
153130 resource_class : medium
154131 environment :
155132 CI : cicleci
@@ -169,25 +146,17 @@ jobs:
169146 name : " install test-reqs attempt"
170147 command : |
171148 python3 -m pip install --user -r ./tests/requirements.txt || : ;
172- - run :
173- shell : /bin/bash
174- name : " clean up for test"
175- command : |
176- make clean
149+ - cleanup
177150 - run :
178151 shell : /bin/bash
179152 name : " check code style and spelling"
180153 command : |
181154 make test-style || python3 -m flake8 --verbose --count --config=.flake8.ini
182- - run :
183- shell : /bin/bash
184- name : " clean up when done"
185- command : |
186- make clean
155+ - cleanup
187156
188157workflows :
189158 version : 2
190- workflow :
159+ test-matrix :
191160 jobs :
192161 - build
193162 - test :
0 commit comments