@@ -22,35 +22,49 @@ jobs:
22
22
jupyter : true
23
23
version : " 24.3"
24
24
25
- test-spec-conda :
25
+ test :
26
26
runs-on : ubuntu-latest
27
27
strategy :
28
28
matrix :
29
29
include :
30
30
- python-version : ' 3.8'
31
31
conda-env : py38
32
+ spec : conda
33
+ - python-version : ' 3.8'
34
+ conda-env : py38
35
+ spec : main
32
36
- python-version : ' 3.9'
33
37
conda-env : wo-python
38
+ spec : conda
34
39
- python-version : ' 3.9'
35
40
conda-env : tf
41
+ spec : main
36
42
- python-version : ' 3.10'
37
43
conda-env : wo-python
44
+ spec : conda
38
45
- python-version : ' 3.11'
39
46
conda-env : full
47
+ spec : main
40
48
run-expensive-tests : true
49
+ report-coverage : true
41
50
- python-version : ' 3.12'
42
51
conda-env : wo-python
52
+ spec : conda
53
+ - python-version : ' 3.12'
54
+ conda-env : tf
55
+ spec : conda
43
56
- python-version : ' 3.13'
44
57
conda-env : wo-python
58
+ spec : main
45
59
steps :
60
+ - uses : actions/checkout@v4
46
61
- id : setup
47
62
run : |
48
- echo "env-name=conda -${{ matrix.conda-env }}-${{ matrix.python-version }}"
49
- echo "env-name=conda -${{ matrix.conda-env }}-${{ matrix.python-version }}" >> $GITHUB_OUTPUT
63
+ echo "env-name=${{ matrix.spec }} -${{ matrix.conda-env }}-${{ matrix.python-version }}"
64
+ echo "env-name=${{ matrix.spec }} -${{ matrix.conda-env }}-${{ matrix.python-version }}" >> $GITHUB_OUTPUT
50
65
echo "env-file=dev/env-${{ matrix.conda-env }}.yaml"
51
66
echo "env-file=dev/env-${{ matrix.conda-env }}.yaml" >> $GITHUB_OUTPUT
52
67
[ ! -f dev/env-${{ matrix.conda-env }}.yaml ] && exit 1
53
- - uses : actions/checkout@v4
54
68
- uses : conda-incubator/setup-miniconda@v3
55
69
with :
56
70
auto-update-conda : true
@@ -78,102 +92,39 @@ jobs:
78
92
CACHE_NUMBER : 0
79
93
id : cache
80
94
- name : Update env
81
- run : conda env update --name=${{steps.setup.outputs.env-name}} --file=${{steps.setup.output .env-file}} python=${{matrix.python-version}}
95
+ run : conda env update --name=${{steps.setup.outputs.env-name}} --file=${{steps.setup.outputs .env-file}} python=${{matrix.python-version}}
82
96
if : steps.cache.outputs.cache-hit != 'true'
97
+ - run : |
98
+ pyright --version
99
+ pyright
83
100
- uses : actions/cache@v4
84
101
with :
85
102
path : bioimageio_cache
86
- key : " test-spec-conda -${{ steps.get-date.outputs.date }}"
87
- - name : pytest-spec-conda
103
+ key : " test-${{matrix. spec}} -${{ steps.get-date.outputs.date }}"
104
+ - name : pytest
88
105
run : pytest --disable-pytest-warnings
89
106
env :
90
107
BIOIMAGEIO_CACHE_PATH : bioimageio_cache
91
108
RUN_EXPENSIVE_TESTS : ${{ matrix.run-expensive-tests && 'true' || 'false' }}
92
-
93
-
94
- test-spec-main :
95
- runs-on : ubuntu-latest
96
- strategy :
97
- matrix :
98
- include :
99
- - python-version : ' 3.8'
100
- conda-env : py3.8
101
- - python-version : ' 3.9'
102
- conda-env : tf
103
- - python-version : ' 3.11'
104
- conda-env : full
105
- report-coverage : true
106
- run-expensive-tests : true
107
- - python-version : ' 3.12'
108
- conda-env : tf
109
-
110
- steps :
111
- - id : setup
112
- run : |
113
- echo "env-name=main-${{ matrix.conda-env }}-${{ matrix.python-version }}"
114
- echo "env-name=main-${{ matrix.conda-env }}-${{ matrix.python-version }}" >> $GITHUB_OUTPUT
115
- - uses : actions/checkout@v4
116
- - uses : conda-incubator/setup-miniconda@v3
117
- with :
118
- auto-update-conda : true
119
- auto-activate-base : true
120
- activate-environment : ${{steps.setup.outputs.env-name}}
121
- channel-priority : strict
122
- miniforge-version : latest
123
- - name : Get Date
124
- id : get-date
125
- run : |
126
- echo "date=$(date +'%Y-week%U')"
127
- echo "date=$(date +'%Y-week%U')" >> $GITHUB_OUTPUT
128
- echo "today=$(date -u '+%Y%m%d')"
129
- echo "today=$(date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
130
- - name : Cache env
131
- uses : actions/cache@v4
132
- with :
133
- path : ${{ env.CONDA }}/envs/${{steps.setup.outputs.env-name}}
134
- key : >-
135
- conda-${{ runner.os }}-${{ runner.arch }}
136
- -${{steps.get-date.outputs.today }}
137
- -${{ hashFiles(matrix.conda-env) }}
138
- -${{env.CACHE_NUMBER }}
139
- env :
140
- CACHE_NUMBER : 0
141
- id : cache
142
- - name : Update env
143
- run : |
144
- conda env update --name=${{steps.setup.outputs.env-name}} --file=dev/env-${{matrix.conda-env}}.yaml python=${{matrix.python-version}}
145
- conda remove --yes --force bioimageio.spec
146
- if : steps.cache.outputs.cache-hit != 'true'
147
- - name : Install spec from main branch
148
- run : pip install --no-deps git+https://github.com/bioimage-io/spec-bioimage-io
149
- - uses : actions/cache@v4
150
- with :
151
- path : bioimageio_cache
152
- key : " test-spec-main-${{ steps.get-date.outputs.date }}"
153
- - name : pytest-spec-main
154
- run : pytest --disable-pytest-warnings
155
- env :
156
- BIOIMAGEIO_CACHE_PATH : bioimageio_cache
157
- RUN_EXPENSIVE_TESTS : ${{ matrix.run-expensive-tests && 'true' || 'false' }}
158
- - if : matrix.report-coverage && github.event_name == 'pull_request'
159
-
160
- with :
161
- coverageFile : coverage.xml
162
- token : ${{ secrets.GITHUB_TOKEN }}
163
- - if : matrix.report-coverage && github.ref == 'refs/heads/main'
164
- run : |
165
- pip install genbadge[coverage]
166
- genbadge coverage --input-file coverage.xml --output-file ./dist/coverage/coverage-badge.svg
167
- coverage html -d dist/coverage
168
- - if : matrix.report-coverage && github.ref == 'refs/heads/main'
169
- uses : actions/upload-artifact@v4
170
- with :
171
- name : coverage
172
- retention-days : 1
173
- path : dist
109
+ - if : matrix.report-coverage && github.event_name == 'pull_request'
110
+
111
+ with :
112
+ coverageFile : coverage.xml
113
+ token : ${{ secrets.GITHUB_TOKEN }}
114
+ - if : matrix.report-coverage && github.ref == 'refs/heads/main'
115
+ run : |
116
+ pip install genbadge[coverage]
117
+ genbadge coverage --input-file coverage.xml --output-file ./dist/coverage/coverage-badge.svg
118
+ coverage html -d dist/coverage
119
+ - if : matrix.report-coverage && github.ref == 'refs/heads/main'
120
+ uses : actions/upload-artifact@v4
121
+ with :
122
+ name : coverage
123
+ retention-days : 1
124
+ path : dist
174
125
175
126
conda-build :
176
- needs : test-spec-conda
127
+ needs : test
177
128
runs-on : ubuntu-latest
178
129
steps :
179
130
- uses : actions/checkout@v4
@@ -202,7 +153,7 @@ jobs:
202
153
conda-build -c conda-forge conda-recipe --no-test --output-folder ./pkgs
203
154
204
155
docs :
205
- needs : [ test-spec-main]
156
+ needs : test
206
157
if : github.ref == 'refs/heads/main'
207
158
runs-on : ubuntu-latest
208
159
steps :
0 commit comments