Skip to content

Commit 615543c

Browse files
Merge pull request #87 from logos-co/feat/ciUiSmokeTest
feat: add smoke test fir ui app on CI
2 parents 473a073 + 819c546 commit 615543c

File tree

4 files changed

+106
-0
lines changed

4 files changed

+106
-0
lines changed

.github/workflows/build.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,33 @@ jobs:
2828
- name: Build bin-appimage
2929
run: nix build .#bin-appimage
3030

31+
32+
- name: Install OpenGL libs
33+
run: |
34+
sudo apt-get update
35+
sudo apt-get install -y \
36+
libgl1 \
37+
libegl1 \
38+
libopengl0
39+
40+
- name: Smoke test (Linux)
41+
run: |
42+
set +e
43+
timeout 10 ./result/logos-app.AppImage --appimage-extract-and-run -platform offscreen 2>&1 | tee /tmp/logos-launch.log
44+
CODE=${PIPESTATUS[0]}
45+
set -e
46+
if grep -qE "QQmlApplicationEngine failed|module.*is not installed|Cannot assign|failed to load component" /tmp/logos-launch.log; then
47+
echo "❌ Critical QML errors"
48+
cat /tmp/logos-launch.log
49+
exit 1
50+
fi
51+
if [ "$CODE" -ne 124 ] && [ "$CODE" -ne 0 ]; then
52+
echo "❌ App crashed with exit code $CODE"
53+
cat /tmp/logos-launch.log
54+
exit 1
55+
fi
56+
echo "✅ Smoke test passed"
57+
3158
- name: Rename AppImage with architecture
3259
run: |
3360
arch="${{ matrix.arch }}"
@@ -51,6 +78,26 @@ jobs:
5178
- name: Build bin-macos-app
5279
run: nix build .#bin-macos-app
5380

81+
- name: Smoke test
82+
run: |
83+
./result/LogosApp.app/Contents/MacOS/LogosApp -platform offscreen > /tmp/logos-launch.log 2>&1 &
84+
APP_PID=$!
85+
sleep 10
86+
if grep -qE "QQmlApplicationEngine failed|module.*is not installed|Cannot assign|failed to load component" /tmp/logos-launch.log; then
87+
echo "❌ Critical QML errors detected"
88+
cat /tmp/logos-launch.log
89+
kill $APP_PID 2>/dev/null
90+
exit 1
91+
fi
92+
if kill -0 $APP_PID 2>/dev/null; then
93+
kill $APP_PID
94+
echo "✅ App launched and ran for 10s"
95+
else
96+
echo "❌ App crashed"
97+
cat /tmp/logos-launch.log
98+
exit 1
99+
fi
100+
54101
- name: Package app bundle as tarball
55102
run: |
56103
app=$(find result/ -name '*.app' -maxdepth 1 -print -quit)

app/macos/macWindowStyle.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66

77
#include "macWindowStyle.h"
88
#include <QMainWindow>
9+
#include <QGuiApplication>
910

1011
void applyMacWindowRoundedCorners(QMainWindow* w, bool rounded)
1112
{
1213
#ifdef Q_OS_MAC
14+
if (QGuiApplication::platformName() == "offscreen") return;
1315
if (!w) return;
1416
NSView* nsView = (NSView*)w->winId();
1517
if (!nsView) return;

ci/linux.Jenkinsfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,38 @@ pipeline {
5050
} }
5151
}
5252

53+
stage('Install OpenGL libs') {
54+
steps {
55+
sh '''
56+
apt-get update
57+
apt-get install -y libgl1 libegl1 libopengl0
58+
'''
59+
}
60+
}
61+
62+
stage('Smoke Test') {
63+
steps { script {
64+
sh '''
65+
set +e
66+
APPIMAGE=$(find result/ -name "*.AppImage" -print -quit)
67+
timeout 10 "$APPIMAGE" --appimage-extract-and-run -platform offscreen 2>&1 | tee /tmp/logos-launch.log
68+
CODE=${PIPESTATUS[0]}
69+
set -e
70+
if grep -qE "QQmlApplicationEngine failed|module.*is not installed|Cannot assign|failed to load component" /tmp/logos-launch.log; then
71+
echo "Critical QML errors detected"
72+
cat /tmp/logos-launch.log
73+
exit 1
74+
fi
75+
if [ "$CODE" -ne 124 ] && [ "$CODE" -ne 0 ]; then
76+
echo "App crashed with exit code $CODE"
77+
cat /tmp/logos-launch.log
78+
exit 1
79+
fi
80+
echo "Smoke test passed"
81+
'''
82+
} }
83+
}
84+
5385
stage('Package') {
5486
steps {
5587
sh 'mkdir -p pkg'

ci/macos.Jenkinsfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,31 @@ pipeline {
4343
} }
4444
}
4545

46+
stage('Smoke Test') {
47+
steps { script {
48+
sh '''
49+
nix build '.#app'
50+
./result/bin/LogosApp -platform offscreen > /tmp/logos-launch.log 2>&1 &
51+
APP_PID=$!
52+
sleep 10
53+
if grep -qE "QQmlApplicationEngine failed|module.*is not installed|Cannot assign|failed to load component" /tmp/logos-launch.log; then
54+
echo "Critical QML errors detected"
55+
cat /tmp/logos-launch.log
56+
kill $APP_PID 2>/dev/null
57+
exit 1
58+
fi
59+
if kill -0 $APP_PID 2>/dev/null; then
60+
kill $APP_PID
61+
echo "Smoke test passed"
62+
else
63+
echo "App crashed"
64+
cat /tmp/logos-launch.log
65+
exit 1
66+
fi
67+
'''
68+
} }
69+
}
70+
4671
stage('Package') {
4772
steps {
4873
sh 'mkdir -p pkg'

0 commit comments

Comments
 (0)