Skip to content

Commit b704d72

Browse files
[FIX] more fixes for circle-CI this time.
1 parent b4b8cd1 commit b704d72

File tree

1 file changed

+55
-72
lines changed

1 file changed

+55
-72
lines changed

.circleci/config.yml

Lines changed: 55 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,113 @@
1-
version: 2
1+
---
2+
version: 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+
218
jobs:
319
build:
420
docker:
5-
- image: cimg/python:3.7
6-
- image: cimg/python:3.8
7-
- image: cimg/python:3.9
8-
- image: cimg/python:3.10
9-
- image: cimg/python:3.11
10-
- image: cimg/python:3.12
21+
- image: cimg/python:<< pipeline.parameters.python-version >>
22+
resource_class: medium
1123
environment:
1224
CI: cicleci
1325
DEBIAN_FRONTEND: noninteractive
1426
LANG: en_US.UTF-8
15-
LC_CTYPE: en_EN.UTF-8
27+
LC_CTYPE: en_US.UTF-8
1628
SHELL: /bin/bash
1729
working_directory: ~/python-repo
1830
steps:
1931
- checkout
2032
- run:
2133
name: "fetch and pull"
2234
command: |
23-
git fetch && git pull --all || true
35+
git fetch && git pull --all || : ;
2436
- run:
2537
shell: /bin/bash
2638
name: "install depends attempt"
2739
command: |
28-
python3 -m pip install --user -r ./requirements.txt || true
40+
python3 -m pip install --user -r ./requirements.txt || : ;
2941
when: on_success
3042
- run:
3143
shell: /bin/bash
32-
name: "install test extras attempt"
44+
name: "install test depends attempt"
3345
command: |
34-
python3 -m pip install --user -r ./test-requirements.txt || true
46+
python3 -m pip install --upgrade --user -r ./tests/requirements.txt || : ;
47+
when: on_success
3548
- save_cache:
3649
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
3750
paths:
3851
- ~/python-repo
3952

4053
test:
4154
docker:
42-
- image: cimg/python:3.7
43-
- image: cimg/python:3.8
44-
- image: cimg/python:3.9
45-
- image: cimg/python:3.10
46-
- image: cimg/python:3.11
47-
- image: cimg/python:3.12
55+
- image: cimg/python:<< pipeline.parameters.python-version >>
4856
parallelism: 2
57+
resource_class: medium
4958
environment:
5059
CI: cicleci
5160
DEBIAN_FRONTEND: noninteractive
5261
LANG: en_US.UTF-8
53-
LC_CTYPE: en_EN.UTF-8
62+
LC_CTYPE: en_US.UTF-8
5463
SHELL: /bin/bash
5564
working_directory: ~/python-repo
5665
steps:
5766
- restore_cache:
5867
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
5968
- run:
6069
shell: /bin/bash
61-
name: "clean up for test"
70+
name: "Installing deps for test"
6271
command: |
63-
make clean
64-
when: always
72+
python3 -m pip install --upgrade --user -r ./tests/requirements.txt || : ;
73+
when: on_success
74+
- cleanup
6575
- run:
6676
shell: /bin/bash
6777
name: "Unit Tests"
6878
command: |
6979
make test
7080
when: on_success
71-
- run:
72-
shell: /bin/bash
73-
name: "clean up from test"
74-
command: |
75-
make clean
76-
when: always
77-
- run:
78-
shell: /bin/bash
79-
name: "clean up from FAIL"
80-
command: |
81-
make clean
82-
when: on_fail
81+
- cleanup
8382

8483
pytest:
8584
docker:
86-
- image: cimg/python:3.7
87-
- image: cimg/python:3.8
88-
- image: cimg/python:3.9
89-
- image: cimg/python:3.10
90-
- image: cimg/python:3.11
91-
- image: cimg/python:3.12
85+
- image: cimg/python:<< pipeline.parameters.python-version >>
9286
parallelism: 2
87+
resource_class: medium
9388
environment:
9489
CI: cicleci
9590
DEBIAN_FRONTEND: noninteractive
9691
LANG: en_US.UTF-8
97-
LC_CTYPE: en_EN.UTF-8
92+
LC_CTYPE: en_US.UTF-8
9893
SHELL: /bin/bash
9994
working_directory: ~/python-repo
10095
steps:
10196
- restore_cache:
10297
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
10398
- run:
10499
shell: /bin/bash
105-
name: "setup up for pytest"
100+
name: "set up depends"
106101
command: |
107-
python3 -m pip install --upgrade --user -r ./test-requirements.txt || true
102+
python3 -m pip install --upgrade --user -r ./requirements.txt || : ;
108103
when: on_success
109104
- run:
110105
shell: /bin/bash
111-
name: "clean up for pytest"
106+
name: "clean up for test"
112107
command: |
113-
make clean
114-
when: always
108+
python3 -m pip install --upgrade --user -r ./tests/requirements.txt || : ;
109+
when: on_success
110+
- cleanup
115111
- run:
116112
shell: /bin/bash
117113
name: "pytest Unit Tests"
@@ -124,55 +120,41 @@ jobs:
124120
- store_artifacts:
125121
path: test-reports
126122
when: on_success
127-
- run:
128-
shell: /bin/bash
129-
name: "clean up from pytest"
130-
command: |
131-
make clean
132-
when: always
133-
- run:
134-
shell: /bin/bash
135-
name: "clean up from FAIL"
136-
command: |
137-
make clean
138-
when: on_fail
123+
- cleanup
139124

140125
lint:
141126
docker:
142-
- image: cimg/python:3.11
127+
- image: cimg/python:<< pipeline.parameters.python-version >>
128+
resource_class: medium
143129
environment:
144130
CI: cicleci
145131
DEBIAN_FRONTEND: noninteractive
146132
LANG: en_US.UTF-8
147133
SHELL: /bin/bash
148-
LC_CTYPE: en_EN.UTF-8
134+
LC_CTYPE: en_US.UTF-8
149135
working_directory: ~/python-repo
150136
steps:
151137
- restore_cache:
152138
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
153139
- run:
154-
name: "install linters extras attempt"
140+
name: "install reqs attempt"
155141
command: |
156-
python3 -m pip install --upgrade --user -r ./test-requirements.txt || true
142+
python3 -m pip install --user -r ./requirements.txt || : ;
157143
- run:
158-
shell: /bin/bash
159-
name: "clean up for test"
144+
name: "install test-reqs attempt"
160145
command: |
161-
make clean
146+
python3 -m pip install --user -r ./tests/requirements.txt || : ;
147+
- cleanup
162148
- run:
163149
shell: /bin/bash
164150
name: "check code style and spelling"
165151
command: |
166-
make test-style || python3 -m flake8 --ignore=W191,W391,E117 --max-line-length=100 --verbose --count --config=.flake8.ini --max-complexity=10
167-
- run:
168-
shell: /bin/bash
169-
name: "clean up when done"
170-
command: |
171-
make clean
152+
make test-style || python3 -m flake8 --verbose --count --config=.flake8.ini
153+
- cleanup
172154

173155
workflows:
174156
version: 2
175-
workflow:
157+
test-matrix:
176158
jobs:
177159
- build
178160
- test:
@@ -184,3 +166,4 @@ workflows:
184166
- pytest:
185167
requires:
186168
- build
169+
- test

0 commit comments

Comments
 (0)