# SpeechBrain 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: tests: if: github.event.pull_request.draft == false name: Tests runs-on: ubuntu-latest strategy: matrix: python-version: ["3.10", 3.13] steps: - uses: actions/checkout@v2 - uses: actions/cache@v4 id: cache-uv with: path: ~/.cache/uv key: ${{ runner.os }}-python-${{ matrix.python-version }}-uv - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Full dependencies run: | pip install uv uv pip install --system -r requirements.txt torch==2.6.0+cpu torchaudio==2.6.0+cpu --extra-index-url https://download.pytorch.org/whl/cpu uv pip install --system --editable . --no-deps # already installed pinned deps from requirements.txt, we're good - name: Install sox run: | sudo apt-get update sudo apt install sox libsox-dev # Installing only SoX for now due to FFmpeg issues on the CI server with Torchaudio 2.1. # FFmpeg works fine on all other machines. We'll switch back when the CI server is fixed. #- name: Install ffmpeg # run: | # sudo apt-get update # sudo apt-get install -y ffmpeg - name: Display Python version run: python -c "import sys; print(sys.version)" - name: Consistency tests with pytest run: | pytest tests/consistency - 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