forked from heremaps/here-data-sdk-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
189 lines (179 loc) · 5.92 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
image: ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${DOCKER_IMAGE_VERSION}
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
stages:
- test
- translate_report
- deploy
regression_test_job:
stage: test
when: manual
tags:
- docker-prod
image: ${DOCKER_REGISTRY}/${DOCKER_IMAGE_PERFORMANCE}:${DOCKER_IMAGE_PERFORMANCE_VERSION}
script:
- npm install -g yarn
- yarn
- yarn bootstrap
- npm run build --loglevel verbose
- npm run test --loglevel verbose
- npm run integration-test --loglevel verbose
- npm run functional-test --loglevel verbose
- npm run api-breaks-test --loglevel verbose
- cp ./tests/integration/api-breaks/xunit.xml $CI_PROJECT_DIR/api-breaks-xunit.xml
- cp ./tests/integration/xunit.xml $CI_PROJECT_DIR/integration-xunit.xml
- cp ./tests/functional/xunit.xml $CI_PROJECT_DIR/functional-xunit.xml
- cp ./@here/olp-sdk-authentication/xunit.xml $CI_PROJECT_DIR/olp-sdk-authentication-xunit.xml
- cp ./@here/olp-sdk-core/xunit.xml $CI_PROJECT_DIR/olp-sdk-core-xunit.xml
- cp ./@here/olp-sdk-dataservice-api/xunit.xml $CI_PROJECT_DIR/olp-sdk-dataservice-api-xunit.xml
- cp ./@here/olp-sdk-dataservice-read/xunit.xml $CI_PROJECT_DIR/olp-sdk-dataservice-read-xunit.xml
- cp ./@here/olp-sdk-dataservice-write/xunit.xml $CI_PROJECT_DIR/olp-sdk-dataservice-write-xunit.xml
- cp ./@here/olp-sdk-fetch/xunit.xml $CI_PROJECT_DIR/olp-sdk-fetch-xunit.xml
only:
- master
- branches
artifacts:
when: always
paths:
- ./*.xml
expire_in: 1 year # save for 1 year as job artifacts
regression_generate_report_job:
stage: translate_report
when: manual
tags:
- docker-prod
image: python:3.8
before_script:
- pip install junit2html==26
script:
- python -m junit2htmlreport --report-matrix api-breaks-index.html ./api-breaks-xunit.xml
- python -m junit2htmlreport --report-matrix fetch-index.html ./olp-sdk-fetch-xunit.xml
- python -m junit2htmlreport --report-matrix integration-index.html ./integration-xunit.xml
- python -m junit2htmlreport --report-matrix functional-index.html ./functional-xunit.xml
- python -m junit2htmlreport --report-matrix authentication-index.html ./olp-sdk-authentication-xunit.xml
- python -m junit2htmlreport --report-matrix core-index.html ./olp-sdk-core-xunit.xml
- python -m junit2htmlreport --report-matrix dataservice-api-index.html ./olp-sdk-dataservice-api-xunit.xml
- python -m junit2htmlreport --report-matrix dataservice-read-index.html ./olp-sdk-dataservice-read-xunit.xml
- python -m junit2htmlreport --report-matrix dataservice-write-index.html ./olp-sdk-dataservice-write-xunit.xml
- ./scripts/misc/full_report_generation.sh
- if $(ls $CI_PROJECT_DIR/index.html &>/dev/null); then tar -czf ${CI_JOB_NAME}_test_reports.tar.gz --directory=$CI_PROJECT_DIR index.html ; fi;
- $CI_PROJECT_DIR/scripts/misc/artifactory_upload.sh edge-sdks/sdk-for-typescript/test-reports/$CI_JOB_NAME/$CI_JOB_ID/${CI_JOB_NAME}_test_reports.tar.gz ${CI_JOB_NAME}_test_reports.tar.gz
artifacts:
paths:
- .public
- ./*.html
- ./*.xml
when: always
expire_in: 3 yrs # save our zip for 3 years as job artifacts
only:
refs:
- master
- branches
weekly_security_test_job:
stage: test
tags:
- docker-prod
script:
- $CI_PROJECT_DIR/scripts/security-scanner/SecurityScannerUpload.sh build/olp-edge-ts.zip OLP_EDGE_CI@here.com
only:
refs:
- master
- schedules
variables:
- $SECURITY
artifacts:
when: always
paths:
- build
expire_in: 1 year # save our zip for 1 year as job artifacts
nightly_perf_publish_test_job:
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
- $CI_PROJECT_DIR/scripts/linux/nv/gitlab_test_publish_dryrun.sh
- if $(ls $CI_PROJECT_DIR/*.html &>/dev/null); then tar -czf ${CI_JOB_NAME}_test_reports.tar.gz --directory=$CI_PROJECT_DIR *.html ; fi;
- $CI_PROJECT_DIR/scripts/misc/artifactory_upload.sh edge-sdks/sdk-for-typescript/test-reports/$CI_JOB_NAME/$CI_JOB_ID/${CI_JOB_NAME}_test_reports.tar.gz ${CI_JOB_NAME}_test_reports.tar.gz
only:
refs:
- master
- schedules
variables:
- $NIGHTLY
artifacts:
when: always
paths:
- ./*.gz
- ./*.html
- cache
- heaptrack
- reports
expire_in: 1 year # save our archives for 1 year as job artifacts
weekly_perf_test_job:
stage: test
tags:
- docker-prod
image: ${DOCKER_REGISTRY}/${DOCKER_IMAGE_PERFORMANCE}:${DOCKER_IMAGE_PERFORMANCE_VERSION}
script:
- $CI_PROJECT_DIR/scripts/linux/wv/gitlab_test_performance_extended.sh
only:
refs:
- master
- schedules
variables:
- $WEEKLY
artifacts:
when: always
paths:
- ./*.gz
- ./*.html
- cache
- heaptrack
- reports
expire_in: 1 year # save our archives for 1 year as job artifacts
# next stages will run on NV and WK jobs
generate_perf_report_job:
stage: translate_report
tags:
- docker-prod
image: python:3.6
when: always
before_script:
- pip install junit2html
script:
- if [ "$NIGHTLY" == "1" ]; then cat heaptrack_report.html >> reports/index.html; fi
- if [ "$WEEKLY" == "1" ]; then cat heaptrack_report.html >> reports/index.html; fi
- mkdir -p .public
- cp reports/*.html .public/
artifacts:
paths:
- .public
only:
refs:
- master
- schedules
variables:
- $WEEKLY
- $NIGHTLY
pages:
stage: deploy
tags:
- docker-prod
when: always
script: mv .public public
artifacts:
paths:
- public
expire_in: 1 year
only:
refs:
- master
- schedules
variables:
- $WEEKLY
- $NIGHTLY