-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
222 lines (211 loc) · 9.97 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
222 lines (211 loc) · 9.97 KB
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
variables:
SHMDATA_VERSION: '1.3.74'
CTEST_OUTPUT_ON_FAILURE: '1'
GIT_SUBMODULE_STRATEGY: recursive
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/releases"
CMAKE_PLUGINS_OPTIONS: '-DPLUGIN_AV=OFF -DPLUGIN_CRASHTEST=OFF -DPLUGIN_CROPPER=OFF -DPLUGIN_EXECUTOR=OFF -DPLUGIN_GLFW=OFF -DPLUGIN_JACK=OFF -DPLUGIN_LADSPA=OFF -DPLUGIN_MIDI=OFF -DPLUGIN_NVENC=OFF -DPLUGIN_OSC=OFF -DPLUGIN_PROTOCOL_MAPPER=OFF -DPLUGIN_PULSE=OFF -DPLUGIN_RESAMPLE=OFF -DPLUGIN_RTMP=OFF -DPLUGIN_SIP=OFF -DPLUGIN_SYSTEMUSAGE=OFF -DPLUGIN_TIMECODE=OFF -DPLUGIN_V4L2=OFF -DPLUGIN_VIDEO_SNAPSHOT=OFF -DPLUGIN_VNC=OFF -DPLUGIN_VRPN=OFF -DPLUGIN_WATCHER=OFF -DPLUGIN_WEBRTC=OFF'
stages:
- test
- coverage
- package
- upload
- release
Test Ubuntu 20.04:
stage: test
image: ubuntu:20.04
script:
- DEBIAN_FRONTEND=noninteractive apt update -y
- DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends git cmake build-essential libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev python3-dev wget ca-certificates
- wget https://gitlab.com/api/v4/projects/42406192/packages/generic/releases/${SHMDATA_VERSION}/ubuntu20.04_shmdata-dev_${SHMDATA_VERSION}_amd64.deb
- dpkg -i ubuntu20.04_shmdata-dev_${SHMDATA_VERSION}_amd64.deb
- DEBIAN_FRONTEND=noninteractive apt install -y -qq $(cat deps/apt-build-ubuntu-20.04) $(cat deps/apt-runtime-ubuntu-20.04)
- pip3 install -r deps/pip3-ubuntu20.04
- mkdir build20.04 && cd build20.04
- cmake -DENABLE_GPL="ON" ${CMAKE_PLUGINS_OPTIONS} -DCMAKE_BUILD_TYPE="Release" ..
- make -j`nproc` install
- ldconfig
- make test
except:
- develop
- master
Test Ubuntu 22.04:
stage: test
image: ubuntu:22.04
script:
- DEBIAN_FRONTEND=noninteractive apt update -y
- DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends git cmake build-essential libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev python3-dev wget ca-certificates
- wget https://gitlab.com/api/v4/projects/42406192/packages/generic/releases/${SHMDATA_VERSION}/ubuntu22.04_shmdata-dev_${SHMDATA_VERSION}_amd64.deb
- dpkg -i ubuntu22.04_shmdata-dev_${SHMDATA_VERSION}_amd64.deb
- DEBIAN_FRONTEND=noninteractive apt install -y -qq $(cat deps/apt-build-ubuntu-22.04) $(cat deps/apt-runtime-ubuntu-22.04)
- pip3 install -r deps/pip3-ubuntu22.04
- mkdir build22.04 && cd build22.04
- cmake -DENABLE_GPL="ON" ${CMAKE_PLUGINS_OPTIONS} -DCMAKE_BUILD_TYPE="Release" ..
- make -j`nproc` install
- ldconfig
- make test
except:
- develop
- master
Test Ubuntu 23.04:
stage: test
image: ubuntu:23.04
script:
- DEBIAN_FRONTEND=noninteractive apt update -y
- DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends git cmake build-essential libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev python3-dev wget ca-certificates
- wget https://gitlab.com/api/v4/projects/42406192/packages/generic/releases/${SHMDATA_VERSION}/ubuntu23.04_shmdata-dev_${SHMDATA_VERSION}_amd64.deb
- dpkg -i ubuntu23.04_shmdata-dev_${SHMDATA_VERSION}_amd64.deb
- DEBIAN_FRONTEND=noninteractive apt install -y -qq $(cat deps/apt-build-ubuntu-23.04) $(cat deps/apt-runtime-ubuntu-23.04)
- mkdir build23.04 && cd build23.04
- cmake -DENABLE_GPL="ON" ${CMAKE_PLUGINS_OPTIONS} -DCMAKE_BUILD_TYPE="Release" ..
- make -j`nproc` install
- ldconfig
- make test
except:
- develop
- master
Coverage -- Ubuntu 22.04:
stage: coverage
image: ubuntu:22.04
script:
- DEBIAN_FRONTEND=noninteractive apt update -y && apt install -y lcov zip
- DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends git cmake build-essential libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev python3-dev wget ca-certificates
- wget https://gitlab.com/api/v4/projects/42406192/packages/generic/releases/${SHMDATA_VERSION}/ubuntu22.04_shmdata-dev_${SHMDATA_VERSION}_amd64.deb
- dpkg -i ubuntu22.04_shmdata-dev_${SHMDATA_VERSION}_amd64.deb
- DEBIAN_FRONTEND=noninteractive apt install -y -qq $(cat deps/apt-build-ubuntu-22.04) $(cat deps/apt-runtime-ubuntu-22.04)
- pip3 install -r deps/pip3-ubuntu22.04
- rm -rf build && mkdir build && cd build
- cmake -DTEST_COVERAGE=ON -DENABLE_GPL=ON ${CMAKE_PLUGINS_OPTIONS} ..
- make -j`nproc` && make install && ldconfig
- make check_coverage
- zip -r coverage.zip coverage
- mv coverage.zip ../
artifacts:
name: "switcher_coverage_${CI_BUILD_REF_NAME}"
paths:
- "coverage.zip"
only:
- develop
Debian Package Ubuntu 20.04:
stage: package
image: ubuntu:20.04
rules:
- if: $CI_COMMIT_TAG # Run this job when a tag is created
script:
- DEBIAN_FRONTEND=noninteractive apt update -y
- DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends file doxygen graphviz
- DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends git cmake build-essential libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev python3-dev wget ca-certificates
- wget https://gitlab.com/api/v4/projects/42406192/packages/generic/releases/${SHMDATA_VERSION}/ubuntu20.04_shmdata-dev_${SHMDATA_VERSION}_amd64.deb
- dpkg -i ubuntu20.04_shmdata-dev_${SHMDATA_VERSION}_amd64.deb
- DEBIAN_FRONTEND=noninteractive apt install -y -qq $(cat deps/apt-build-ubuntu-20.04) $(cat deps/apt-runtime-ubuntu-20.04)
- mkdir -p release-files/
- pushd .
- rm -rf build && mkdir build && cd build
- cmake -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_GPL="ON" ${CMAKE_PLUGINS_OPTIONS} -DCMAKE_BUILD_TYPE="Debug" ..
- make doc
- make install
- make -j`nproc` package
- make uninstall
- |
for i in switcher-dbg*.deb; do cp $i ../release-files/ubuntu20.04_$i; done
- popd
- rm -rf build && mkdir build && cd build
- cmake -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_GPL="ON" ${CMAKE_PLUGINS_OPTIONS} -DCMAKE_BUILD_TYPE="Release" ..
- make doc
- make install
- make -j`nproc` package
- |
for i in switcher-lib*.deb switcher-dev*.deb; do cp $i ../release-files/ubuntu20.04_$i; done
artifacts:
paths:
- release-files/
Debian Package Ubuntu 22.04:
stage: package
image: ubuntu:22.04
rules:
- if: $CI_COMMIT_TAG # Run this job when a tag is created
script:
- DEBIAN_FRONTEND=noninteractive apt update -y
- DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends file doxygen graphviz
- DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends git cmake build-essential libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev python3-dev wget ca-certificates
- wget https://gitlab.com/api/v4/projects/42406192/packages/generic/releases/${SHMDATA_VERSION}/ubuntu22.04_shmdata-dev_${SHMDATA_VERSION}_amd64.deb
- dpkg -i ubuntu22.04_shmdata-dev_${SHMDATA_VERSION}_amd64.deb
- DEBIAN_FRONTEND=noninteractive apt install -y -qq $(cat deps/apt-build-ubuntu-22.04) $(cat deps/apt-runtime-ubuntu-22.04)
- mkdir -p release-files/
- pushd .
- rm -rf build && mkdir build && cd build
- cmake -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_GPL="ON" ${CMAKE_PLUGINS_OPTIONS} -DCMAKE_BUILD_TYPE="Debug" ..
- make doc
- make install
- make -j`nproc` package
- make uninstall
- |
for i in switcher-dbg*.deb; do cp $i ../release-files/ubuntu22.04_$i; done
- popd
- rm -rf build && mkdir build && cd build
- cmake -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_GPL="ON" ${CMAKE_PLUGINS_OPTIONS} -DCMAKE_BUILD_TYPE="Release" ..
- make doc
- make install
- make -j`nproc` package
- |
for i in switcher-lib*.deb switcher-dev*.deb; do cp $i ../release-files/ubuntu22.04_$i; done
artifacts:
paths:
- release-files/
Debian Package Ubuntu 23.04:
stage: package
image: ubuntu:23.04
rules:
- if: $CI_COMMIT_TAG # Run this job when a tag is created
script:
- DEBIAN_FRONTEND=noninteractive apt update -y
- DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends file doxygen graphviz
- DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends git cmake build-essential libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev python3-dev wget ca-certificates
- wget https://gitlab.com/api/v4/projects/42406192/packages/generic/releases/${SHMDATA_VERSION}/ubuntu23.04_shmdata-dev_${SHMDATA_VERSION}_amd64.deb
- dpkg -i ubuntu23.04_shmdata-dev_${SHMDATA_VERSION}_amd64.deb
- DEBIAN_FRONTEND=noninteractive apt install -y -qq $(cat deps/apt-build-ubuntu-23.04) $(cat deps/apt-runtime-ubuntu-23.04)
- mkdir -p release-files/
- pushd .
- rm -rf build && mkdir build && cd build
- cmake -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_GPL="ON" ${CMAKE_PLUGINS_OPTIONS} -DCMAKE_BUILD_TYPE="Debug" ..
- make doc
- make install
- make -j`nproc` package
- make uninstall
- |
for i in switcher-dbg*.deb; do cp $i ../release-files/ubuntu23.04_$i; done
- popd
- rm -rf build && mkdir build && cd build
- cmake -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_GPL="ON" ${CMAKE_PLUGINS_OPTIONS} -DCMAKE_BUILD_TYPE="Release" ..
- make doc
- make install
- make -j`nproc` package
- |
for i in switcher-lib*.deb switcher-dev*.deb; do cp $i ../release-files/ubuntu23.04_$i; done
artifacts:
paths:
- release-files/
#
# Gitlab release
#
Gitlab release upload:
stage: upload
image: curlimages/curl:latest
rules:
- if: $CI_COMMIT_TAG
script:
- |
for i in $(ls release-files/); do curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file release-files/${i} "${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/${i}"; done
Gitlab release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- |
release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \
--description LAST_RELEASE.md \
$(\
for i in $(ls release-files/); do \
echo --assets-link "{\"name\":\"${i}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/${i}\",\"link_type\":\"package\"}" ;\
done \
)