Set up OMERO server test infrastructure for tests #464
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ["v*"] # Push events to matching v*, i.e. v1.0, v20.15.10 | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check-manifest: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - run: pipx run check-manifest | |
| test: | |
| name: ${{ matrix.platform }} ${{ matrix.python-version }} | |
| runs-on: ${{ matrix.platform }} | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: [ubuntu-latest, macos-15-intel, macos-latest, windows-latest] | |
| python-version: ["3.9", "3.10", "3.11", "3.12"] | |
| backend: [PyQt5] | |
| exclude: | |
| - platform: macos-15-intel | |
| python-version: "3.10" | |
| - platform: macos-15-intel | |
| python-version: "3.11" | |
| - platform: macos-latest | |
| python-version: "3.10" | |
| - platform: macos-latest | |
| python-version: "3.11" | |
| - platform: windows-latest | |
| python-version: "3.10" | |
| - platform: windows-latest | |
| python-version: "3.11" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-version: "latest" | |
| python-version: ${{ matrix.python-version }} | |
| - uses: pyvista/setup-headless-display-action@v4 | |
| with: | |
| qt: true | |
| - name: Install dependencies | |
| run: | | |
| conda install omero-py | |
| python -m pip install --upgrade pip | |
| python -m pip install .[test] | |
| python -m pip install ${{ matrix.backend }} | |
| - name: Test (local) | |
| run: pytest ./tests/local --color=yes --cov=napari_omero --cov-report=xml | |
| # - name: Codecov | |
| # uses: codecov/codecov-action@v5 | |
| # env: | |
| # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| # Integration tests against a real, containerized OMERO server. | |
| # Kept as a separate job (single OS + Python) so the server stack is only | |
| # started once, rather than across the full test matrix. | |
| test-server: | |
| name: server tests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-version: "latest" | |
| python-version: "3.12" | |
| # the server test for the browser widget needs a Qt backend + display | |
| - uses: pyvista/setup-headless-display-action@v4 | |
| with: | |
| qt: true | |
| - name: Install dependencies | |
| run: | | |
| conda install omero-py | |
| python -m pip install --upgrade pip | |
| python -m pip install .[test] | |
| python -m pip install PyQt5 | |
| - name: Set up OMERO server | |
| run: | | |
| # omero-test-infra is used only to stand up a server stack (compose up); | |
| # Pinned to latest commit: Dec 2025 | |
| git clone https://github.com/ome/omero-test-infra .omero | |
| git -C .omero checkout c8a0015b0ce72ee0a49e6968af33de10ea00bc77 | |
| # Bind the server/web ports to fixed host ports so the host-side tests | |
| # can reach localhost:4064 / :4080 (compose defaults to random ports). | |
| # see also: https://github.com/ome/omero-test-infra/issues/77 | |
| echo 'OMERO_SERVER_SSL=4064:' >> .omero/.env | |
| echo 'OMERO_WEB_PORT=4080:' >> .omero/.env | |
| .omero/compose up -d | |
| .omero/wait-on-login | |
| - name: Test (server) | |
| run: pytest ./tests/server --color=yes --cov=napari_omero --cov-report=xml | |
| deploy: | |
| # this will run when you have tagged a commit, starting with "v*" | |
| # and requires that you have put your twine API key in your | |
| needs: [test, test-server] | |
| if: success() && startsWith(github.ref, 'refs/tags/') && github.repository == 'ome/napari-omero' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: 🐍 Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.x" | |
| - name: 👷 Build | |
| run: | | |
| python -m pip install build | |
| python -m build | |
| - name: 🚢 Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: './dist/*' |