@@ -18,48 +18,66 @@ jobs:
1818 strategy :
1919 matrix :
2020 # Run all supported Python versions on linux
21- python-version : ["3.8 ", "3.9 ", "3.10 "]
21+ python-version : ["3.10 ", "3.11 ", "3.12", "3.13 "]
2222 platform : [ubuntu-latest]
23- # Include one windows and macos run
23+ # Include one macos run (Windows skipped due to OpenGL context issues)
2424 include :
2525 - platform : macos-latest
26- python-version : " 3.9"
27- - platform : windows-latest
28- python-version : " 3.9"
26+ python-version : " 3.11"
2927
3028 steps :
29+ # Checkout repository
30+ - uses : actions/checkout@v4
3131 # Setup pyqt libraries
3232 - uses : tlambert03/setup-qt-libs@v1
33- # Run tests
34- - uses : UCL/composite-actions/python/tox@v1
33+ # Setup Python
34+ - name : Set up Python ${{ matrix.python-version }}
35+ uses : actions/setup-python@v5
3536 with :
3637 python-version : ${{ matrix.python-version }}
38+ # Install dependencies
39+ - name : Install dependencies
40+ run : |
41+ python -m pip install --upgrade pip
42+ python -m pip install -e .
43+ python -m pip install pytest pytest-cov pytest-qt PySide6
44+ - name : Install xvfb (Linux only)
45+ if : runner.os == 'Linux'
46+ run : python -m pip install pytest-xvfb
47+ # Run tests
48+ - name : Run tests
49+ env :
50+ DISPLAY : " :99.0"
51+ # Disable napari GUI in headless environment
52+ NAPARI_APPLICATION_IPY_INTERACTIVE : false
53+ # Force matplotlib to use non-interactive backend
54+ MPLBACKEND : Agg
55+ run : pytest --cov --cov-report=xml
3756 # Upload code coverage
3857 - name : Coverage
39- uses : codecov/codecov-action@v3
58+ uses : codecov/codecov-action@v4
4059
4160 deploy :
4261 # this will run when you have tagged a commit, starting with "v*"
43- # and requires that you have put your twine API key in your
44- # github secrets (see readme for details)
62+ # uses PyPI's trusted publishing via OIDC (no API key required)
4563 needs : [test]
4664 runs-on : ubuntu-latest
4765 if : contains(github.ref, 'tags')
66+ permissions :
67+ id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
4868 steps :
49- - uses : actions/checkout@v3
69+ - uses : actions/checkout@v4
5070 - name : Set up Python
51- uses : actions/setup-python@v4
71+ uses : actions/setup-python@v5
5272 with :
5373 python-version : " 3.x"
54- - name : Install dependencies
74+ - name : Install build dependencies
5575 run : |
5676 python -m pip install --upgrade pip
57- python -m pip install build twine
58- - name : Build and publish
59- env :
60- TWINE_USERNAME : __token__
61- TWINE_PASSWORD : ${{ secrets.TWINE_API_KEY }}
77+ python -m pip install build
78+ - name : Build package
6279 run : |
6380 git tag
6481 python -m build
65- twine upload dist/*
82+ - name : Publish package to PyPI
83+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments