forked from intel/hexl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
224 lines (205 loc) · 5.06 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
# Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
image: ubuntu:18.04
variables:
http_proxy: http://10.7.211.16:911
https_proxy: http://10.7.211.16:912
DEFAULT_COMPILER_FLAGS: "-DCMAKE_CXX_COMPILER=clang++-10
-DCMAKE_C_COMPILER=clang-10
-DHEXL_BENCHMARK=ON
-DHEXL_TESTING=ON
-DHEXL_EXPORT=ON
-DCMAKE_INSTALL_PREFIX=./"
SHARED_LIB_COMPILER_FLAGS: "-DHEXL_SHARED_LIB=ON
-DHEXL_EXPORT=ON
-DHEXL_TESTING=ON
-DHEXL_BENCHMARK=ON
-DCMAKE_INSTALL_PREFIX=./"
DEBUG_COMPILER_FLAGS: "-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_CXX_COMPILER=g++-9
-DCMAKE_C_COMPILER=gcc-9
-DHEXL_DEBUG=ON
-DHEXL_BENCHMARK=ON
-DHEXL_TESTING=ON
-DHEXL_EXPORT=ON
-DHEXL_DOCS=ON
-DHEXL_TREAT_WARNING_AS_ERROR=ON
-DCMAKE_INSTALL_PREFIX=./"
COVERAGE_COMPILER_FLAGS: "-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_CXX_COMPILER=g++-9
-DCMAKE_C_COMPILER=gcc-9
-DHEXL_DEBUG=ON
-DHEXL_BENCHMARK=ON
-DHEXL_TESTING=ON
-DHEXL_COVERAGE=ON
-DHEXL_ENABLE_ADDRESS_SANITIZER=ON
-DHEXL_EXPORT=ON
-DHEXL_DOCS=ON
-DHEXL_TREAT_WARNING_AS_ERROR=ON
-DCMAKE_INSTALL_PREFIX=./"
GCOV_BIN: "/usr/bin/gcov-9"
DEFAULT_EXAMPLE_FLAGS: "-DHEXL_HINT_DIR=${CI_PROJECT_DIR}/lib/cmake/"
stages:
- format
- build
- benchmark
.only-default:
only:
refs:
- merge_requests
- development
.build:
extends: .only-default
before_script:
- whoami
- echo "Testing from branch:"
- echo $CI_COMMIT_REF_NAME
- cmake --version
- pwd
- ls
format:
extends: .only-default
stage: format
script:
# Run formatting
- pre-commit run --all-files
default_build:
stage: build
extends: .build
script:
# Build library
- cmake -S . -B build ${DEFAULT_COMPILER_FLAGS}
- cmake --build build -j
- cmake --install build
# Build example
- cd example
- cmake -S . -B build ${DEFAULT_COMPILER_FLAGS} ${DEFAULT_EXAMPLE_FLAGS}
- cmake --build build -j
- cd ..
# Run tests and example
- build/test/unit-test
- example/build/example
artifacts:
paths:
- build/
- lib/
- include/
- example/build
expire_in: 1 day
shared_build:
stage: build
extends: .build
script:
# Build library
- cmake -S . -B build ${SHARED_LIB_COMPILER_FLAGS}
- cmake --build build -j
- cmake --install build
# Build and run example
- cd example
- cmake -S . -B build ${SHARED_LIB_COMPILER_FLAGS} ${DEFAULT_EXAMPLE_FLAGS}
- cmake --build build -j
- build/example
artifacts:
paths:
- build/
- lib/
- include/
expire_in: 1 day
debug_build:
stage: build
extends: .build
script:
# Build library
- cmake -S . -B build ${DEBUG_COMPILER_FLAGS}
- cmake --build build -j
- cmake --build build -j --target doxygen docs
- cmake --install build
- build/test/unit-test
# Build and run example
- cd example
- cmake -S . -B build ${DEFAULT_COMPILER_FLAGS} ${DEFAULT_EXAMPLE_FLAGS}
- cmake --build build -j
- build/example
coverage_build:
stage: build
extends: .build
script:
# Build library
- cmake -S . -B build ${COVERAGE_COMPILER_FLAGS}
- cmake --build build -j
- cmake --build build -j --target doxygen docs
- cmake --install build
# Avoid putting tests in separate stage, since uploading/downloading artifacts takes a long time
- pwd
- ls
- echo ${CI_PROJECT_DIR}
- build/test/unit-test
- HEXL_DISABLE_AVX512IFMA=1 build/test/unit-test
- HEXL_DISABLE_AVX512DQ=1 build/test/unit-test
- lcov --capture --directory build/hexl --directory build/test/ --output-file cov_test.info
# Remove unwanted directories
- lcov --remove cov_test.info '/usr/include/*' '/usr/lib/*' '*/test/*' '*/build/*' '*/benchmark/*' -o cov_test.info
# Report overall summary to be parsed by gitlab CI
- lcov --list cov_test.info
# Generate coverage html
- genhtml --branch-coverage cov_test.info --output-directory coverage
artifacts:
paths:
- coverage/
expire_in: 1 day
benchmark:
stage: benchmark
extends: .only-default
script:
- build/benchmark/bench_hexl --benchmark_out="${CI_JOB_NAME}_${CI_COMMIT_SHA}" --benchmark_out_format=csv
dependencies:
- default_build
artifacts:
paths:
- "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
expire_in: 5 yr
# IceLake builds below
format_icelake:
extends: format
only:
refs:
- schedule
tags:
- ice-lake
default_build_icelake:
extends: default_build
only:
refs:
- schedule
tags:
- ice-lake
shared_build_icelake:
extends: shared_build
only:
refs:
- schedule
tags:
- ice-lake
debug_build_icelake:
extends: debug_build
only:
refs:
- schedule
tags:
- ice-lake
coverage_build_icelake:
extends: coverage_build
only:
refs:
- schedule
tags:
- ice-lake
benchmark_icelake:
extends: benchmark
only:
refs:
- schedule
tags:
- ice-lake
dependencies:
- default_build_icelake