Skip to content

Commit 4ecc378

Browse files
chore: add Codecov test analytics
1 parent bd28ee9 commit 4ecc378

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

.github/workflows/tests.yml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,12 @@ jobs:
162162
micromamba list
163163
- name: Run tests
164164
run: |
165-
python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --durations=50 $TEST_SUBSET
165+
python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --junitxml=junit.xml -o junit_family=legacy --durations=50 $TEST_SUBSET
166+
- name: Upload test results to Codecov
167+
if: ${{ !cancelled() }} # Run even if tests fail
168+
uses: codecov/test-results-action@v1
169+
with:
170+
token: ${{ secrets.CODECOV_TOKEN }}
166171
- name: Upload coverage to Codecov
167172
uses: codecov/codecov-action@v5
168173
with:
@@ -214,7 +219,12 @@ jobs:
214219
# This job uses a cmd shell, therefore the environment variable syntax is different!
215220
# The ">-" in the next line replaces newlines with spaces (see https://stackoverflow.com/a/66809682).
216221
run: >-
217-
python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --durations=50 %TEST_SUBSET%
222+
python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --junitxml=junit.xml -o junit_family=legacy --durations=50 %TEST_SUBSET%
223+
- name: Upload test results to Codecov
224+
if: ${{ !cancelled() }} # Run even if tests fail
225+
uses: codecov/test-results-action@v1
226+
with:
227+
token: ${{ secrets.CODECOV_TOKEN }}
218228
- name: Upload coverage to Codecov
219229
uses: codecov/codecov-action@v5
220230
with:
@@ -272,7 +282,12 @@ jobs:
272282
micromamba list
273283
- name: Run tests
274284
run: |
275-
python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --durations=50 $TEST_SUBSET
285+
python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --junitxml=junit.xml -o junit_family=legacy --durations=50 $TEST_SUBSET
286+
- name: Upload test results to Codecov
287+
if: ${{ !cancelled() }} # Run even if tests fail
288+
uses: codecov/test-results-action@v1
289+
with:
290+
token: ${{ secrets.CODECOV_TOKEN }}
276291
- name: Upload coverage to Codecov
277292
uses: codecov/codecov-action@v5
278293
with:
@@ -322,7 +337,12 @@ jobs:
322337
micromamba list
323338
- name: Run tests
324339
run: |
325-
python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --durations=50 $TEST_SUBSET
340+
python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --junitxml=junit.xml -o junit_family=legacy --durations=50 $TEST_SUBSET
341+
- name: Upload test results to Codecov
342+
if: ${{ !cancelled() }} # Run even if tests fail
343+
uses: codecov/test-results-action@v1
344+
with:
345+
token: ${{ secrets.CODECOV_TOKEN }}
326346
- name: Upload coverage to Codecov
327347
uses: codecov/codecov-action@v5
328348
with:
@@ -370,7 +390,12 @@ jobs:
370390
# This job uses a cmd shell, therefore the environment variable syntax is different!
371391
# The ">-" in the next line replaces newlines with spaces (see https://stackoverflow.com/a/66809682).
372392
run: >-
373-
python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --durations=50 %TEST_SUBSET%
393+
python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --junitxml=junit.xml -o junit_family=legacy --durations=50 %TEST_SUBSET%
394+
- name: Upload test results to Codecov
395+
if: ${{ !cancelled() }} # Run even if tests fail
396+
uses: codecov/test-results-action@v1
397+
with:
398+
token: ${{ secrets.CODECOV_TOKEN }}
374399
- name: Upload coverage to Codecov
375400
uses: codecov/codecov-action@v5
376401
with:

0 commit comments

Comments
 (0)