Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
d89d2fa
Add smoke tests, improve Windows startup, and expand test coverage
filippostanghellini Dec 15, 2025
c77d662
Bump version to 1.1.2 and update import order in tests
filippostanghellini Dec 15, 2025
cdd00f5
Refactor test client.post calls to single-line format
filippostanghellini Dec 15, 2025
63ab5b1
Update version check in test_imports.py to 1.1.2
filippostanghellini Dec 15, 2025
ce55351
Skip POSIX-only test on Windows in test_web_app.py
filippostanghellini Dec 15, 2025
be93c51
Set window icon only on Windows in GUI
filippostanghellini Dec 15, 2025
fbef082
Optimize CI workflow for Linux runners
filippostanghellini Dec 15, 2025
c0219b7
Add GTK/gi dependencies for pywebview on Linux
filippostanghellini Dec 15, 2025
892df8a
Update desktop build dependencies and install commands
filippostanghellini Dec 15, 2025
1fee0a4
Remove duplicate libgirepository dev package from build
filippostanghellini Dec 15, 2025
59d1c59
Fix PyGObject setup for Ubuntu 22.04 in CI workflow
filippostanghellini Dec 15, 2025
dc523ec
Update Linux build to Ubuntu 24.04 and Python 3.12
filippostanghellini Dec 15, 2025
bdcc37e
Fix typo in build dependencies for desktop workflow
filippostanghellini Dec 15, 2025
4a46b48
Update desktop build to use system PyGObject
filippostanghellini Dec 15, 2025
2e16796
Remove redundant PyGObject import check in CI
filippostanghellini Dec 15, 2025
ccb6658
Simplify Linux smoke test to verify AppImage structure
filippostanghellini Dec 15, 2025
49c19d7
Set APPIMAGE_EXTRACT_AND_RUN for AppImage build
filippostanghellini Dec 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
192 changes: 182 additions & 10 deletions .github/workflows/build-desktop.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
name: Build Desktop Apps

on:
# Test builds on push to main and PRs
push:
branches: [main]
paths:
- 'src/**'
- 'DocFinder.spec'
- '.github/workflows/build-desktop.yml'
- 'pyproject.toml'
pull_request:
branches: [main]
paths:
- 'src/**'
- 'DocFinder.spec'
- '.github/workflows/build-desktop.yml'
- 'pyproject.toml'
# Publish assets only on release
release:
types: [published]
# Manual trigger
workflow_dispatch:
inputs:
version:
Expand Down Expand Up @@ -76,6 +93,60 @@ jobs:
hdiutil create -volname "DocFinder" -srcfolder "dist/DocFinder.app" -ov -format UDZO "dist/DocFinder-macOS.dmg"
fi

- name: Smoke test - Verify app starts
run: |
echo "=== Starting smoke test for macOS ==="

# Start the app in background
dist/DocFinder.app/Contents/MacOS/DocFinder &
APP_PID=$!

# Wait for app to initialize (max 60 seconds)
echo "Waiting for app to initialize..."
for i in {1..60}; do
# Check if process is still running
if ! kill -0 $APP_PID 2>/dev/null; then
echo "ERROR: App crashed during startup!"
# Check log file
LOG_FILE="$HOME/Library/Logs/DocFinder/docfinder.log"
if [ -f "$LOG_FILE" ]; then
echo "=== Log file contents ==="
cat "$LOG_FILE"
fi
exit 1
fi
sleep 1
done

# Give the app a few more seconds to fully initialize
sleep 5

# Check if process is still running
if kill -0 $APP_PID 2>/dev/null; then
echo "SUCCESS: App is running (PID: $APP_PID)"

# Check log file for any errors
LOG_FILE="$HOME/Library/Logs/DocFinder/docfinder.log"
if [ -f "$LOG_FILE" ]; then
echo "=== Log file contents ==="
cat "$LOG_FILE"
fi

# Gracefully terminate
kill $APP_PID 2>/dev/null || true
sleep 2
kill -9 $APP_PID 2>/dev/null || true
echo "App terminated successfully"
else
echo "ERROR: App is not running!"
LOG_FILE="$HOME/Library/Logs/DocFinder/docfinder.log"
if [ -f "$LOG_FILE" ]; then
echo "=== Log file contents ==="
cat "$LOG_FILE"
fi
exit 1
fi

- name: Upload macOS DMG
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -167,6 +238,70 @@ jobs:
$env:PATH = "C:\Program Files (x86)\NSIS;$env:PATH"
makensis installer.nsi

- name: Smoke test - Verify app starts
shell: pwsh
run: |
Write-Host "=== Starting smoke test for Windows ==="

# Start the app in background
$process = Start-Process -FilePath "dist\DocFinder\DocFinder.exe" -PassThru
Write-Host "Started app with PID: $($process.Id)"

# Wait for app to initialize (max 60 seconds)
Write-Host "Waiting for app to initialize..."
$timeout = 60
$elapsed = 0

while ($elapsed -lt $timeout) {
Start-Sleep -Seconds 1
$elapsed++

# Check if process exited
if ($process.HasExited) {
Write-Host "ERROR: App exited with code: $($process.ExitCode)"

# Check log file
$logFile = "$env:LOCALAPPDATA\DocFinder\logs\docfinder.log"
if (Test-Path $logFile) {
Write-Host "=== Log file contents ==="
Get-Content $logFile
}
exit 1
}

if ($elapsed % 10 -eq 0) {
Write-Host "Still waiting... ($elapsed seconds)"
}
}

# Give extra time for full initialization
Start-Sleep -Seconds 5

# Final check
if (-not $process.HasExited) {
Write-Host "SUCCESS: App is running after $elapsed seconds"

# Check log file
$logFile = "$env:LOCALAPPDATA\DocFinder\logs\docfinder.log"
if (Test-Path $logFile) {
Write-Host "=== Log file contents ==="
Get-Content $logFile
}

# Terminate the app
Write-Host "Terminating app..."
Stop-Process -Id $process.Id -Force -ErrorAction SilentlyContinue
Write-Host "App terminated successfully"
} else {
Write-Host "ERROR: App crashed during smoke test!"
$logFile = "$env:LOCALAPPDATA\DocFinder\logs\docfinder.log"
if (Test-Path $logFile) {
Write-Host "=== Log file contents ==="
Get-Content $logFile
}
exit 1
}

- name: Upload Windows installer
uses: actions/upload-artifact@v4
with:
Expand All @@ -175,7 +310,7 @@ jobs:

build-linux:
name: Build Linux App
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Free disk space
run: |
Expand All @@ -198,24 +333,32 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-0 \
libwebkit2gtk-4.0-37 \
libgirepository1.0-dev \
gir1.2-webkit2-4.0 \
fuse \
libfuse2
libgtk-3-dev \
libwebkit2gtk-4.1-dev \
libgirepository-1.0-dev \
python3-gi \
python3-gi-cairo \
gir1.2-gtk-3.0 \
gir1.2-webkit2-4.1 \
gobject-introspection \
libcairo2-dev \
pkg-config \
fuse3 \
libfuse3-3 \
xvfb

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
# Install CPU-only PyTorch (smaller, no CUDA libraries)
pip install torch --index-url https://download.pytorch.org/whl/cpu
# Use system-provided PyGObject (no pip build needed)
pip install '.[dev,gui]'
pip cache purge

Expand Down Expand Up @@ -267,8 +410,37 @@ jobs:
DESKTOP
cp dist/DocFinder.AppDir/docfinder.desktop dist/DocFinder.AppDir/usr/share/applications/

# Build AppImage
ARCH=x86_64 ./appimagetool-x86_64.AppImage dist/DocFinder.AppDir dist/DocFinder-Linux-x86_64.AppImage
# Build AppImage (use APPIMAGE_EXTRACT_AND_RUN to avoid FUSE requirement)
ARCH=x86_64 APPIMAGE_EXTRACT_AND_RUN=1 ./appimagetool-x86_64.AppImage dist/DocFinder.AppDir dist/DocFinder-Linux-x86_64.AppImage

- name: Smoke test - Verify app structure
run: |
echo "=== Verifying AppImage structure ==="

# Verify AppImage exists
if [ ! -f dist/DocFinder-Linux-x86_64.AppImage ]; then
echo "ERROR: AppImage not found!"
exit 1
fi

chmod +x dist/DocFinder-Linux-x86_64.AppImage
echo "AppImage created successfully"

# Extract AppImage to verify contents
./dist/DocFinder-Linux-x86_64.AppImage --appimage-extract > /dev/null 2>&1 || true

# Verify essential files exist
if [ -f "squashfs-root/usr/bin/DocFinder" ]; then
echo "SUCCESS: DocFinder binary found in AppImage"
file squashfs-root/usr/bin/DocFinder
else
echo "ERROR: DocFinder binary not found in AppImage!"
ls -la squashfs-root/usr/bin/ || true
exit 1
fi

# Cleanup extracted files
rm -rf squashfs-root

- name: Upload Linux AppImage
uses: actions/upload-artifact@v4
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ jobs:
python-version: ["3.10", "3.11", "3.12"]

steps:
- name: Free disk space (Linux)
if: runner.os == 'Linux'
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo apt-get clean

- uses: actions/checkout@v5

- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -71,7 +80,15 @@ jobs:
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-

- name: Install dependencies
- name: Install dependencies (Linux - CPU only PyTorch)
if: runner.os == 'Linux'
run: |
python -m pip install --upgrade pip
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -e ".[dev,web]"

- name: Install dependencies (non-Linux)
if: runner.os != 'Linux'
run: |
python -m pip install --upgrade pip
pip install -e ".[dev,web]"
Expand Down
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.1.2] - 2025-12-15

### Fixed
- **Windows: Fixed silent crash on startup** - Application would terminate immediately without any visible window
- Added `multiprocessing.freeze_support()` required for PyInstaller-bundled apps on Windows
- Added `torch.cuda` hidden imports to PyInstaller spec for proper bundling
- Added persistent file logging to `%LOCALAPPDATA%\DocFinder\logs\docfinder.log` for debugging
- Added native Windows error dialog on startup failures to inform users of issues
- Improved startup logging with platform and Python version information
- **UI: Fixed Search button jumping on hover** - Button no longer moves when hovered

### Added
- **CI: Smoke tests for all platforms** - Automated verification that bundled apps start correctly
- macOS: Tests `.app` bundle launches and stays running
- Windows: Tests `.exe` launches and stays running
- Linux: Tests AppImage launches with virtual display (Xvfb)
- All tests verify log file creation and check for startup errors

### Changed
- Improved multiprocessing handling for PyInstaller frozen apps with early child process detection

## [1.1.1] - 2025-12-12

### Added
Expand Down Expand Up @@ -131,7 +152,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed linting issues for consistent code style
- Updated ruff configuration to use non-deprecated settings

[Unreleased]: https://github.com/filippostanghellini/DocFinder/compare/v1.0.1...HEAD
[Unreleased]: https://github.com/filippostanghellini/DocFinder/compare/v1.1.2...HEAD
[1.1.2]: https://github.com/filippostanghellini/DocFinder/compare/v1.1.1...v1.1.2
[1.1.1]: https://github.com/filippostanghellini/DocFinder/compare/v1.0.1...v1.1.1
[1.0.1]: https://github.com/filippostanghellini/DocFinder/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/filippostanghellini/DocFinder/compare/v0.2.0...v1.0.0
[0.2.0]: https://github.com/filippostanghellini/DocFinder/compare/v0.1.0...v0.2.0
Expand Down
Loading
Loading