-
Notifications
You must be signed in to change notification settings - Fork 19
/
.gitlab-ci.yml
67 lines (60 loc) · 2.18 KB
/
.gitlab-ci.yml
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
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
# 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
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
tags: [mac, x64, shell, python3]
test:windows:x64:
extends: .test
tags: [windows, x64, shell, python3]
variables:
PYTHON: "python.exe"