-
Notifications
You must be signed in to change notification settings - Fork 10
/
.gitlab-ci-linux.yml
200 lines (186 loc) · 5.03 KB
/
.gitlab-ci-linux.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
########################
# Linux CI/CD Pipeline #
########################
# Note: We currently run the tests against a Ubuntu 20.04 docker container
# and create PYPI packages with a ManyLinux CentOS docker container
variables:
UBUNTU_2004_DOCKER_IMAGE: $CI_REGISTRY/trajectory/tracktable/ubuntu/20.04:latest
.linux-before: &linux-before
- . /opt/conda/etc/profile.d/conda.sh
- conda activate tracktable-linux-ci
linux-setup:
image: $UBUNTU_2004_DOCKER_IMAGE
stage: setup
tags:
- linux
# TODO: Figure out how to skip the pipeline, this rule doesn't work for some reason
# rules:
# - if: $SKIP_NORMAL_PIPELINE && $SKIP_NORMAL_PIPELINE == "true"
# when: never
before_script:
- *linux-before
script:
- mkdir build_linux
artifacts:
paths:
- build_linux
expire_in: 1 hour
linux-configure:
image: $UBUNTU_2004_DOCKER_IMAGE
stage: configure
tags:
- linux
dependencies:
- linux-setup
needs:
- job: linux-setup
artifacts: true
before_script:
- *linux-before
script:
- cd build_linux
- cmake -GNinja -DBUILD_DOCUMENTATION=OFF ..
artifacts:
paths:
- build_linux
expire_in: 1 hour
linux-build:
image: $UBUNTU_2004_DOCKER_IMAGE
stage: build
tags:
- linux
dependencies:
- linux-configure
needs:
- job: linux-configure
artifacts: true
before_script:
- *linux-before
script:
- cd build_linux
- ninja
- |-
if [[ $CI_PIPELINE_SOURCE == "schedule" && $NIGHTLY == "true" ]]; then
cmake -GNinja -DBUILD_DOCUMENTATION=ON .. && ninja doc
fi
artifacts:
paths:
- build_linux
expire_in: 1 week
linux-test:
image: $UBUNTU_2004_DOCKER_IMAGE
stage: test
tags:
- linux
dependencies:
- linux-build
needs:
- job: linux-build
artifacts: true
before_script:
- *linux-before
script:
- cp build_linux/lib/_*.so tracktable/Python/tracktable/lib/
- cd build_linux
- ctest --output-on-failure --exclude-regex 'C_GREAT_CIRCLE_FIT|C_MemoryUse|C_PointGenerator|P_TerrestrialHeatmapExample|P_TerrestrialTrajectoryMapExample|P_Mapmaker_CONUS|P_Mapmaker_Custom_Bounding_Box_Object|P_Mapmaker_Custom_Bounding_Box_Floats|P_Mapmaker_Europe|P_Render_Trajectories'
artifacts:
paths:
- build_linux
expire_in: 1 hour
########################################
# Build And Deploy Linux PYPI Packages #
########################################
.linux-wheel-docker-login-script: &linux-wheel-docker-login-script
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
# linux-deploy-boost-multipython:
# stage: deploy
# tags:
# - linux-shell
# timeout: 2 hours
# rules:
# - if: $CI_PIPELINE_SOURCE == "schedule" && $LINUX_BUILD_FROM_SCRATCH == "true"
# before_script:
# - *linux-wheel-docker-login-script
# script:
# - docker image prune -a -f
# - docker container prune -f
# - cd packaging/pypi/linux/stage1_boost_multipython
# - ./build_all.sh
# linux-deploy-cmake:
# stage: deploy
# tags:
# - linux-shell
# timeout: 2 hours
# rules:
# - if: $CI_PIPELINE_SOURCE == "schedule" && $LINUX_BUILD_FROM_SCRATCH == "true"
# needs: ["linux-deploy-boost-multipython"]
# before_script:
# - *linux-wheel-docker-login-script
# script:
# - cd packaging/pypi/linux/stage2_cmake
# - ./build_all.sh
linux-deploy-tracktable:
stage: deploy
tags:
- linux-shell
timeout: 2 hours
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
# needs: ["linux-deploy-cmake"] # If your building from scratch this needs to be uncommented
needs: ["linux-test"]
before_script:
- *linux-wheel-docker-login-script
script:
- cd packaging/pypi/linux/stage3_tracktable
- ./build_all.sh
linux-deploy-wheels:
stage: deploy
tags:
- linux-shell
timeout: 2 hours
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
needs: ["linux-deploy-tracktable"]
before_script:
- *linux-wheel-docker-login-script
script:
- echo $NIGHTLY
- echo $DEVELOPMENT
- echo $DEV_NUMBER
- cd packaging/pypi/linux/stage4_wheel
- ./build_all.sh
artifacts:
paths:
- packaging/pypi/linux/finished_wheels
expire_in: 1 hour
linux-deploy-upload:
stage: deploy
tags:
- linux-shell
timeout: 2 hours
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
dependencies:
- linux-deploy-wheels
needs:
- job: linux-deploy-wheels
artifacts: true
script:
- cd packaging/pypi/linux/
# - python3 -m pip install twine
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token HTTPS_PROXY= https_proxy= python3 -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi finished_wheels/*.whl
linux-deploy-cleanup:
stage: deploy
tags:
- linux-shell
timeout: 2 hours
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
needs: ["linux-deploy-upload"]
script:
- cd packaging/pypi/linux/
- ./clean_tracktable.sh
- docker system prune -a -f
# - docker image prune -a -f
# - docker container prune -f
# - ./clean_all.sh