-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
268 lines (240 loc) · 8.64 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
stages:
- build
- test
- bench
- deploy
cache:
paths:
- .cache/conan/
- .cache/ccache/data
variables:
FEDORA_32: "${CI_REGISTRY}/olena/pylene-dockers/fedora-32"
FEDORA_34: "${CI_REGISTRY}/olena/pylene-dockers/fedora-34"
FEDORA_35: "${CI_REGISTRY}/olena/pylene-dockers/fedora-35"
FEDORA_36: "${CI_REGISTRY}/olena/pylene-dockers/fedora-36"
FEDORA_37: "${CI_REGISTRY}/olena/pylene-dockers/fedora-37"
UBUNTU: "${CI_REGISTRY}/olena/pylene-dockers/ubuntu-toolchain:23.04"
CMAKE_BUILD_PARALLEL_LEVEL: 6
CCACHE_DIR: "${CI_PROJECT_DIR}/.cache/ccache/data"
CCACHE_MAXSIZE: 2G
DOC_PERSIST_BRANCHES: "master:next"
before_script:
- pip install --upgrade conan
- conan profile detect
- conan config install ci/conan
#- ccache -p
#- ccache -s
########
# Test #
########
windows-debug:
before_script:
- Invoke-BatchFile -Path "${env:VCVAR2022}" -Parameters "${env:ARCH}"
stage: build
script:
- conan install . -s build_type=Debug -s compiler.cppstd=20 -of . --build missing --deployer=./utils/copy-dlls --deployer-folder=./dlls
- cmake -S . -B build --preset conan-default
- cmake --build build --target build-tests --config Debug --preset conan-debug --parallel 4
- $env:PATH = -join($env:PATH, ";", $(Join-Path -Path $(Get-Location) -ChildPath dlls))
- ctest -C Debug -L UnitTests --test-dir build --schedule-random --output-on-failure
dependencies: []
artifacts:
reports:
junit: [build/tests/UT*.xml, build/bench/tests/UT*.xml]
expire_in: 1 week
tags: [windows]
rules:
- when: manual
allow_failure: true
variables:
VCVAR2019: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat'
VCVAR2022: 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat'
ARCH: x64
CONAN_USE_ALWAYS_SHORT_PATHS: 1
.distcheck-linux-base:
stage: build
script:
- conan install . --build missing -s build_type=${build_type} -r lrde-public --profile $CONAN_PROFILE -of ./build
- cmake -S . -B ./build --preset ${cmake_preset}
- cmake --build ./build --target Pylene-core
- cmake --build ./build --target build-tests
- ctest --test-dir ./build -L UnitTests --schedule-random --output-on-failure
dependencies: []
artifacts:
reports:
junit: [build/tests/UT*.xml, build/bench/tests/UT*.xml]
expire_in: 1 week
.distcheck-release:
extends: .distcheck-linux-base
variables:
build_type: "Release"
cmake_preset: "conan-release"
rules:
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_BRANCH == "master"
.distcheck-debug:
extends: .distcheck-linux-base
variables:
build_type: "Debug"
cmake_preset: "conan-debug"
CFLAGS: -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
CXXFLAGS: -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
# Msan not available for gcc. It requires instrumented libstdc++ and instrumented thirdparties so it is disabled for now.
# No tsan because no multithreaded code for now
# Asan, memsan and tsan are incompatible with each other within the same binary
# Asan and ubsan can work together
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
distcheck:
parallel:
matrix:
- PROFILE: [gcc-10, gcc-11, gcc-12, clang-13, clang-14, clang-15] # gcc-13 disabled because of OpenEXR.
BUILD_TYPE: [debug, release]
image: ${UBUNTU}
extends: .distcheck-linux-base
variables:
CONAN_PROFILE: ${PROFILE}
rules:
- if: $BUILD_TYPE == "debug"
variables:
build_type: "Debug"
cmake_preset: "conan-debug"
CFLAGS: -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
CXXFLAGS: -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
- if: $BUILD_TYPE == "release"
variables:
build_type: "Release"
cmake_preset: "conan-release"
- if: $BUILD_TYPE == "release" && $CI_MERGE_REQUEST_ID
- if: $BUILD_TYPE == "release" && $CI_COMMIT_BRANCH == "master"
- if: $BUILD_TYPE == "debug"
linux-coverage:
extends: .distcheck-debug
image: ${FEDORA_36}
after_script:
- mkdir coverage
- cd build && gcovr --root .. --filter '\.\./pylene' . -s --xml ../coverage/cobertura-coverage.xml --html-details ../coverage/index.html --gcov-ignore-parse-errors
variables:
CONAN_PROFILE: native
CXXFLAGS: -fprofile-arcs -ftest-coverage
CFLAGS: -fprofile-arcs -ftest-coverage
artifacts:
paths:
- coverage/
reports:
coverage_report:
coverage_format: cobertura
path: coverage/cobertura-coverage.xml
expire_in: 1 week
coverage: '/lines: \d+\.\d+\%/'
rules:
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_BRANCH == "master"
#########
# Bench #
#########
distbench-linux-gcc12-release:
stage: bench
image: ${FEDORA_36}
script:
- conan install . --build missing --profile native -of ./build -r lrde-public
- cmake -S . -B ./build --preset conan-release
- cmake --build ./build --target fetch-external-data
- cmake --build ./build --target build-bench
- cmake --build ./build --target run-all-benchmarks
- ctest --test-dir ./build -L SpeedTests -V
tags: ["pylene-benchmarks"]
when: manual
dependencies: []
artifacts:
name: "benchmark-results"
paths:
- build/bench/*.json
expire_in: 1 week
#################
# Documentation #
#################
.documentation-base:
image: ${FEDORA_36}
stage: build
script:
- conan install . --build missing --profile native -of ./build -r lrde-public
- cmake -S . -B ./build --preset conan-release
- cmake --build ./build --target build-doc
- mkdir -p ${DOCDIR} && mv build/doc/sphinx/* ${DOCDIR}
artifacts:
name: "documentation"
expire_in: 1 week
paths: [ public/ ]
variables: { DOCDIR: "public/${CI_COMMIT_REF_SLUG}" }
# Generate doc only
documentation:
extends: .documentation-base
except:
- master
- next
# Deploy documentation
pages:
extends: .documentation-base
variables: { CURRENT_BRANCH: "${CI_COMMIT_REF_SLUG}" }
after_script:
- /usr/bin/bash utils/retrieve-artifacts.sh
- python3 utils/write-index.py
only:
- master
- next
deploy-all-docs-to-pages:
image: ${FEDORA_36}
stage: deploy
rules:
- when: manual
allow_failure: true
variables: { CURRENT_BRANCH: "None" }
script:
- mkdir -p public
- /usr/bin/bash utils/retrieve-artifacts.sh
- python3 utils/write-index.py
artifacts:
name: "all-documentation"
expire_in: 1 week
paths: [ public/ ]
##########
# Deploy #
##########
# Ensure package creation on merge request
create-package:
stage: build
image: ${FEDORA_32}
script:
- conan create . --profile native --build missing --build openjpeg* --version head --user lrde --channel ${CONAN_CHANNEL}
- conan create . --profile native --build missing --build openjpeg* --version head --user lrde --channel ${CONAN_CHANNEL} -o pylene/*:fPIC=True
- conan create . --profile native --build missing --build openjpeg* --version head --user lrde --channel ${CONAN_CHANNEL} -o pylene/*:shared=True
variables:
CONAN_CHANNEL: "unstable"
rules:
- if: $CI_MERGE_REQUEST_ID
deploy-package:
parallel:
matrix:
- FEDORA_VERSION: ${FEDORA_32} # GCC-10
CONAN_CHANNEL: ["stable", "unstable"]
- FEDORA_VERSION: ${FEDORA_34} # GCC-11
CONAN_CHANNEL: ["stable", "unstable"]
- FEDORA_VERSION: ${FEDORA_36} # GCC-12
CONAN_CHANNEL: ["stable", "unstable"]
stage: deploy
script: !reference [create-package, script]
after_script:
- conan remote login -p $CONAN_PASSWORD lrde-public $CONAN_LOGIN_USERNAME
- conan upload pylene/head@lrde/$CONAN_CHANNEL -r lrde-public
- conan remote logout lrde-public
image: ${FEDORA_VERSION}
variables:
CONAN_REVISIONS_ENABLED: 1
rules:
- if: $CONAN_CHANNEL == "stable" && $CI_COMMIT_BRANCH == "master"
- if: $CONAN_CHANNEL == "unstable" && $CI_COMMIT_BRANCH == "next"