-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.gitlab-ci.yml
164 lines (154 loc) · 4.19 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
workflow:
rules:
- if: '$CI_COMMIT_REF_NAME == "main"'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_PIPELINE_SOURCE == "web"'
variables:
GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: normal
GLOBAL_CMAKE_OPTIONS: -DSACN_BUILD_TESTS=ON -DSACN_BUILD_EXAMPLES=ON -DSACN_WARN_AS_ERROR=ON
KLOCWORK_PROJECT: "sACN"
include:
# Versioned build automation
- project: "etc/common-tech/tools/gitlab-ci-util"
ref: v2.3.1
file: "/ci-yml/deploy-versioned-build.yml"
# Klocwork static analysis
- project: "etc/common-tech/tools/gitlab-ci-util"
ref: v2.3.1
file: "/ci-yml/linux-klocwork.yml"
windows-build:
stage: build
tags:
- ct-windows
variables:
SANITIZER_DEFS: -DSACN_ENABLE_E2E_TESTS=ON -DSACN_ENABLE_ASAN=ON
script:
- mkdir build
- cd build
- cmake -G "Visual Studio 16 2019" -A x64 $env:GLOBAL_CMAKE_OPTIONS.Split(" ") $env:SANITIZER_DEFS.Split(" ") ..
- cmake --build . --config Release -j
- ctest -C Release --output-on-failure
artifacts:
when: always
reports:
junit: build/tests/test-results/*.xml
macos-build:
stage: build
tags:
- ct-mac-m2
parallel:
matrix:
- SANITIZER_DEFS:
- -DSACN_ENABLE_ASAN=ON -DSACN_ENABLE_UBSAN=ON
- -DSACN_ENABLE_TSAN=ON
script:
- mkdir build
- cd build
- cmake ${GLOBAL_CMAKE_OPTIONS} ${SANITIZER_DEFS} ..
- cmake --build .
- ctest --output-on-failure
artifacts:
when: always
reports:
junit: build/tests/test-results/*.xml
linux-gcc-build:
stage: build
tags:
- etc-linux-docker
image: etc-docker.artifactory.etcconnect.com/etc/common-tech/gcc-cmake:llvm18
parallel:
matrix:
- SANITIZER_DEFS:
- -DSACN_ENABLE_E2E_TESTS=ON -DSACN_ENABLE_ASAN=ON -DSACN_ENABLE_UBSAN=ON
- -DSACN_ENABLE_E2E_TESTS=ON -DSACN_ENABLE_TSAN=ON
script:
- mkdir build
- cd build
- cmake ${GLOBAL_CMAKE_OPTIONS} ${SANITIZER_DEFS} ..
- make -j `nproc`
- ctest --output-on-failure
artifacts:
when: always
reports:
junit: build/tests/test-results/*.xml
linux-clang-build:
stage: build
tags:
- etc-linux-docker
image: etc-docker.artifactory.etcconnect.com/etc/common-tech/clang-cmake-msan:latest
parallel:
matrix:
- SANITIZER_DEFS:
- -DSACN_ENABLE_E2E_TESTS=ON -DSACN_ENABLE_MSAN=ON
script:
- mkdir build
- cd build
- cmake ${GLOBAL_CMAKE_OPTIONS} ${SANITIZER_DEFS} ..
- make -j `nproc`
- ctest --output-on-failure
artifacts:
when: always
reports:
junit: build/tests/test-results/*.xml
oss-build:
stage: build
tags:
- etc-linux-docker
image: etc-docker.artifactory.etcconnect.com/etc/common-tech/gcc-cmake:llvm18
script:
# Remove the .git folder to simulate building from P4/zip archive
- rm -rf .git/
- mkdir build
- cd build
# Use default config, no options
- cmake ..
- make -j `nproc`
# Job to lint the code using clang-tidy and clang-format.
lint:
stage: build
tags:
- etc-linux-docker
variables:
CMAKE_OPTIONS: -DSACN_ENABLE_CLANG_TIDY=ON -DSACN_CLANG_TIDY_WERROR=ON
image: etc-docker.artifactory.etcconnect.com/etc/common-tech/gcc-cmake:llvm18
script:
- mkdir build
- cd build
- cmake ${GLOBAL_CMAKE_OPTIONS} ${CMAKE_OPTIONS} ..
- make check_formatting
- make -j `nproc`
docs:
stage: build
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_PIPELINE_SOURCE == "web"'
tags:
- etc-linux-docker
image: etc-docker.artifactory.etcconnect.com/etc/common-tech/doxygen:1.11.0
variables:
GIT_DEPTH: 0
script:
- git fetch --tags
- etcdevtool docs . 1.11.0
- mkdir docs-build
- mv docs/build/* docs-build/
artifacts:
paths:
- docs-build
deploy-docs:
stage: deploy
rules:
- if: '$CI_COMMIT_REF_NAME == "main"'
tags:
- etc-linux-docker
image: etc-docker.artifactory.etcconnect.com/etc/common-tech/doxygen:1.11.0
variables:
GIT_DEPTH: 0
GH_REPO_NAME: sACNDocs
GH_REPO_REF: github.com/ETCLabs/sACNDocs.git
GH_REPO_TOKEN: $SVC_ETCLABS_REPO_TOKEN
script:
- pip install --upgrade etcdevtool
- chmod +x tools/ci/publish_docs.sh
- tools/ci/publish_docs.sh