forked from heremaps/here-data-sdk-cpp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
265 lines (250 loc) · 7.57 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
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
image: ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${DOCKER_IMAGE_VERSION}
# Gitlab SAST scanner jobs which runs on master
include:
- template: Security/SAST.gitlab-ci.yml
- template: Security/Secret-Detection.gitlab-ci.yml
- template: Security/License-Scanning.gitlab-ci.yml
- template: Security/Dependency-Scanning.gitlab-ci.yml
variables:
# Linux
LD_PRELOAD: "/lib/x86_64-linux-gnu/libSegFault.so"
SEGFAULT_SIGNALS: "all"
# Android
ADB_INSTALL_TIMEOUT: "8"
# Gitlab SAST scanner
SAST_EXCLUDED_PATHS: "tests, examples, docs, scripts"
SAST_EXCLUDED_ANALYZERS: "flawfinder"
stages:
- build
- test
- translate_report
- deploy
wv_security_job:
stage: test
tags:
- docker-prod
image: ${DOCKER_REGISTRY}/${DOCKER_IMAGE_SECURITY}:${DOCKER_IMAGE_SECURITY_VERSION}
variables:
LD_PRELOAD: "/lib64/libSegFault.so"
SEGFAULT_SIGNALS: "all"
script:
- $CI_PROJECT_DIR/scripts/linux/weekly/build_centos_debug_wv.sh --centos
- $CI_PROJECT_DIR/scripts/linux/weekly/security_scanner_upload_wv.sh build/binaries.tar.gz [email protected]
only:
refs:
- branches
- master
- schedules
variables:
- $SECURITY
artifacts:
when: always
paths:
- build/binaries.tar.gz
expire_in: 1 year # save our archive for 1 year as job artifacts
build_linux_armhf_fv:
stage: build
tags:
- docker-prod
image: ${DOCKER_REGISTRY}/${DOCKER_IMAGE_ARMHF}:${DOCKER_IMAGE_ARMHF_VERSION}
script:
- $CI_PROJECT_DIR/scripts/linux-armhf/fv/gitlab_build_armhf_fv.sh
only:
refs:
- branches
- master
- schedules
variables:
- $FV
build_test_linux_fv:
stage: build
tags:
- docker-prod
image: ${DOCKER_REGISTRY}/${DOCKER_IMAGE_PERFORMANCE}:${DOCKER_IMAGE_PERFORMANCE_VERSION}
script:
- $CI_PROJECT_DIR/scripts/linux/fv/gitlab_build_fv.sh
- $CI_PROJECT_DIR/scripts/linux/fv/gitlab_test_fv.sh
- $CI_PROJECT_DIR/scripts/linux/fv/gitlab-olp-cpp-sdk-functional-network-test.sh
- if $(ls $CI_PROJECT_DIR/reports/*.xml &>/dev/null); then tar -czf ${CI_JOB_NAME}_test_reports.tar.gz $CI_PROJECT_DIR/reports ; fi;
- $CI_PROJECT_DIR/scripts/misc/artifactory_upload.sh edge-sdks/sdk-for-cpp/releases/test-reports/$CI_JOB_NAME/$CI_JOB_ID/${CI_JOB_NAME}_test_reports.tar.gz ${CI_JOB_NAME}_test_reports.tar.gz
only:
refs:
- branches
- master
- schedules
variables:
- $FV
artifacts:
reports:
junit:
- reports/*.xml
when: always
paths:
- reports
expire_in: 1 year
build_test_nv:
stage: build
tags:
- docker-prod
script:
- $CI_PROJECT_DIR/scripts/linux/nv/gitlab_build_valgrind.sh
- $CI_PROJECT_DIR/scripts/linux/nv/gitlab_test_valgrind.sh
- if $(ls $CI_PROJECT_DIR/reports/*.xml &>/dev/null); then tar -czvf ${CI_JOB_NAME}_test_reports.tar.gz $CI_PROJECT_DIR/reports ; fi;
- $CI_PROJECT_DIR/scripts/misc/artifactory_upload.sh edge-sdks/sdk-for-cpp/releases/test-reports/$CI_JOB_NAME/$CI_JOB_ID/${CI_JOB_NAME}_test_reports.tar.gz ${CI_JOB_NAME}_test_reports.tar.gz
only:
refs:
- branches
- master
- schedules
variables:
- $NV
artifacts:
when: always
paths:
- reports
- $CI_PROJECT_DIR
expire_in: 1 year
test_performance_nv:
stage: test
tags:
- docker-prod
image: ${DOCKER_REGISTRY}/${DOCKER_IMAGE_PERFORMANCE}:${DOCKER_IMAGE_PERFORMANCE_VERSION}
script:
- $CI_PROJECT_DIR/scripts/linux/nv/gitlab_test_performance.sh
- if $(ls $CI_PROJECT_DIR/reports/*.xml &>/dev/null); then tar -czvf ${CI_JOB_NAME}_test_reports.tar.gz $CI_PROJECT_DIR/reports ; fi;
- $CI_PROJECT_DIR/scripts/misc/artifactory_upload.sh edge-sdks/sdk-for-cpp/releases/test-reports/$CI_JOB_NAME/$CI_JOB_ID/${CI_JOB_NAME}_test_reports.tar.gz ${CI_JOB_NAME}_test_reports.tar.gz
only:
refs:
- branches
- master
- schedules
variables:
- $NV
artifacts:
when: always
paths:
- ./*.gz
- ./*.html
- heaptrack
- reports
expire_in: 1 year
upload_sonar_nv:
stage: deploy
tags:
- docker-prod
image: ${DOCKER_REGISTRY}/${DOCKER_IMAGE_COVERAGE}:${DOCKER_IMAGE_COVERAGE_VERSION}
script:
- $CI_PROJECT_DIR/scripts/linux/nv/gitlab_cppcheck_and_upload_sonar.sh
only:
refs:
- branches
- master
- schedules
variables:
- $NV
translate_report_fv:
stage: translate_report
tags:
- docker-prod
image: python:3.6
when: always
before_script:
- pip install junit2html
script:
- python -m junit2htmlreport --report-matrix reports/functional-index.html reports/olp-functional*.xml
- python -m junit2htmlreport --report-matrix reports/unit-index.html reports/olp-dataservice-write-test-report.xml reports/olp-dataservice-read-test-report.xml reports/olp-core-test-report.xml reports/olp-authentication-test-report.xml
- python -m junit2htmlreport --report-matrix reports/integration-index.html reports/olp-integration*.xml
- python -m junit2htmlreport --report-matrix reports/index.html reports/*.xml
- python -m junit2htmlreport --report-matrix reports/fun-network-index.html reports/olp-functional-network-test-report.xml
- sed -i -e 's/Reports\ Matrix/Functional\ Network\ Test\ Report/g' reports/fun-network-index.html
- sed -i -e 's/Reports\ Matrix/Unit\ Test\ Report/g' reports/unit-index.html
- sed -i -e 's/Reports\ Matrix/Integration\ Test\ Report/g' reports/integration-index.html
- sed -i -e 's/Reports\ Matrix/Functional\ Test\ Report/g' reports/functional-index.html
- sed -i -e 's/Reports\ Matrix/Full\ Test\ Report/g' reports/index.html
- cat reports/unit-index.html >> reports/index.html
- cat reports/integration-index.html >> reports/index.html
- cat reports/functional-index.html >> reports/index.html
- cat reports/fun-network-index.html >> reports/index.html
- mkdir -p .public
- cp reports/*ndex.html .public/
artifacts:
paths:
- .public
only:
refs:
- branches
- master
- schedules
variables:
- $FV
translate_report_nv:
stage: translate_report
tags:
- docker-prod
image: python:3.6
when: always
before_script:
- pip install junit2html
script:
- python -m junit2htmlreport --report-matrix reports/index.html reports/*.xml
- cat heaptrack_report.html >> reports/index.html
- mkdir -p .public
- cp reports/*ndex.html .public/
artifacts:
paths:
- .public
only:
refs:
- branches
- master
- schedules
variables:
- $NV
pages:
stage: deploy
tags:
- docker-prod
when: always
script: mv .public public
artifacts:
paths:
- public
expire_in: 1 year
only:
refs:
- branches
- master
- schedules
variables:
- $FV
- $NV
# TO DO: add Android network test into script $CI_PROJECT_DIR/scripts/android/build-test-emulator.sh
# Currently job below just build HERE Data SDK for Android and start AVD by Android SDK emulator.
test_android_emulator:
stage: test
tags:
- docker-prod
image: ${DOCKER_REGISTRY}/${DOCKER_IMAGE_ANDROID}:${DOCKER_IMAGE_ANDROID_VERSION}
script:
- $CI_PROJECT_DIR/scripts/android/build-test-emulator.sh
when: manual
only:
- master
- branches
# Manual job to generate API/ABI Backward Compatibility Reports:
# build current SDK and previous tagged SDK, then generate 4 html reports (for every lib)
generate_api_compliance_job:
stage: test
tags:
- docker-prod
image: ${DOCKER_REGISTRY}/${DOCKER_IMAGE_API}:${DOCKER_IMAGE_API_VERSION}
script:
- $CI_PROJECT_DIR/scripts/misc/api_compliance.sh
when: manual
only:
- master
- branches
artifacts:
paths:
- ./*.html
expire_in: 2 year