-
Notifications
You must be signed in to change notification settings - Fork 41
/
.gitlab-ci.yml
276 lines (260 loc) · 8.71 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
266
267
268
269
270
271
272
273
274
275
276
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/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"
DS_EXCLUDED_ANALYZERS: "gemnasium-maven"
stages:
- build
- test
- translate_report
- deploy
# Job for running perf test with reports of mem/cpu usage
weekly_perf_reports:
stage: build
image: ${DOCKER_REGISTRY}/${DOCKER_IMAGE_USER}:${DOCKER_IMAGE_USER_VERSION}
only:
refs:
- web
- schedules
variables:
- $PERFORMANCE
script:
- mkdir -p reports .public
- $CI_PROJECT_DIR/scripts/linux/weekly/gitlab_build_perf_tests.sh
- $CI_PROJECT_DIR/scripts/linux/weekly/gitlab_run_perf_test_metrics.sh
- cat $CI_PROJECT_DIR/scripts/linux/weekly/reports/index.html >> .public/index.html && cat $CI_PROJECT_DIR/scripts/linux/weekly/performance_tests.json >> .public/performance_tests.json
- 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_PROJECT_DIR/${CI_JOB_NAME}_test_reports.tar.gz
artifacts:
when: always
paths:
- performance_results_*.csv
- test_detail_perf.json
- .public
- reports/*.xml
expire_in: 1 year
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:
- web
- schedules
variables:
- $FV
build_test_linux_fv:
stage: build
tags:
- docker-prod
image: ${DOCKER_REGISTRY}/${DOCKER_IMAGE_USER}:${DOCKER_IMAGE_USER_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:
- web
- schedules
variables:
- $FV
artifacts:
reports:
junit:
- reports/*.xml
when: always
paths:
- reports
expire_in: 1 year
build_test_nv:
stage: build
image: ${DOCKER_REGISTRY}/${DOCKER_IMAGE_USER}:${DOCKER_IMAGE_USER_VERSION}
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:
- web
- schedules
variables:
- $NV
artifacts:
when: always
paths:
- reports
- scripts
- build
- tests
expire_in: 90 days
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:
- web
- 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:
- web
- schedules
variables:
- $NV
translate_report_fv:
stage: translate_report
tags:
- docker-prod
image: python:3.6
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:
- web
- schedules
variables:
- $FV
translate_report_nv:
stage: translate_report
tags:
- docker-prod
image: python:3.6
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:
- web
- schedules
variables:
- $NV
pages:
stage: deploy
tags:
- docker-prod
script: mv .public public
artifacts:
paths:
- public
expire_in: 1 year
only:
refs:
- web
- schedules
variables:
- $FV
- $NV
- $PERFORMANCE
# 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
# TO DO: OLPEDGE-2543
# Currently job below just build HERE Data SDK for iOS and start iOS emulator. Application fails to work with mock-server.
# Job is prepared for running on local MacMini hardware: tagged as `edge-macos`
test_ios_emulator_fv_network:
stage: test
tags:
- edge-macos
script:
- $CI_PROJECT_DIR/scripts/ios/fv/gh-actions-build-with-tests-fv.sh
- $CI_PROJECT_DIR/scripts/ios/fv/gh-actions-functional-network-test.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
- if $(ls $CI_PROJECT_DIR/*.html &>/dev/null); then tar -czf ${CI_JOB_NAME}_test_reports.tar.gz $CI_PROJECT_DIR/*.html; 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_PROJECT_DIR/${CI_JOB_NAME}_test_reports.tar.gz
when: manual
only:
- master
- branches
artifacts:
paths:
- ./*.html
expire_in: 2 year