SDP tests #556
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
name: SDP tests | |
on: | |
pull_request: | |
branches: [ "main" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
doc-building: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements/docs.txt | |
pip install nemo_text_processing | |
python -m pip cache purge | |
# we are being quite strict here, but hopefully that will not be too inconvenient | |
- name: Checking that documentation builds with no warnings and all links are working | |
run: | | |
cd docs && make clean && make html SPHINXOPTS="-b linkcheck -W --keep-going -n" | |
no-nemo-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements/main.txt | |
pip install -r requirements/tests.txt | |
pip install -r requirements/huggingface.txt | |
pip install nemo_text_processing | |
python -m pip cache purge | |
- name: Checking that SDP can be imported and basic configs can be run without nemo | |
# in the future this might fail if some runtime tests require nemo | |
# in that case this test will need to be changed | |
run: | | |
python -m pytest tests/test_cfg_runtime_tests.py | |
main-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements/main.txt | |
pip install -r requirements/tests.txt | |
pip install -r requirements/huggingface.txt | |
sudo apt-get update | |
sudo apt-get install -y libsndfile1 ffmpeg sox libsox-fmt-mp3 | |
pip install pytorch_lightning | |
pip install Cython wheel # need to pre-install to avoid error in nemo installation | |
pip install nemo-toolkit[asr,nlp]==1.23.0 | |
pip install nemo_text_processing | |
python -m pip cache purge | |
- name: Run all tests | |
env: | |
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }} | |
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }} | |
CLEAN_UP_TMP_PATH: 1 | |
run: | | |
set -o pipefail # this will make sure next line returns non-0 exit code if tests fail | |
python -m pytest tests/ --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=sdp --durations=30 -rs | tee pytest-coverage.txt | |
# TODO: add some way to see if e2e tests were skipped | |
# (which will be the case for PRs from public forks). | |
# below step is supposed to do that, but not working yet | |
# - name: Pytest coverage comment | |
# uses: MishaKav/pytest-coverage-comment@main | |
# with: | |
# pytest-coverage-path: ./pytest-coverage.txt | |
# junitxml-path: ./pytest.xml |