ci: combine coverage reports

Based on https://hynek.me/articles/ditch-codecov-python/
This commit is contained in:
Enno Hermann 2024-03-11 11:24:23 +01:00
parent b4fded67d4
commit 31a9201639
4 changed files with 44 additions and 13 deletions

View File

@ -7,7 +7,7 @@ on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
test:
vocoder-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
@ -40,3 +40,30 @@ jobs:
python3 setup.py egg_info
- name: Unit tests
run: make test_vocoder
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: coverage-data-${{ github.job }}-${{ matrix.python-version }}
path: .coverage.*
if-no-files-found: ignore
coverage:
if: always()
needs: vocoder-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/download-artifact@v4
with:
pattern: coverage-data-*
merge-multiple: true
- name: Combine coverage
run: |
python -Im pip install --upgrade coverage[toml]
python -Im coverage combine
python -Im coverage html --skip-covered --skip-empty
python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY

View File

@ -11,38 +11,38 @@ test_all: ## run tests and don't stop on an error.
./run_bash_tests.sh
test: ## run tests.
nose2 -F -v -B --with-coverage --coverage TTS tests
coverage run -m nose2 -F -v -B tests
test_vocoder: ## run vocoder tests.
nose2 -F -v -B --with-coverage --coverage TTS tests.vocoder_tests
coverage run -m nose2 -F -v -B tests.vocoder_tests
test_tts: ## run tts tests.
nose2 -F -v -B --with-coverage --coverage TTS tests.tts_tests
coverage run -m nose2 -F -v -B tests.tts_tests
test_tts2: ## run tts tests.
nose2 -F -v -B --with-coverage --coverage TTS tests.tts_tests2
coverage run -m nose2 -F -v -B tests.tts_tests2
test_xtts:
nose2 -F -v -B --with-coverage --coverage TTS tests.xtts_tests
coverage run -m nose2 -F -v -B tests.xtts_tests
test_aux: ## run aux tests.
nose2 -F -v -B --with-coverage --coverage TTS tests.aux_tests
coverage run -m nose2 -F -v -B tests.aux_tests
./run_bash_tests.sh
test_zoo: ## run zoo tests.
nose2 -F -v -B --with-coverage --coverage TTS tests.zoo_tests
coverage run -m nose2 -F -v -B tests.zoo_tests
inference_tests: ## run inference tests.
nose2 -F -v -B --with-coverage --coverage TTS tests.inference_tests
coverage run -m nose2 -F -v -B tests.inference_tests
data_tests: ## run data tests.
nose2 -F -v -B --with-coverage --coverage TTS tests.data_tests
coverage run -m nose2 -F -v -B tests.data_tests
test_text: ## run text tests.
nose2 -F -v -B --with-coverage --coverage TTS tests.text_tests
coverage run -m nose2 -F -v -B tests.text_tests
test_failed: ## only run tests failed the last time.
nose2 -F -v -B --with-coverage --coverage TTS tests
coverage run -m nose2 -F -v -B tests
style: ## update code style.
black ${target_dirs}

View File

@ -64,3 +64,7 @@ max-returns = 7
[tool.black]
line-length = 120
target-version = ['py39']
[tool.coverage.run]
parallel = true
source = ["TTS"]

View File

@ -1,4 +1,4 @@
black==24.2.0
coverage
coverage[toml]
nose2
ruff==0.3.0