-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
136 lines (121 loc) · 4.09 KB
/
.gitlab-ci.yml
File metadata and controls
136 lines (121 loc) · 4.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
stages:
- build
- test
# First, build the source and package it as a python wheel
build:
tags: [x64, docker, linux]
image: python:latest
stage: build
script:
# a function to download a library from another Gitlab repos CI artifacts
# URLs stored as CI variables, see https://docs.gitlab.com/ee/api/job_artifacts.html#download-a-single-artifact-file-from-specific-tag-or-branch
# FIXME Need to update URLs and extract from archives.
#- 'download_library(){ curl --create-dirs -o objectbox/lib/$1 -H "PRIVATE-TOKEN: $CI_API_TOKEN" $2; }'
#- 'download_library x86_64/libobjectbox.so "${OBXLIB_URL_Linux64}"'
#- 'download_library x86_64/libobjectbox.dylib "${OBXLIB_URL_Mac64}"'
#- 'download_library armv7l/libobjectbox.so "${OBXLIB_URL_LinuxARMv7hf}"'
#- 'download_library armv6l/libobjectbox.so "${OBXLIB_URL_LinuxARMv6hf}"'
#- 'download_library AMD64/objectbox.dll "${OBXLIB_URL_Win64}"'
- python -m pip install --upgrade pip
# Using released C library
- make depend
- make test
- make build
artifacts:
expire_in: 1 days
paths:
- dist/*.whl
# Build the Sync version of the package
build-sync:
tags: [ x64, docker, linux ]
image: python:latest
stage: build
script:
- python -m pip install --upgrade pip
# Using released C library (Sync version)
- make depend-sync
- make test
- make build-sync
artifacts:
expire_in: 1 days
paths:
- dist/*.whl
# Next, test the packaged wheel built by "build"
.test:
stage: test
script:
- pip3 install --user pytest
- rm -r objectbox # todo this is ugly; let's copy required files in a sub-folder instead?
- pip3 install --user --force-reinstall dist/*.whl # Artifacts from the previous stage (downloaded by default)
- ${PYTHON} -m pytest -s
variables:
PYTHON: "python3"
test:linux:x64:
extends: .test
tags: [x64, docker, linux]
image: python:$PYTHON_VERSION
parallel:
matrix:
# Note: Docker images will have an arbitrary minor version due to "if-not-present" pull policy.
# If this becomes a problem, we could e.g. specify a minor version explicitly.
- PYTHON_VERSION: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
test:linux:armv7hf:
extends: .test
tags: [armv7hf, shell, linux, python3]
test:linux:aarch64:
extends: .test
tags: [aarch64, shell, linux, python3]
test:mac:x64:
extends: .test
script:
- python3 -m venv .venv
- source .venv/bin/activate
- python3 -m pip install pytest
- rm -r objectbox # todo this is ugly; let's copy required files in a sub-folder instead?
- pip3 install --force-reinstall dist/*.whl # Artifacts from the previous stage (downloaded by default)
- python -m pytest -s
tags: [mac, x64, shell, python3]
test:windows:x64:
extends: .test
tags: [windows, x64, python]
variables:
PYTHON: "python.exe"
# Sync version test jobs
.test-sync:
stage: test
needs: [ build-sync ]
script:
- pip3 install --user pytest
- rm -r objectbox # todo this is ugly; let's copy required files in a sub-folder instead?
- pip3 install --user --force-reinstall dist/*.whl # Artifacts from build-sync
- ${PYTHON} -m pytest -s --runsync
variables:
PYTHON: "python3"
test-sync:linux:x64:
extends: .test-sync
tags: [ x64, docker, linux ]
image: python:$PYTHON_VERSION
parallel:
matrix:
- PYTHON_VERSION: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12' ]
#test-sync:linux:armv7hf:
# extends: .test-sync
# tags: [ armv7hf, shell, linux, python3 ]
test-sync:linux:aarch64:
extends: .test-sync
tags: [ aarch64, shell, linux, python3 ]
test-sync:mac:arm64:
extends: .test-sync
script:
- python3 -m venv .venv
- source .venv/bin/activate
- python3 -m pip install pytest
- rm -r objectbox # todo this is ugly; let's copy required files in a sub-folder instead?
- pip3 install --force-reinstall dist/*.whl # Artifacts from build-sync
- python -m pytest -s --runsync
tags: [ mac, arm64, shell, python3 ]
#test-sync:windows:x64:
# extends: .test-sync
# tags: [ windows, x64, python ]
# variables:
# PYTHON: "python.exe"