From 02c41eb97a48319b53d3c3266f6baad0882b2132 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:25:39 +0800 Subject: [PATCH] =?UTF-8?q?:construction=5Fworker:=20CI:=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20codecov=20junit=20result=20report=20(#3138)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codecov.yml | 10 ++++++++++ scripts/run-tests.sh | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index f28863d7..c3990c39 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -48,11 +48,21 @@ jobs: cd ./envs/${{ matrix.env }} poetry run bash "../../scripts/run-tests.sh" + - name: Upload test results + uses: codecov/test-results-action@v1 + with: + env_vars: OS,PYTHON_VERSION,PYDANTIC_VERSION + files: ./tests/junit.xml + flags: unittests + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - name: Upload coverage report uses: codecov/codecov-action@v5 with: env_vars: OS,PYTHON_VERSION,PYDANTIC_VERSION files: ./tests/coverage.xml flags: unittests + fail_ci_if_error: true env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh index 00272302..2284bdd6 100755 --- a/scripts/run-tests.sh +++ b/scripts/run-tests.sh @@ -4,4 +4,4 @@ cd "$(dirname "$0")/../tests" # Run the tests -pytest -n auto --cov-append --cov-report xml $@ +pytest -n auto --cov-append --cov-report xml --junitxml=./junit.xml $@