@@ -13,10 +13,10 @@ jobs:
1313 fail-fast : false
1414 matrix :
1515 python-version : ["3.9", "3.10", "3.11","3.12", "3.13"]
16- pydantic-version : ["2.10.3 ", "2.11.0 "]
16+ pydantic-version : ["2.10.6 ", "2.11.9 "]
1717 include :
18- - python-version : " 3.12 "
19- pydantic-version : " 2.11.0 "
18+ - python-version : " 3.10 "
19+ pydantic-version : " 2.11.9 "
2020 is-dev-version : true
2121 run-expensive-tests : true
2222 steps :
@@ -50,11 +50,11 @@ jobs:
5050 run : |
5151 pyright --version
5252 pyright -p pyproject.toml --pythonversion ${{ matrix.python-version }}
53- - run : pytest --cov bioimageio --cov-report xml --cov- append --capture no
53+ - run : pytest --cov bioimageio --cov-append --capture no
5454 env :
5555 BIOIMAGEIO_CACHE_PATH : bioimageio_cache
5656 RUN_EXPENSIVE_TESTS : ${{ matrix.run-expensive-tests && 'true' || 'false' }}
57- - run : pytest --cov bioimageio --cov-report xml --cov- append --capture no scripts # also test docstrings in scripts for dev-version
57+ - run : pytest --cov bioimageio --cov-append --capture no scripts # also test docstrings in scripts for dev-version
5858 if : ${{matrix.is-dev-version}}
5959 env :
6060 BIOIMAGEIO_CACHE_PATH : bioimageio_cache
@@ -64,35 +64,57 @@ jobs:
6464 with :
6565 path : bioimageio_cache
6666 key : " py${{ matrix.python-version }}-${{ steps.get-date.outputs.date }}"
67- - if : matrix.is-dev-version && github.event_name == 'pull_request'
68- 67+
68+ - run : cp .coverage .coverage.${{ matrix.python-version }}-${{ matrix.pydantic-version }}
69+ - uses : actions/upload-artifact@v4
70+ with :
71+ name : .coverage.${{ matrix.python-version }}-${{ matrix.pydantic-version }}
72+ retention-days : 1
73+ path : .coverage.${{ matrix.python-version }}-${{ matrix.pydantic-version }}
74+ include-hidden-files : true
75+ coverage :
76+ needs : [test]
77+ if : github.event_name == 'pull_request'
78+ runs-on : ubuntu-latest
79+ steps :
80+ - uses : actions/checkout@v4
81+ - uses : actions/setup-python@v6
82+ - run : |
83+ pip install coverage
84+ - uses : actions/download-artifact@v4
85+ with :
86+ pattern : .coverage.*
87+ - run : |
88+ ls -l
89+ coverage combine
90+ coverage xml -o coverage.xml
91+ 6992 with :
7093 coverageFile : coverage.xml
7194 token : ${{ secrets.GITHUB_TOKEN }}
7295 thresholdAll : 0.7
7396 thresholdNew : 0.9
7497 thresholdModified : 0.6
75- - if : matrix.is-dev-version
98+ - name : generate coverage badge and html report
7699 run : |
77100 pip install genbadge[coverage]
78101 genbadge coverage --input-file coverage.xml --output-file ./dist/coverage/coverage-badge.svg
79102 coverage html -d dist/coverage
80- - if : matrix.is-dev-version
81- uses : actions/upload-artifact@v4
103+ - uses : actions/upload-artifact@v4
82104 with :
83- name : coverage
105+ name : coverage-summary
84106 retention-days : 1
85107 path : dist
86108
87109
88110 deploy :
89- needs : [test]
111+ needs : [test,coverage ]
90112 runs-on : ubuntu-latest
91113 steps :
92114 - uses : actions/checkout@v4
93115 - uses : actions/download-artifact@v4
94116 with :
95- name : coverage
117+ name : coverage-summary
96118 path : dist
97119 - uses : actions/setup-python@v6
98120 with :
@@ -108,8 +130,6 @@ jobs:
108130 env :
109131 PYTHONPATH : " ./scripts"
110132 run : python -m interactive_docs
111- - name : Generate JSON schemas
112- run : python scripts/generate_json_schemas.py
113133 - name : Generate JSON schema documentation
114134 run : python scripts/generate_json_schema_documentation.py
115135 - name : Generate developer docs
@@ -155,7 +175,7 @@ jobs:
155175 shell : bash -l {0}
156176 run : |
157177 mkdir -p ./pkgs/noarch
158- conda-build -c conda-forge conda-recipe --no-test -- output-folder ./pkgs
178+ conda-build -c conda-forge conda-recipe --output-folder ./pkgs
159179
160180# rattler-build:
161181# name: Build package
@@ -199,8 +219,7 @@ jobs:
199219 with :
200220 create-tag : false
201221 version-command : |
202- python -c "from pathlib import Path;p = p_src if (p_src:=Path('src/bioimageio/spec/__init__.py')).exists() else Path('bioimageio/spec/__init__.py');print(p.read_text().split('__version__ = \"')[1].split('\"')[0])"
203-
222+ python -c "from pathlib import Path;print(p_version.read_text().split('VERSION = \"')[1].split('\"')[0] if (p_version:=Path('src/bioimageio/spec/_version.py')).exists() else Path('src/bioimageio/spec/__init__.py').read_text().split('__version__ = \"')[1].split('\"')[0])"
204223 - name : Push tag
205224 id : tag-version
206225 if : github.ref == 'refs/heads/main' && steps.check-version.outputs.previous-version != steps.check-version.outputs.current-version
0 commit comments