@@ -2,9 +2,9 @@ name: Test and Deploy bioimageio.core
2
2
3
3
on :
4
4
push :
5
- branches : [ main ]
5
+ branches : [main]
6
6
pull_request :
7
- branches : [ "**" ]
7
+ branches : ['**' ]
8
8
9
9
defaults :
10
10
run :
@@ -58,81 +58,69 @@ jobs:
58
58
matrix :
59
59
include :
60
60
- python-version : ' 3.9'
61
- conda-env : dev
62
- spec : conda
63
61
numpy-version : 1
64
62
- python-version : ' 3.9'
65
- conda-env : dev
66
- spec : main
67
63
numpy-version : 2
68
64
- python-version : ' 3.10'
69
- conda-env : full
70
65
run-expensive-tests : true
71
66
report-coverage : true
72
67
save-cache : true
73
- spec : conda
74
68
numpy-version : 1
75
69
- python-version : ' 3.11'
76
- conda-env : dev
77
- spec : main
78
70
numpy-version : 2
79
71
- python-version : ' 3.12'
80
- conda-env : dev
81
- spec : conda
82
72
numpy-version : 1
83
73
# - python-version: '3.13'
84
- # conda-env: '313'
85
- # spec: main
86
74
# numpy-version: 2
87
75
88
76
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}}
119
107
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
136
124
137
125
conda-build :
138
126
needs : test
@@ -145,7 +133,7 @@ jobs:
145
133
with :
146
134
auto-update-conda : true
147
135
auto-activate-base : true
148
- activate-environment : " "
136
+ activate-environment : ' '
149
137
channel-priority : strict
150
138
miniforge-version : latest
151
139
conda-solver : libmamba
@@ -242,14 +230,14 @@ jobs:
242
230
uses : pypa/gh-action-pypi-publish@release/v1.12
243
231
with :
244
232
user : __token__
245
- password : " ${{ secrets.PYPI_TOKEN }}"
233
+ password : ' ${{ secrets.PYPI_TOKEN }}'
246
234
packages-dir : dist/
247
235
verbose : true
248
236
- name : Publish the release notes
249
237
if : github.ref == 'refs/heads/main'
250
238
uses :
release-drafter/[email protected]
251
239
with :
252
240
publish : " ${{ steps.tag-version.outputs.new_tag != '' }}"
253
- tag : " ${{ steps.tag-version.outputs.new_tag }}"
241
+ tag : ' ${{ steps.tag-version.outputs.new_tag }}'
254
242
env :
255
- GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
243
+ GITHUB_TOKEN : ' ${{ secrets.GITHUB_TOKEN }}'
0 commit comments