Merge pull request #430 from quantumjot/fix-is-unique-boolean-bug #627
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| paths-ignore: | |
| - '**.md' | |
| - '**.rst' | |
| jobs: | |
| cross-compile-windows: | |
| name: Cross-compile Windows libraries | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Build Windows libraries | |
| uses: ./.github/actions/build-btrack | |
| with: | |
| cross-compile-windows: true | |
| upload-artifacts: true | |
| - name: Verify Windows libraries | |
| run: | | |
| echo "Windows libraries built:" | |
| ls -la btrack/libs/ | |
| # Check for DLL files (case insensitive) | |
| dll_count=$(find btrack/libs/ -type f \( -iname '*.dll' \) | wc -l) | |
| if [ "$dll_count" -eq 0 ]; then | |
| echo "ERROR: No Windows DLL files found!" | |
| exit 1 | |
| fi | |
| echo "✓ Found $dll_count Windows DLL file(s)" | |
| test-unix: | |
| name: Test ${{ matrix.os }} - Python ${{ matrix.python-version }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| cache-dependency-path: 'pyproject.toml' | |
| - name: Build btrack libraries | |
| uses: ./.github/actions/build-btrack | |
| with: | |
| upload-artifacts: false | |
| - name: Setup Qt Libs (Linux) | |
| if: runner.os == 'Linux' | |
| uses: tlambert03/setup-qt-libs@v1 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e ".[dev]" | |
| # Install napari and testing dependencies | |
| python -m pip install napari pyqt5 pytest-cov pytest-qt | |
| # Linux-specific dependencies | |
| if [ "${{ runner.os }}" = "Linux" ]; then | |
| python -m pip install pytest-xvfb | |
| fi | |
| - name: Run tests | |
| run: pytest --cov --cov-report=xml | |
| env: | |
| CI: true | |
| GITHUB_ACTIONS: true | |
| # Windows-only: Force Qt to render windows offscreen to avoid OpenGL context issues | |
| QT_QPA_PLATFORM: ${{ runner.os == 'Windows' && 'offscreen' || '' }} | |
| # Force software rendering to avoid OpenGL context issues | |
| QT_OPENGL: software | |
| # Disable napari GUI in headless environment | |
| NAPARI_APPLICATION_IPY_INTERACTIVE: false | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v4 | |
| test-windows: | |
| name: Test Windows - Python ${{ matrix.python-version }} | |
| runs-on: windows-latest | |
| needs: cross-compile-windows # Only run if cross-compilation succeeds | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| cache-dependency-path: 'pyproject.toml' | |
| - name: Download Windows libraries | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: libs-windows-cross | |
| path: btrack/libs | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e ".[dev]" | |
| python -m pip install napari pyqt5 pytest-cov pytest-qt | |
| - name: Run tests | |
| run: pytest --cov --cov-report=xml | |
| env: | |
| CI: true | |
| GITHUB_ACTIONS: true | |
| # Windows-only: Force Qt to render windows offscreen to avoid OpenGL context issues | |
| QT_QPA_PLATFORM: ${{ runner.os == 'Windows' && 'offscreen' || '' }} | |
| # Force software rendering to avoid OpenGL context issues | |
| QT_OPENGL: software | |
| # Disable napari GUI in headless environment | |
| NAPARI_APPLICATION_IPY_INTERACTIVE: false | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v4 |