From 7ef2c258bb18dc157db1082e93da188f097c1c0c Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 10 Feb 2026 14:21:35 +0100 Subject: [PATCH] CI: enable Codecov Test Analytics Enable JUnit XML generation for `native_tests` and `windows_tests` to allow Codecov to process test analytics. Upload the generated `test-results.xml` using `codecov/codecov-action`. The upload step uses `if: !cancelled()` to ensure results are uploaded even if tests fail (to analyze failures), but skipped if the workflow is explicitly cancelled. Originally brought up in PR #8752 by @katia-sentry, but missed the !cancelled() check. Also: upgrade to codecov-action@v5. --- .github/workflows/ci.yml | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 195c9103bf..4eed116c36 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -337,16 +337,29 @@ jobs: #sudo -E bash -c "tox -e py" # Ensure locally built binary in ./dist/binary/borg-dir is found during tests export PATH="$GITHUB_WORKSPACE/dist/binary/borg-dir:$PATH" - tox --skip-missing-interpreters + tox --skip-missing-interpreters -- --junitxml=test-results.xml + + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/codecov-action@v5 + env: + OS: ${{ runner.os }} + python: ${{ matrix.python-version }} + with: + token: ${{ secrets.CODECOV_TOKEN }} + report_type: test_results + env_vars: OS,python + files: test-results.xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 env: OS: ${{ runner.os }} python: ${{ matrix.python-version }} with: token: ${{ secrets.CODECOV_TOKEN }} - env_vars: OS, python + report_type: coverage + env_vars: OS,python vm_tests: permissions: @@ -605,13 +618,26 @@ jobs: export PATH="$GITHUB_WORKSPACE/dist/binary/borg-dir:$PATH" borg.exe -V . env/bin/activate - python -m pytest -n4 --benchmark-skip -vv -rs -k "not remote" + python -m pytest -n4 --benchmark-skip -vv -rs -k "not remote" --junitxml=test-results.xml + + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/codecov-action@v5 + env: + OS: ${{ runner.os }} + python: '3.11' + with: + token: ${{ secrets.CODECOV_TOKEN }} + report_type: test_results + env_vars: OS,python + files: test-results.xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 env: OS: ${{ runner.os }} python: '3.11' with: token: ${{ secrets.CODECOV_TOKEN }} - env_vars: OS, python + report_type: coverage + env_vars: OS,python