@@ -227,6 +227,58 @@ jobs:
227
227
else
228
228
npx electron-builder --mac zip:x64 zip:arm64 --projectDir dist
229
229
fi
230
+ - name : Smoke test Electron app
231
+ run : |
232
+ echo "Extracting macOS app for testing..."
233
+ cd dist/bld/Electron
234
+ # Find the first zip file (prefer x64 if available)
235
+ ZIP_FILE=$(ls -1 *.zip | head -1)
236
+ echo "Found zip file: $ZIP_FILE"
237
+ # Extract the zip file
238
+ unzip -q "$ZIP_FILE"
239
+ # Find the .app bundle
240
+ APP_BUNDLE=$(find . -name "*.app" -type d | head -1)
241
+ echo "Found app bundle: $APP_BUNDLE"
242
+ if [ -z "$APP_BUNDLE" ]; then
243
+ echo "Error: No .app bundle found!"
244
+ exit 1
245
+ fi
246
+ # Remove quarantine attribute (required for CI)
247
+ xattr -dr com.apple.quarantine "$APP_BUNDLE" || true
248
+ # Test basic app launch (verify it can start without crashing)
249
+ echo "Testing app launch..."
250
+ "$APP_BUNDLE/Contents/MacOS/Kiwix JS Electron" \
251
+ --disable-gpu-sandbox \
252
+ --no-sandbox \
253
+ --disable-web-security \
254
+ --disable-dev-shm-usage \
255
+ --no-first-run \
256
+ --disable-default-apps &
257
+ APP_PID=$!
258
+ echo "Started app with PID: $APP_PID"
259
+ # Wait for app to start and check if process is running
260
+ sleep 8
261
+ if kill -0 $APP_PID 2>/dev/null; then
262
+ echo "✅ App process is running successfully"
263
+ # Check if app is responsive by looking at process details
264
+ echo "Process details:"
265
+ ps -p $APP_PID -o pid,ppid,time,command || true
266
+ echo "App is running and responsive"
267
+ # Kill app gracefully
268
+ kill -TERM $APP_PID 2>/dev/null || true
269
+ sleep 3
270
+ # Force kill if still running
271
+ if kill -0 $APP_PID 2>/dev/null; then
272
+ echo "Force killing app..."
273
+ kill -KILL $APP_PID 2>/dev/null || true
274
+ fi
275
+ echo "✅ App launched and terminated successfully"
276
+ else
277
+ echo "❌ App process failed to start or crashed immediately"
278
+ exit 1
279
+ fi
280
+ echo "Smoke test completed successfully"
281
+
230
282
- name : Upload packages to Kiwix
231
283
if : github.event.inputs.target != 'artefacts'
232
284
run : |
0 commit comments