Skip to content

Commit 02c41eb

Browse files
authored
👷 CI: 添加 codecov junit result report (#3138)
1 parent 06682ee commit 02c41eb

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/workflows/codecov.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,21 @@ jobs:
4848
cd ./envs/${{ matrix.env }}
4949
poetry run bash "../../scripts/run-tests.sh"
5050
51+
- name: Upload test results
52+
uses: codecov/test-results-action@v1
53+
with:
54+
env_vars: OS,PYTHON_VERSION,PYDANTIC_VERSION
55+
files: ./tests/junit.xml
56+
flags: unittests
57+
env:
58+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
59+
5160
- name: Upload coverage report
5261
uses: codecov/codecov-action@v5
5362
with:
5463
env_vars: OS,PYTHON_VERSION,PYDANTIC_VERSION
5564
files: ./tests/coverage.xml
5665
flags: unittests
66+
fail_ci_if_error: true
5767
env:
5868
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

scripts/run-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
cd "$(dirname "$0")/../tests"
55

66
# Run the tests
7-
pytest -n auto --cov-append --cov-report xml $@
7+
pytest -n auto --cov-append --cov-report xml --junitxml=./junit.xml $@

0 commit comments

Comments
 (0)