-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: enable CI for fs2 to measure code coverage
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[run] | ||
source_pkgs = | ||
fs2 | ||
everyvoice.model.feature_prediction.FastSpeech2_lightning.fs2 | ||
omit = | ||
*tmp* | ||
*/run_tests.py | ||
*/tests/* | ||
*/__main__.py | ||
|
||
[report] | ||
precision = 2 | ||
exclude_lines = | ||
pragma: no cover | ||
if 0: | ||
if __name__ == .__main__.: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Run Tests | ||
on: | ||
- push | ||
- pull_request | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
cache: "pip" | ||
|
||
- uses: FedericoCarboni/setup-ffmpeg@v2 | ||
|
||
- run: sudo apt-get install sox | ||
|
||
- name: Fetch everyvoice | ||
run: | | ||
git clone https://github.com/EveryVoiceTTS/EveryVoice | ||
cd EveryVoice | ||
git checkout ${{ github.ref_name }} || git checkout ${{ github.head_ref }} || true | ||
git submodule update --init | ||
cd everyvoice/model/feature_prediction/FastSpeech2_lightning | ||
git fetch origin ${{ github.ref }} | ||
git checkout FETCH_HEAD | ||
- name: Install everyvoice | ||
run: | | ||
cd EveryVoice | ||
CUDA_TAG=cpu pip install -r requirements.torch.txt --find-links https://download.pytorch.org/whl/torch_stable.html | ||
pip install -e .[dev] | ||
pip install coverage | ||
- run: pip freeze | ||
|
||
- run: pip list | ||
|
||
- name: Run fs2 unit tests | ||
run: | | ||
cd EveryVoice/everyvoice/model/feature_prediction/FastSpeech2_lightning/ | ||
coverage run -m unittest discover everyvoice.model.feature_prediction.FastSpeech2_lightning.fs2.tests | ||
coverage xml | ||
- name: Plain text coverage report | ||
run: | | ||
cd EveryVoice/everyvoice/model/feature_prediction/FastSpeech2_lightning/ | ||
coverage report | ||
- uses: codecov/codecov-action@v4 | ||
with: | ||
fail_ci_if_error: false # optional (default = false) | ||
token: ${{ secrets.CODECOV_TOKEN }} |