@@ -2,9 +2,9 @@ name: Test and Deploy bioimageio.core
22
33on :
44 push :
5- branches : [ main ]
5+ branches : [main]
66 pull_request :
7- branches : [ "**" ]
7+ branches : ['**' ]
88
99defaults :
1010 run :
@@ -58,81 +58,69 @@ jobs:
5858 matrix :
5959 include :
6060 - python-version : ' 3.9'
61- conda-env : dev
62- spec : conda
6361 numpy-version : 1
6462 - python-version : ' 3.9'
65- conda-env : dev
66- spec : main
6763 numpy-version : 2
6864 - python-version : ' 3.10'
69- conda-env : full
7065 run-expensive-tests : true
7166 report-coverage : true
7267 save-cache : true
73- spec : conda
7468 numpy-version : 1
7569 - python-version : ' 3.11'
76- conda-env : dev
77- spec : main
7870 numpy-version : 2
7971 - python-version : ' 3.12'
80- conda-env : dev
81- spec : conda
8272 numpy-version : 1
8373 # - python-version: '3.13'
84- # conda-env: '313'
85- # spec: main
8674 # numpy-version: 2
8775
8876 steps :
89- - uses : actions/checkout@v4
90- - uses : actions/setup-python@v6
91- with :
92- python-version : ${{matrix.python-version}}
93- cache : ' pip'
94- - name : Install dependencies
95- run : |
96- pip install --upgrade pip
97- pip install -e .[dev] numpy==${{matrix.numpy-version}}.*
98- - name : Pyright
99- if : matrix.run-expensive-tests
100- run : |
101- pyright --version
102- pyright -p pyproject.toml --pythonversion ${{ matrix.python-version }}
103- - name : Restore bioimageio cache ${{needs.populate-cache.outputs.cache-key}}
104- uses : actions/cache/restore@v4
105- with :
106- path : bioimageio_cache
107- key : ${{needs.populate-cache.outputs.cache-key}}
108- - name : pytest
109- run : pytest --cov bioimageio --cov-report xml --cov-append --capture no --disable-pytest-warnings
110- env :
111- BIOIMAGEIO_CACHE_PATH : bioimageio_cache
112- RUN_EXPENSIVE_TESTS : ${{ matrix.run-expensive-tests && 'true' || 'false' }}
113- - name : Save bioimageio cache ${{needs.populate-cache.outputs.cache-key}}
114- if : matrix.save-cache
115- uses : actions/cache/save@v4
116- with :
117- path : bioimageio_cache
118- key : ${{needs.populate-cache.outputs.cache-key}}
77+ - uses : actions/checkout@v4
78+ - uses : actions/setup-python@v6
79+ with :
80+ python-version : ${{matrix.python-version}}
81+ cache : ' pip'
82+ - name : Install dependencies
83+ run : |
84+ pip install --upgrade pip
85+ pip install -e .[dev] numpy==${{matrix.numpy-version}}.*
86+ - name : Pyright
87+ if : matrix.run-expensive-tests # pyright is not expensive, but we only want to run it once due to otherwise inconsistent typing
88+ run : |
89+ pyright --version
90+ pyright -p pyproject.toml --pythonversion ${{ matrix.python-version }}
91+ - name : Restore bioimageio cache ${{needs.populate-cache.outputs.cache-key}}
92+ uses : actions/cache/restore@v4
93+ with :
94+ path : bioimageio_cache
95+ key : ${{needs.populate-cache.outputs.cache-key}}
96+ - name : pytest
97+ run : pytest --cov bioimageio --cov-report xml --cov-append --capture no --disable-pytest-warnings
98+ env :
99+ BIOIMAGEIO_CACHE_PATH : bioimageio_cache
100+ RUN_EXPENSIVE_TESTS : ${{ matrix.run-expensive-tests && 'true' || 'false' }}
101+ - name : Save bioimageio cache ${{needs.populate-cache.outputs.cache-key}}
102+ if : matrix.save-cache
103+ uses : actions/cache/save@v4
104+ with :
105+ path : bioimageio_cache
106+ key : ${{needs.populate-cache.outputs.cache-key}}
119107
120- - if : matrix.report-coverage && github.event_name == 'pull_request'
121- 122- with :
123- coverageFile : coverage.xml
124- token : ${{secrets.GITHUB_TOKEN}}
125- - if : matrix.report-coverage && github.ref == 'refs/heads/main'
126- run : |
127- pip install genbadge[coverage]
128- genbadge coverage --input-file coverage.xml --output-file ./dist/coverage/coverage-badge.svg
129- coverage html -d dist/coverage
130- - if : matrix.report-coverage && github.ref == 'refs/heads/main'
131- uses : actions/upload-artifact@v4
132- with :
133- name : coverage
134- retention-days : 1
135- path : dist
108+ - if : matrix.report-coverage && github.event_name == 'pull_request'
109+ 110+ with :
111+ coverageFile : coverage.xml
112+ token : ${{secrets.GITHUB_TOKEN}}
113+ - if : matrix.report-coverage && github.ref == 'refs/heads/main'
114+ run : |
115+ pip install genbadge[coverage]
116+ genbadge coverage --input-file coverage.xml --output-file ./dist/coverage/coverage-badge.svg
117+ coverage html -d dist/coverage
118+ - if : matrix.report-coverage && github.ref == 'refs/heads/main'
119+ uses : actions/upload-artifact@v4
120+ with :
121+ name : coverage
122+ retention-days : 1
123+ path : dist
136124
137125 conda-build :
138126 needs : test
@@ -145,7 +133,7 @@ jobs:
145133 with :
146134 auto-update-conda : true
147135 auto-activate-base : true
148- activate-environment : " "
136+ activate-environment : ' '
149137 channel-priority : strict
150138 miniforge-version : latest
151139 conda-solver : libmamba
@@ -242,14 +230,14 @@ jobs:
242230 uses : pypa/gh-action-pypi-publish@release/v1.12
243231 with :
244232 user : __token__
245- password : " ${{ secrets.PYPI_TOKEN }}"
233+ password : ' ${{ secrets.PYPI_TOKEN }}'
246234 packages-dir : dist/
247235 verbose : true
248236 - name : Publish the release notes
249237 if : github.ref == 'refs/heads/main'
250238 uses :
release-drafter/[email protected] 251239 with :
252240 publish : " ${{ steps.tag-version.outputs.new_tag != '' }}"
253- tag : " ${{ steps.tag-version.outputs.new_tag }}"
241+ tag : ' ${{ steps.tag-version.outputs.new_tag }}'
254242 env :
255- GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
243+ GITHUB_TOKEN : ' ${{ secrets.GITHUB_TOKEN }}'
0 commit comments