@@ -22,35 +22,49 @@ jobs:
2222 jupyter : true
2323 version : " 24.3"
2424
25- test-spec-conda :
25+ test :
2626 runs-on : ubuntu-latest
2727 strategy :
2828 matrix :
2929 include :
3030 - python-version : ' 3.8'
3131 conda-env : py38
32+ spec : conda
33+ - python-version : ' 3.8'
34+ conda-env : py38
35+ spec : main
3236 - python-version : ' 3.9'
3337 conda-env : wo-python
38+ spec : conda
3439 - python-version : ' 3.9'
3540 conda-env : tf
41+ spec : main
3642 - python-version : ' 3.10'
3743 conda-env : wo-python
44+ spec : conda
3845 - python-version : ' 3.11'
3946 conda-env : full
47+ spec : main
4048 run-expensive-tests : true
49+ report-coverage : true
4150 - python-version : ' 3.12'
4251 conda-env : wo-python
52+ spec : conda
53+ - python-version : ' 3.12'
54+ conda-env : tf
55+ spec : conda
4356 - python-version : ' 3.13'
4457 conda-env : wo-python
58+ spec : main
4559 steps :
60+ - uses : actions/checkout@v4
4661 - id : setup
4762 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
5065 echo "env-file=dev/env-${{ matrix.conda-env }}.yaml"
5166 echo "env-file=dev/env-${{ matrix.conda-env }}.yaml" >> $GITHUB_OUTPUT
5267 [ ! -f dev/env-${{ matrix.conda-env }}.yaml ] && exit 1
53- - uses : actions/checkout@v4
5468 - uses : conda-incubator/setup-miniconda@v3
5569 with :
5670 auto-update-conda : true
@@ -78,102 +92,39 @@ jobs:
7892 CACHE_NUMBER : 0
7993 id : cache
8094 - 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}}
8296 if : steps.cache.outputs.cache-hit != 'true'
97+ - run : |
98+ pyright --version
99+ pyright
83100 - uses : actions/cache@v4
84101 with :
85102 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
88105 run : pytest --disable-pytest-warnings
89106 env :
90107 BIOIMAGEIO_CACHE_PATH : bioimageio_cache
91108 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
174125
175126 conda-build :
176- needs : test-spec-conda
127+ needs : test
177128 runs-on : ubuntu-latest
178129 steps :
179130 - uses : actions/checkout@v4
@@ -202,7 +153,7 @@ jobs:
202153 conda-build -c conda-forge conda-recipe --no-test --output-folder ./pkgs
203154
204155 docs :
205- needs : [ test-spec-main]
156+ needs : test
206157 if : github.ref == 'refs/heads/main'
207158 runs-on : ubuntu-latest
208159 steps :
0 commit comments