Skip to content

Commit 4a6c4f0

Browse files
Chr1sNoCalcProgrammer1
authored andcommitted
Adding test stages to Linux builds
* Build based on new OpenRGB docker image (Debian Stretch) * Adapting AppImage build scripts to new docker image * Changing postinstall script to avoid error + Adding test stage keyword + Adding needs keyword + Debian 10 Buster 32bit & 64bit + Debian 11 Bullseye 32bit & 64bit + Fedora 34 v34 64bit only + Ubuntu 18.04LTS Bionic 32bit & 64bit + Ubuntu 20.04LTS Focal 64bit only + Ubuntu 20.10 Groovy 64bit only + Mint 20.1 Ulyssa 32bit & 64bit Amended to leave Bullseye builds in place by Adam Honse <[email protected]>
1 parent be838aa commit 4a6c4f0

File tree

4 files changed

+259
-24
lines changed

4 files changed

+259
-24
lines changed

.gitlab-ci.yml

Lines changed: 240 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,23 @@
1616

1717
stages:
1818
- build
19+
- test
1920

2021
before_script:
2122
- echo "started by ${GITLAB_USER_NAME}"
2223

2324
#reusable templates
2425
.ccache_init: &ccache_init
2526
before_script:
26-
- apt update
27-
- apt install -y build-essential qtcreator qtbase5-dev libusb-1.0-0-dev libhidapi-dev pkgconf wget git file
27+
- export QT_SELECT=qt5
28+
- export APPIMAGE_EXTRACT_AND_RUN=1
2829

2930
#-----------------------------------------------------------------------#
3031
# Linux (AppImage) 32-bit Build Target #
3132
#-----------------------------------------------------------------------#
3233
"Linux 32 AppImage":
3334
<<: *ccache_init
34-
image: i386/debian:bullseye
35+
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:stretch-32
3536
stage: build
3637
script:
3738
- export $(dpkg-architecture)
@@ -50,7 +51,7 @@ before_script:
5051
#-----------------------------------------------------------------------#
5152
"Linux 64 AppImage":
5253
<<: *ccache_init
53-
image: debian:bullseye
54+
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:stretch-64
5455
stage: build
5556
script:
5657
- export $(dpkg-architecture)
@@ -69,10 +70,9 @@ before_script:
6970
#-----------------------------------------------------------------------#
7071
"Linux 32 deb":
7172
<<: *ccache_init
72-
image: i386/debian:bullseye
73+
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:stretch-32
7374
stage: build
7475
script:
75-
- apt install -y debhelper
7676
- dpkg-architecture -l
7777
- dpkg-buildpackage --target-arch i386 -us -B
7878
- rm -v ../openrgb-dbgsym*.deb
@@ -91,10 +91,9 @@ before_script:
9191
#-----------------------------------------------------------------------#
9292
"Linux 64 deb":
9393
<<: *ccache_init
94-
image: debian:bullseye
94+
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:stretch-64
9595
stage: build
9696
script:
97-
- apt install -y debhelper
9897
- dpkg-architecture -l
9998
- dpkg-buildpackage -us -B
10099
- rm -v ../openrgb-dbgsym*.deb
@@ -134,7 +133,239 @@ before_script:
134133
paths:
135134
- openrgb*.rpm
136135
expire_in: 30 days
137-
136+
137+
#-----------------------------------------------------------------------#
138+
# Linux (.deb) Debian Bullseye 32-bit Build Target #
139+
#-----------------------------------------------------------------------#
140+
"Linux 32 deb Bullseye":
141+
<<: *ccache_init
142+
image: i386/debian:bullseye
143+
stage: build
144+
script:
145+
- apt update
146+
- apt install -y build-essential qtcreator qtbase5-dev libusb-1.0-0-dev libhidapi-dev pkgconf wget git file debhelper
147+
- dpkg-architecture -l
148+
- dpkg-buildpackage --target-arch i386 -us -B
149+
- rm -v ../openrgb-dbgsym*.deb
150+
- mv -v ../openrgb*.deb ./
151+
152+
artifacts:
153+
name: "${CI_PROJECT_NAME}_Linux_32_deb_${CI_COMMIT_SHORT_SHA}"
154+
paths:
155+
- openrgb*.deb
156+
exclude:
157+
- openrgb-dbgsym*.deb
158+
expire_in: 30 days
159+
160+
#-----------------------------------------------------------------------#
161+
# Linux (.deb) Debian Bullseye 64-bit Build Target #
162+
#-----------------------------------------------------------------------#
163+
"Linux 64 deb Bullseye":
164+
<<: *ccache_init
165+
image: debian:bullseye
166+
stage: build
167+
script:
168+
- apt update
169+
- apt install -y build-essential qtcreator qtbase5-dev libusb-1.0-0-dev libhidapi-dev pkgconf wget git file debhelper
170+
- dpkg-architecture -l
171+
- dpkg-buildpackage -us -B
172+
- rm -v ../openrgb-dbgsym*.deb
173+
- mv -v ../openrgb*.deb ./
174+
175+
artifacts:
176+
name: "${CI_PROJECT_NAME}_Linux_64_deb_${CI_COMMIT_SHORT_SHA}"
177+
paths:
178+
- openrgb*.deb
179+
exclude:
180+
- openrgb-dbgsym*.deb
181+
expire_in: 30 days
182+
183+
#-----------------------------------------------------------------------#
184+
# Debian 32 Buster test #
185+
#-----------------------------------------------------------------------#
186+
"Debian 32 Buster":
187+
image: i386/debian:buster
188+
stage: test
189+
script:
190+
- apt update
191+
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*i386.deb
192+
- openrgb --version
193+
- openrgb -l
194+
- apt remove -y openrgb
195+
dependencies:
196+
- "Linux 32 deb"
197+
needs:
198+
- "Linux 32 deb"
199+
200+
#-----------------------------------------------------------------------#
201+
# Debian 32 Bullseye test #
202+
#-----------------------------------------------------------------------#
203+
"Debian 32 Bullseye":
204+
image: i386/debian:bullseye
205+
stage: test
206+
script:
207+
- apt update
208+
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*i386.deb
209+
- openrgb --version
210+
- openrgb -l
211+
- apt remove -y openrgb
212+
dependencies:
213+
- "Linux 32 deb"
214+
needs:
215+
- "Linux 32 deb"
216+
217+
#-----------------------------------------------------------------------#
218+
# Ubuntu 32 18.04LTS test #
219+
#-----------------------------------------------------------------------#
220+
"Ubuntu 32 18.04LTS":
221+
image: i386/ubuntu:bionic
222+
stage: test
223+
script:
224+
- apt update
225+
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*i386.deb
226+
- openrgb --version
227+
- openrgb -l
228+
- apt remove -y openrgb
229+
dependencies:
230+
- "Linux 32 deb"
231+
needs:
232+
- "Linux 32 deb"
233+
234+
#-----------------------------------------------------------------------#
235+
# Mint 32 19.3 test #
236+
#-----------------------------------------------------------------------#
237+
"Mint 32 20.1":
238+
image: linuxmintd/mint19.3-i386
239+
stage: test
240+
script:
241+
- apt update
242+
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*i386.deb
243+
- openrgb --version
244+
- openrgb -l
245+
- apt remove -y openrgb
246+
dependencies:
247+
- "Linux 32 deb"
248+
needs:
249+
- "Linux 32 deb"
250+
251+
#-----------------------------------------------------------------------#
252+
# Debian 64 Buster test #
253+
#-----------------------------------------------------------------------#
254+
"Debian 64 Buster":
255+
image: debian:buster
256+
stage: test
257+
script:
258+
- apt update
259+
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*amd64.deb
260+
- openrgb --version
261+
- openrgb -l
262+
- apt remove -y openrgb
263+
dependencies:
264+
- "Linux 64 deb"
265+
needs:
266+
- "Linux 64 deb"
267+
268+
#-----------------------------------------------------------------------#
269+
# Debian 64 Bullseye test #
270+
#-----------------------------------------------------------------------#
271+
"Debian 64 Bullseye":
272+
image: debian:bullseye
273+
stage: test
274+
script:
275+
- apt update
276+
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*amd64.deb
277+
- openrgb --version
278+
- openrgb -l
279+
- apt remove -y openrgb
280+
dependencies:
281+
- "Linux 64 deb"
282+
needs:
283+
- "Linux 64 deb"
284+
285+
#-----------------------------------------------------------------------#
286+
# Fedora 64 v34 test #
287+
#-----------------------------------------------------------------------#
288+
"Fedora 64 v34":
289+
image: fedora:34
290+
stage: test
291+
script:
292+
- yum -y localinstall ./openrgb*64.rpm
293+
- openrgb --version
294+
- openrgb -l
295+
- yum -y remove openrgb
296+
dependencies:
297+
- "Linux 64 rpm"
298+
needs:
299+
- "Linux 64 rpm"
300+
301+
#-----------------------------------------------------------------------#
302+
# Ubuntu 64 18.04LTS test #
303+
#-----------------------------------------------------------------------#
304+
"Ubuntu 64 18.04LTS":
305+
image: ubuntu:bionic
306+
stage: test
307+
script:
308+
- apt update
309+
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*amd64.deb
310+
- openrgb --version
311+
- openrgb -l
312+
- apt remove -y openrgb
313+
dependencies:
314+
- "Linux 64 deb"
315+
needs:
316+
- "Linux 64 deb"
317+
318+
#-----------------------------------------------------------------------#
319+
# Ubuntu 64 20.04LTS test #
320+
#-----------------------------------------------------------------------#
321+
"Ubuntu 64 20.04LTS":
322+
image: ubuntu:focal
323+
stage: test
324+
script:
325+
- apt update
326+
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*amd64.deb
327+
- openrgb --version
328+
- openrgb -l
329+
- apt remove -y openrgb
330+
dependencies:
331+
- "Linux 64 deb"
332+
needs:
333+
- "Linux 64 deb"
334+
335+
#-----------------------------------------------------------------------#
336+
# Ubuntu 64 20.10 test #
337+
#-----------------------------------------------------------------------#
338+
"Ubuntu 64 20.10":
339+
image: ubuntu:groovy
340+
stage: test
341+
script:
342+
- apt update
343+
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*amd64.deb
344+
- openrgb --version
345+
- openrgb -l
346+
- apt remove -y openrgb
347+
dependencies:
348+
- "Linux 64 deb"
349+
needs:
350+
- "Linux 64 deb"
351+
352+
#-----------------------------------------------------------------------#
353+
# Mint 64 20.1 test #
354+
#-----------------------------------------------------------------------#
355+
"Mint 64 20.1":
356+
image: linuxmintd/mint20.1-amd64
357+
stage: test
358+
script:
359+
- apt update
360+
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*amd64.deb
361+
- openrgb --version
362+
- openrgb -l
363+
- apt remove -y openrgb
364+
dependencies:
365+
- "Linux 64 deb"
366+
needs:
367+
- "Linux 64 deb"
368+
138369
#-----------------------------------------------------------------------#
139370
# Windows (32-bit) Build Target #
140371
#-----------------------------------------------------------------------#

debian/openrgb.postinst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ set -u -o pipefail
55

66
# Reload rules
77
if [ -f /bin/udevadm ]; then
8-
udevadm control --reload-rules && udevadm trigger;
8+
udevadm control --reload-rules || echo "done"
9+
udevadm trigger;
910
else
1011
echo
1112
echo "\/-------------------------------------------------------\\"

filesystem.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,21 @@
44
#if defined(__has_include) && __has_include(<filesystem>)
55

66
#include <filesystem>
7+
8+
// Debian 10 provides the header, but does not enable the feature, so we additionally check for the feature test macro
9+
// MSVC below 2017 does not provide feature test macros, so we leave an exception for them
10+
#if defined(__cpp_lib_filesystem) || defined (_MSC_VER)
711
namespace filesystem = std::filesystem;
12+
#define STD_FILESYSTEM_FOUND
13+
#endif
14+
15+
#endif
16+
17+
#ifndef STD_FILESYSTEM_FOUND
818

9-
#else
19+
#if defined(__has_include) && !__has_include(<experimental/filesystem>)
20+
#error Neither <filesystem> nor <experimental/filesystem> could be found on the system! Please report an issue to OpenRGB developers providing your system info.
21+
#endif
1022

1123
#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING
1224
#include <experimental/filesystem>

scripts/build-appimage.sh

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ set -e
1212
# Use RAM disk if possible (if available and not building on a CI #
1313
# system like Travis) #
1414
#-----------------------------------------------------------------------#
15-
if [ "$CI" == "" ] && [ -d /dev/shm ]; then
16-
TEMP_BASE=/dev/shm
17-
else
18-
TEMP_BASE=/tmp
19-
fi
15+
TEMP_BASE=/tmp
2016
BUILD_DIR=$(mktemp -d -p "$TEMP_BASE" appimage-build-XXXXXX)
2117

2218
#-----------------------------------------------------------------------#
@@ -72,20 +68,15 @@ qmake "$REPO_ROOT"
7268
make -j$(nproc) TARGET="$TARGET"
7369
make install INSTALL_ROOT=AppDir
7470

75-
#-----------------------------------------------------------------------#
76-
# Make them executable #
77-
#-----------------------------------------------------------------------#
78-
chmod +x "$REPO_ROOT"/scripts/tools/linuxdeploy*.AppImage
79-
8071
#-----------------------------------------------------------------------#
8172
# Make sure Qt plugin finds QML sources so it can deploy the imported #
8273
# files #
8374
#-----------------------------------------------------------------------#
8475
export QML_SOURCES_PATHS="$REPO_ROOT"/src
8576

86-
"$REPO_ROOT"/scripts/tools/linuxdeploy-"$ARCH".AppImage --appimage-extract-and-run --appdir AppDir -e "$TARGET" -i "$REPO_ROOT"/qt/OpenRGB.png -d "$REPO_ROOT"/qt/OpenRGB.desktop
87-
"$REPO_ROOT"/scripts/tools/linuxdeploy-plugin-qt-"$ARCH".AppImage --appimage-extract-and-run --appdir AppDir
88-
"$REPO_ROOT"/scripts/tools/linuxdeploy-"$ARCH".AppImage --appimage-extract-and-run --appdir AppDir --output appimage
77+
linuxdeploy-"$ARCH".AppImage --appdir AppDir -e "$TARGET" -i "$REPO_ROOT"/qt/OpenRGB.png -d "$REPO_ROOT"/qt/OpenRGB.desktop
78+
linuxdeploy-plugin-qt-"$ARCH".AppImage --appdir AppDir
79+
linuxdeploy-"$ARCH".AppImage --appdir AppDir --output appimage
8980

9081
#-----------------------------------------------------------------------#
9182
# Move built AppImage back into original CWD #

0 commit comments

Comments
 (0)