name: CI

on:
  push:
    branches: [master, dev]
  pull_request:
    branches: [master]

jobs:
  test:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

    steps:
    - name: Checkout code
      uses: actions/checkout@v3

    - name: Set up Python
      uses: actions/setup-python@v4
      with:
        python-version: ${{ matrix.python-version }}

    - name: Set up PYTHONPATH
      run: echo "PYTHONPATH=$PYTHONPATH:${{ github.workspace }}" >> $GITHUB_ENV

    - name: Install dependencies
      run: |
        sudo apt-get update --fix-missing
        pip install numpy pytest pydub matplotlib

    - name: Install specific package for Python 3.13 only
      if: matrix.python-version == '3.13'
      run: pip install audioop-lts

    - name: Run tests
      run: pytest -s -p no:warnings "tests"
