@@ -227,6 +227,49 @@ jobs:
227
227
else
228
228
npx electron-builder --mac zip:x64 zip:arm64 --projectDir dist
229
229
fi
230
+ - name : Test Electron app
231
+ run : |
232
+ echo "Extracting macOS app for testing..."
233
+ cd dist/bld/Electron
234
+
235
+ # Find the first zip file (prefer x64 if available)
236
+ ZIP_FILE=$(ls -1 *.zip | head -1)
237
+ echo "Found zip file: $ZIP_FILE"
238
+
239
+ # Extract the zip file
240
+ unzip -q "$ZIP_FILE"
241
+
242
+ # Find the .app bundle
243
+ APP_BUNDLE=$(find . -name "*.app" -type d | head -1)
244
+ echo "Found app bundle: $APP_BUNDLE"
245
+
246
+ if [ -z "$APP_BUNDLE" ]; then
247
+ echo "Error: No .app bundle found!"
248
+ exit 1
249
+ fi
250
+
251
+ # Remove quarantine attribute (required for CI)
252
+ xattr -dr com.apple.quarantine "$APP_BUNDLE" || true
253
+
254
+ # Start Electron app with CI-friendly flags
255
+ "$APP_BUNDLE/Contents/MacOS/Kiwix JS Electron" \
256
+ --headless \
257
+ --disable-gpu-sandbox \
258
+ --no-sandbox &
259
+
260
+ APP_PID=$!
261
+ echo "Started app with PID: $APP_PID"
262
+
263
+ # Wait for app to start
264
+ sleep 10
265
+
266
+ # Take screenshot to verify app started
267
+ screencapture -x test-screenshot.png || echo "Screenshot failed (expected in CI)"
268
+
269
+ # Kill app
270
+ kill $APP_PID || true
271
+
272
+ echo "Smoke test completed successfully"
230
273
- name : Upload packages to Kiwix
231
274
if : github.event.inputs.target != 'artefacts'
232
275
run : |
@@ -241,6 +284,7 @@ jobs:
241
284
name : kiwix-js-electron_macos
242
285
path : |
243
286
dist/bld/Electron/*.zip
287
+ dist/bld/Electron/test-screenshot.png
244
288
245
289
Release_Windows :
246
290
if : github.event.inputs.macosonly != 'true'
0 commit comments