Skip to content

Commit 3b277c2

Browse files
committed
ci: combine coverage reports
1 parent b4fded6 commit 3b277c2

File tree

4 files changed

+49
-13
lines changed

4 files changed

+49
-13
lines changed

.github/workflows/vocoder_tests.yml

+33-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request:
88
types: [opened, synchronize, reopened]
99
jobs:
10-
test:
10+
vocoder-tests:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
fail-fast: false
@@ -40,3 +40,35 @@ jobs:
4040
python3 setup.py egg_info
4141
- name: Unit tests
4242
run: make test_vocoder
43+
- name: Upload coverage data
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: coverage-data-${{ github.job }}-${{ matrix.python-version }}
47+
path: .coverage.*
48+
if-no-files-found: ignore
49+
coverage:
50+
if: always()
51+
needs: vocoder-tests
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v4
55+
- uses: actions/setup-python@v5
56+
with:
57+
python-version: "3.11"
58+
- uses: actions/download-artifact@v4
59+
with:
60+
pattern: coverage-data-*
61+
merge-multiple: true
62+
- name: Combine coverage
63+
run:
64+
python -Im pip install --upgrade coverage[toml]
65+
python -Im coverage combine
66+
python -Im coverage html --skip-covered --skip-empty
67+
python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
68+
python -Im coverage report
69+
- name: Upload HTML report if check failed
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: html-report
73+
path: htmlcov
74+
# if: ${{ failure() }}

Makefile

+11-11
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,38 @@ test_all: ## run tests and don't stop on an error.
1111
./run_bash_tests.sh
1212

1313
test: ## run tests.
14-
nose2 -F -v -B --with-coverage --coverage TTS tests
14+
coverage run -m nose2 -F -v -B tests
1515

1616
test_vocoder: ## run vocoder tests.
17-
nose2 -F -v -B --with-coverage --coverage TTS tests.vocoder_tests
17+
coverage run -m nose2 -F -v -B tests.vocoder_tests
1818

1919
test_tts: ## run tts tests.
20-
nose2 -F -v -B --with-coverage --coverage TTS tests.tts_tests
20+
coverage run -m nose2 -F -v -B tests.tts_tests
2121

2222
test_tts2: ## run tts tests.
23-
nose2 -F -v -B --with-coverage --coverage TTS tests.tts_tests2
23+
coverage run -m nose2 -F -v -B tests.tts_tests2
2424

2525
test_xtts:
26-
nose2 -F -v -B --with-coverage --coverage TTS tests.xtts_tests
26+
coverage run -m nose2 -F -v -B tests.xtts_tests
2727

2828
test_aux: ## run aux tests.
29-
nose2 -F -v -B --with-coverage --coverage TTS tests.aux_tests
29+
coverage run -m nose2 -F -v -B tests.aux_tests
3030
./run_bash_tests.sh
3131

3232
test_zoo: ## run zoo tests.
33-
nose2 -F -v -B --with-coverage --coverage TTS tests.zoo_tests
33+
coverage run -m nose2 -F -v -B tests.zoo_tests
3434

3535
inference_tests: ## run inference tests.
36-
nose2 -F -v -B --with-coverage --coverage TTS tests.inference_tests
36+
coverage run -m nose2 -F -v -B tests.inference_tests
3737

3838
data_tests: ## run data tests.
39-
nose2 -F -v -B --with-coverage --coverage TTS tests.data_tests
39+
coverage run -m nose2 -F -v -B tests.data_tests
4040

4141
test_text: ## run text tests.
42-
nose2 -F -v -B --with-coverage --coverage TTS tests.text_tests
42+
coverage run -m nose2 -F -v -B tests.text_tests
4343

4444
test_failed: ## only run tests failed the last time.
45-
nose2 -F -v -B --with-coverage --coverage TTS tests
45+
coverage run -m nose2 -F -v -B tests
4646

4747
style: ## update code style.
4848
black ${target_dirs}

pyproject.toml

+4
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,7 @@ max-returns = 7
6464
[tool.black]
6565
line-length = 120
6666
target-version = ['py39']
67+
68+
[tool.coverage.run]
69+
parallel = true
70+
source = ["TTS"]

requirements.dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
black==24.2.0
2-
coverage
2+
coverage[toml]
33
nose2
44
ruff==0.3.0

0 commit comments

Comments
 (0)