From 947b5ded931d858e0f9b576291418fa2f45be224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kr=C3=BChlmann?= Date: Tue, 6 Jan 2026 01:52:34 +0100 Subject: [PATCH] Add smoke tests to electron app --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ src/main/node/app.js | 7 +++++++ 2 files changed, 29 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0fa6539..3fcd7e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,6 +66,28 @@ jobs: - name: Build Electron bundles run: ${{ matrix.build-command }} + - name: Smoke test AppImage (Linux) + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install -y xvfb + chmod +x dist/*.AppImage + xvfb-run ./dist/*.AppImage + + - name: Smoke test Windows exe + if: matrix.os == 'windows-latest' + shell: powershell + run: | + Start-Process -FilePath "dist\*.exe" + Start-Sleep -Seconds 5 + + - name: Smoke test macOS app + if: matrix.os == 'macos-latest' + run: | + open dist/*.app + sleep 5 + pkill -f Imgfloat || true + - name: Upload Electron artifacts uses: actions/upload-artifact@v4 with: diff --git a/src/main/node/app.js b/src/main/node/app.js index 10f4ef2..075a637 100644 --- a/src/main/node/app.js +++ b/src/main/node/app.js @@ -88,6 +88,13 @@ function createWindow() { } app.whenReady().then(() => { + if (process.env.CI) { + process.on("uncaughtException", (err) => { + console.error("Uncaught exception:", err); + app.exit(1); + }); + setTimeout(() => app.quit(), 3000); + } autoUpdater.checkForUpdatesAndNotify(); let broadcastRect = { width: 0, height: 0 };