mirror of
https://github.com/borgbackup/borg.git
synced 2026-04-21 22:29:54 -04:00
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.
This commit is contained in:
parent
d680ee0feb
commit
7ef2c258bb
1 changed files with 34 additions and 8 deletions
42
.github/workflows/ci.yml
vendored
42
.github/workflows/ci.yml
vendored
|
|
@ -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 coverage to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
- 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 }}
|
||||
env_vars: OS, python
|
||||
report_type: test_results
|
||||
env_vars: OS,python
|
||||
files: test-results.xml
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v5
|
||||
env:
|
||||
OS: ${{ runner.os }}
|
||||
python: ${{ matrix.python-version }}
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
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 coverage to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
- 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 }}
|
||||
env_vars: OS, python
|
||||
report_type: test_results
|
||||
env_vars: OS,python
|
||||
files: test-results.xml
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v5
|
||||
env:
|
||||
OS: ${{ runner.os }}
|
||||
python: '3.11'
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
report_type: coverage
|
||||
env_vars: OS,python
|
||||
|
|
|
|||
Loading…
Reference in a new issue