Skip to content

Commit 7d4b36d

Browse files
committed
.gitlab-ci.yml: use matrix for python versions, add docs #3
Also, Python 3.11 was added to testing, and .test-python3 was removed as we only do Python3 anyway.
1 parent 52b5822 commit 7d4b36d

File tree

1 file changed

+14
-28
lines changed

1 file changed

+14
-28
lines changed

.gitlab-ci.yml

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,43 +27,29 @@ build:
2727
paths:
2828
- dist/*.whl
2929

30-
# Next, test the packaged wheel
30+
# Next, test the packaged wheel built by "build"
3131
.test:
3232
stage: test
3333
script:
34-
- pip3 install --user pytest
35-
- pip3 install --user numpy
36-
- rm -r objectbox
37-
- pip3 install --user --force-reinstall dist/*.whl
34+
- pip3 install --user pytest numpy
35+
- rm -r objectbox # todo this is ugly; let's copy required files in a sub-folder instead?
36+
- pip3 install --user --force-reinstall dist/*.whl # Artifacts from the previous stage (downloaded by default)
3837
- ${PYTHON} -m pytest
39-
40-
.test-python3:
41-
extends: .test
4238
variables:
4339
PYTHON: "python3"
4440

45-
.test:linux:x64:
46-
extends: .test-python3
41+
test:linux:x64:
42+
extends: .test
4743
tags: [x64, docker, linux]
48-
49-
test:linux:x64:3.7:
50-
extends: .test:linux:x64
51-
image: python:3.7
52-
53-
test:linux:x64:3.8:
54-
extends: .test:linux:x64
55-
image: python:3.8
56-
57-
test:linux:x64:3.9:
58-
extends: .test:linux:x64
59-
image: python:3.9
60-
61-
test:linux:x64:3.10:
62-
extends: .test:linux:x64
63-
image: python:3.10
44+
image: python:$PYTHON_VERSION
45+
parallel:
46+
matrix:
47+
# Note: Docker images will have an arbitrary minor version due to "if-not-present" pull policy.
48+
# If this becomes a problem, we could e.g. specify a minor version explicitly.
49+
- PYTHON_VERSION: [ '3.7', '3.8', '3.9', '3.10', '3.11']
6450

6551
# test:linux:armv7hf:
66-
# extends: .test-python3
52+
# extends: .test
6753
# tags: [armv7hf, shell, linux, python3]
6854

6955
# aarch64 version not published
@@ -72,7 +58,7 @@ test:linux:x64:3.10:
7258
# tags: [aarch64, shell, linux, python3]
7359

7460
test:mac:x64:
75-
extends: .test-python3
61+
extends: .test
7662
tags: [mac, x64, shell, python3]
7763

7864
test:windows:x64:

0 commit comments

Comments
 (0)