diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..de3542e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +# Fast test suite on CPU. Slow tests (network, model weights, inference) are excluded. +name: CI + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + fast-tests: + runs-on: ubuntu-24.04 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + cache-dependency-path: pyproject.toml + + - name: Install system audio libraries + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends ffmpeg libsndfile1 + + - name: Install package (CPU-only torch) + run: | + python -m pip install --upgrade pip + python -m pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu + python -m pip install -e ".[test]" + + - name: Run fast test suite + run: python -m pytest -m "not slow" -q -p no:cacheprovider diff --git a/pyproject.toml b/pyproject.toml index d98b65d..5cf4b18 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,8 @@ dependencies = [ ] [project.optional-dependencies] +# Fast-suite (pytest -m "not slow") dependencies, used by CI. +test = ["pytest>=8", "librosa>=0.10", "onnx>=1.16"] clam = ["transformers>=4.40"] spectttra = [ "sonics @ git+https://github.com/awsaf49/sonics.git@9156ffad151f797c71556923c4a02fa01fa8fc91",