Skip to content

Commit 9e90ea0

Browse files
committed
combine parallel coverage reports
1 parent 2d647f9 commit 9e90ea0

File tree

1 file changed

+29
-10
lines changed

1 file changed

+29
-10
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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 --parallel-mode --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 --parallel-mode --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,54 @@ 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-
uses: orgoro/[email protected]
67+
- uses: actions/upload-artifact@v4
68+
with:
69+
name: coverage-part-{{ matrix.python-version }}-{{ matrix.pydantic-version }}
70+
retention-days: 1
71+
path: .coverage*
72+
coverage:
73+
needs: [test]
74+
if: github.event_name == 'pull_request'
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v4
78+
- uses: actions/setup-python@v6
79+
- run: |
80+
pip install coverage
81+
- uses: actions/download-artifact@v4
82+
with:
83+
pattern: coverage-part-*
84+
path: coverage-parts
85+
- run: |
86+
coverage combine coverage-parts/.coverage*
87+
coverage xml -o coverage.xml
88+
- uses: orgoro/[email protected]
6989
with:
7090
coverageFile: coverage.xml
7191
token: ${{ secrets.GITHUB_TOKEN }}
7292
thresholdAll: 0.7
7393
thresholdNew: 0.9
7494
thresholdModified: 0.6
75-
- if: matrix.is-dev-version
95+
- name: generate coverage badge and html report
7696
run: |
7797
pip install genbadge[coverage]
7898
genbadge coverage --input-file coverage.xml --output-file ./dist/coverage/coverage-badge.svg
7999
coverage html -d dist/coverage
80-
- if: matrix.is-dev-version
81-
uses: actions/upload-artifact@v4
100+
- uses: actions/upload-artifact@v4
82101
with:
83-
name: coverage
102+
name: coverage-summary
84103
retention-days: 1
85104
path: dist
86105

87106

88107
deploy:
89-
needs: [test]
108+
needs: [test,coverage]
90109
runs-on: ubuntu-latest
91110
steps:
92111
- uses: actions/checkout@v4
93112
- uses: actions/download-artifact@v4
94113
with:
95-
name: coverage
114+
name: coverage-summary
96115
path: dist
97116
- uses: actions/setup-python@v6
98117
with:

0 commit comments

Comments
 (0)