forked from PRBonn/vdbfusion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
169 lines (153 loc) · 4.24 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
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
image: gitlab.ipb.uni-bonn.de:4567/ipb-team/ipb-tools/vdbfusion
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
GIT_SUBMODULE_STRATEGY: normal
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "/certs"
cache:
paths:
- .cache/pip
- ccache/
stages:
- format
- build
- test
- deploy
workflow:
rules:
- if: $CI_MERGE_REQUEST_IID
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
format:
stage: format
script:
- black --check .
# - clang-format ?
#----- ubuntu C++ jobs ------------------------------------------------------------------------------
ubuntu:cpp:build:
stage: build
script:
- mkdir build && cd build && cmake .. && make -j$(nproc --all) all install
- make uninstall
ubuntu:cpp:example:
stage: build
needs: ["ubuntu:cpp:build"]
script:
- mkdir build && cd build && cmake -DBUILD_CXX_EXAMPLE=ON .. && make -j$(nproc --all) install
- make uninstall
ubuntu:cpp:standalone_example:
stage: build
needs: ["ubuntu:cpp:build"]
script:
- mkdir build && cd build && cmake .. && make -j$(nproc --all) install && cd ..
- cd examples/cpp/ && mkdir build && cd build && cmake .. && make -j$(nproc --all)
#----- ubuntu python jobs ---------------------------------------------------------------------------
ubuntu:py:wheel:
stage: build
script:
- python3 setup.py bdist_wheel
artifacts:
paths:
- dist/*.whl
ubuntu:py:test:
stage: test
needs: ["ubuntu:py:wheel"]
script:
- pip3 -v install -r dev-requirements.txt
- pip3 -v install dist/vdbfusion*.whl
- pytest .
# This job is used regullary to test if we can build vdbfusion from scratch on ubuntu machines.
ubuntu:py:standalone:wheel:
stage: build
needs: ["ubuntu:py:wheel"]
image: gitlab.ipb.uni-bonn.de:4567/ipb-team/ipb-tools/vdbfusion/pip_builder:latest
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
script:
- CMAKE_ARGS=-DUSE_SYSTEM_OPENVDB=OFF VERBOSE=1 python3 setup.py bdist_wheel
artifacts:
paths:
- dist/*.whl
ubuntu:py:standalone:test:
stage: build
needs: ["ubuntu:py:standalone:wheel"]
image: gitlab.ipb.uni-bonn.de:4567/ipb-team/ipb-tools/vdbfusion/pip_builder:latest
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
script:
- pip3 -v install -r dev-requirements.txt
- pip3 -v install dist/vdbfusion*.whl
- pytest .
#----- manylinux jobs ------------------------------------------------------------------------------
manylinux:wheels:
stage: build
image: docker:19.03.12
needs: ["ubuntu:py:wheel"]
rules:
- if: $CI_COMMIT_TAG
- if: $CI_MERGE_REQUEST_IID
- if: $CI_PIPELINE_SOURCE == "schedule"
variables:
DOCKER_IMAGE: "quay.io/pypa/manylinux2014_x86_64"
PLAT: "manylinux2014_x86_64"
services:
- docker:19.03.12-dind
before_script:
- mkdir -p ccache
- docker pull ${DOCKER_IMAGE}
script:
- |
docker run --rm \
-e PLAT=${PLAT} \
-e CCACHE_BASEDIR=$(pwd) \
-e CCACHE_DIR=$(pwd)/ccache/ \
-v $(pwd):/io \
${DOCKER_IMAGE} \
/io/ci/build-wheels.sh
- ls wheelhouse/
artifacts:
paths:
- wheelhouse/
manylinux:test:
stage: test
needs: ["manylinux:wheels"]
image: docker:19.03.12
rules:
- if: $CI_COMMIT_TAG
- if: $CI_MERGE_REQUEST_IID
- if: $CI_PIPELINE_SOURCE == "schedule"
variables:
DOCKER_IMAGE: "quay.io/pypa/manylinux2014_x86_64"
PLAT: "manylinux2014_x86_64"
services:
- docker:19.03.12-dind
script:
- docker pull ${DOCKER_IMAGE}
- docker run --rm -e PLAT=${PLAT} -v $(pwd):/io ${DOCKER_IMAGE} /io/ci/test-wheels.sh
artifacts:
paths:
- wheelhouse/
#----- deployment stage ----------------------------------------------------------------------------
testpypi:
stage: deploy
needs: ["manylinux:test"]
rules:
- if: $CI_COMMIT_TAG
variables:
TWINE_PASSWORD: "${TESTPYPI_ACCESS_TOKEN}"
TWINE_USERNAME: "__token__"
script:
- twine upload --verbose --skip-existing --repository testpypi wheelhouse/*.whl
artifacts:
paths:
- wheelhouse/
pypi:
stage: deploy
needs: ["testpypi"]
rules:
- if: $CI_COMMIT_TAG
variables:
TWINE_PASSWORD: "${PYPI_ACCESS_TOKEN}"
TWINE_USERNAME: "__token__"
script:
- twine upload --verbose --skip-existing --repository pypi wheelhouse/*.whl