-
Notifications
You must be signed in to change notification settings - Fork 12
/
.gitlab-ci.yml
159 lines (150 loc) · 4.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
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: -DRDMNET_BUILD_TESTS=ON -DRDMNET_BUILD_CONSOLE_EXAMPLES=ON
PROJECT_BOT_USER: project_270_bot
windows-build:
stage: build
tags:
- ct-windows
parallel:
matrix:
- CMAKE_GENERATOR_OPTIONS: -A Win32
QT_DIRECTORY: C:\Qt_os\5.12.11\msvc2017
CMAKE_INSTALL: install_x86
VCVARSALL_PLATFORM: x86
ARTIFACT_TYPE: x86
- CMAKE_GENERATOR_OPTIONS: -A x64
QT_DIRECTORY: C:\Qt_os\5.12.11\msvc2017_64
CMAKE_INSTALL: install_x64
VCVARSALL_PLATFORM: amd64
ARTIFACT_TYPE: x64
script:
- python tools\ci\update_artifact_version.py
- mkdir build
- cd build
- cmake -G "Visual Studio 16 2019" $env:CMAKE_GENERATOR_OPTIONS.Split(" ") "-DQTDIR=$env:QT_DIRECTORY" "-DCMAKE_INSTALL_PREFIX=$env:CMAKE_INSTALL" $env:GLOBAL_CMAKE_OPTIONS.Split(" ") -DRDMNET_BUILD_GUI_EXAMPLES=ON ..
- cmake --build . --config Release -j
- ctest -C Release --output-on-failure
- cmake -P cmake_install.cmake
- cd ..
- .\tools\ci\windows_build_installer.bat
artifacts:
when: always
paths:
- RDMnetSetup_$ARTIFACT_TYPE.msi
reports:
junit: build/tests/test-results/*.xml
macos-build:
stage: build
tags:
- ct-macos
variables:
QT_DIRECTORY: /Users/Shared/Qt/5.9.7/clang_64
script:
- pip3 config set global.index-url https://artifactory.etcconnect.com/artifactory/api/pypi/ETC-PyPI/simple
- pip3 config set global.trusted-host artifactory.etcconnect.com
- pip3 install etcdevtool
- python3 tools/ci/update_artifact_version.py
- mkdir build
- cd build
- cmake -DQTDIR=${QT_DIRECTORY} -DCMAKE_INSTALL_PREFIX=install ${GLOBAL_CMAKE_OPTIONS} -DRDMNET_BUILD_GUI_EXAMPLES=ON ..
- cmake --build . --config Release -j
- cmake -P cmake_install.cmake
- ctest --output-on-failure
- cd ..
- python3 tools/install/macos/macos_build_package.py
artifacts:
when: always
paths:
- RDMnet.pkg
reports:
junit: build/tests/test-results/*.xml
linux-build:
stage: build
tags:
- etc-linux-docker
image: etc-docker.artifactory.etcconnect.com/rikorose/gcc-cmake:latest
parallel:
matrix:
- CMAKE_LINUX_OPTIONS: -DRDMNET_BUILD_TESTS_STATIC=OFF
- CMAKE_LINUX_OPTIONS: -DRDMNET_BUILD_TESTS_STATIC=ON -DRDMNET_FORCE_LIGHTWEIGHT_DNS_QUERIER=ON
script:
- apt-get update && apt-get install -y --no-install-recommends uuid-dev libavahi-client-dev
- mkdir build
- cd build
- cmake ${GLOBAL_CMAKE_OPTIONS} ${CMAKE_LINUX_OPTIONS} -DRDMNET_ENABLE_ASAN=ON ..
- cmake --build .
- 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:latest
script:
- apt-get update && apt-get install -y --no-install-recommends uuid-dev libavahi-client-dev
# Remove the .git folder to simulate building from P4/zip archive
- rm -rf .git/
- mkdir build
- cd build
# Use default config, no options
- cmake ..
- cmake --build .
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.9.1
variables:
GIT_DEPTH: 0
script:
- pip install --upgrade etcdevtool
- etcdevtool docs . 1.9.1
- 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.9.1
variables:
GIT_DEPTH: 0
GH_REPO_NAME: RDMnetDocs
GH_REPO_REF: github.com/ETCLabs/RDMnetDocs.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
# Deploy versioned build
include:
- project: 'etc/common-tech/tools/gitlab-ci-util'
ref: v2.0.1
file: '/ci-yml/deploy-versioned-build.yml'
deploy-artifacts:
stage: deploy
rules:
- if: '$CI_PIPELINE_SOURCE == "web" && $NEW_BUILD_VERSION =~ /^\d+\.\d+\.\d+\.\d+$/ && $CI_COMMIT_REF_NAME == "main"'
tags:
- etc-linux-docker
image: etc-docker.artifactory.etcconnect.com/python:latest
script:
- pip install requests PyGithub
- python3 tools/ci/deploy_to_github_release.py ${NEW_BUILD_VERSION}