Skip to content

Commit

Permalink
ci: enable CI for fs2 to measure code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
joanise committed Nov 26, 2024
1 parent 7b50b38 commit e1656e4
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .coveragerc
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__.:
55 changes: 55 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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

- name: install sox
run: |
sudo apt-get install libasound2-plugins libasound2-python libsox-fmt-all
sudo apt-get install sox
- name: Install everyvoice
run: |
git clone https://github.com/EveryVoiceTTS/EveryVoice
cd EveryVoice
git submodule update --init
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
- name: pip freeze
- name: pip list

- name: Run unit tests related to fs2
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 }}

0 comments on commit e1656e4

Please sign in to comment.