# SpeechBrain lint and unit tests to ease continuous integration # NOTE: Caching these offers no speedup name: SpeechBrain toolkit CI # Runs on pushes to master and all pull requests on: # yamllint disable-line rule:truthy push: branches: [main, develop] pull_request: jobs: linters: name: Linters runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Python 3.8 uses: actions/setup-python@v1 with: python-version: 3.8 - name: Lint dependencies run: | python -m pip install --upgrade pip pip install -r lint-requirements.txt - name: Run linters run: | flake8 . --count --show-source --statistics black --check --diff . yamllint . tests: name: Tests runs-on: ubuntu-latest strategy: matrix: python-version: [3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - name: Install libsndfile run: | sudo apt-get install -y libsndfile1 - name: Display Python version run: python -c "import sys; print(sys.version)" - name: Full dependencies run: | pip install -r requirements.txt pip install --editable . pip install ctc-segmentation - name: Unittests with pytest run: | pytest tests/unittests - name: Doctests with pytest run: | pytest --doctest-modules speechbrain - name: Integration tests with pytest run: | pytest tests/integration