Tests #14
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: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: System deps for Qt/OpenGL (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libgl1 libegl1 libopengl0 \ | |
| libglib2.0-0 libxkbcommon0 libxi6 libxtst6 \ | |
| libxcb1 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 \ | |
| libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 | |
| - run: python -m pip install -U pip | |
| - run: python -m pip install -e .[testing] | |
| - name: Run tests with Qt backend | |
| env: | |
| QT_QPA_PLATFORM: offscreen | |
| MPLBACKEND: Agg | |
| run: pytest tests/ -v --cov=napari_flowreg | |
| - name: Verify napari plugin registration (Windows — entry point only) | |
| if: ${{ matrix.os == 'windows-latest' }} | |
| run: | | |
| python - <<'PY' | |
| import importlib.metadata as md | |
| eps = md.entry_points() | |
| try: | |
| sel = eps.select(group='napari.manifest') | |
| except AttributeError: | |
| sel = [e for e in eps if getattr(e, 'group', '') == 'napari.manifest'] | |
| assert any((getattr(e, 'name', '') == 'napari-flowreg') or | |
| ('napari_flowreg' in str(e)) for e in sel), 'napari-flowreg entry point missing' | |
| print('Entry point OK') | |
| PY | |
| - name: Verify napari plugin import (non-Windows) | |
| if: ${{ matrix.os != 'windows-latest' }} | |
| run: python -c "import napari_flowreg; print('napari-flowreg plugin loaded successfully')" |