name: Run local tests

on:
  push:
  workflow_dispatch:

jobs:
  build:
    name: Run local tests
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4

    - name: Set up Python 3.9
      uses: actions/setup-python@v5
      with:
        python-version: "3.9"

    - name: Install dependencies
      run: |
        python3 -m pip install --upgrade pip setuptools wheel
        python3 -m pip install torch --extra-index-url https://download.pytorch.org/whl/cpu

    - name: Install package
      run: |
        python3 -m pip install -e .

    - name: Test with pytest
      run: |
        python3 -m pip install pytest pytest-cov parameterized
        python3 -m pytest --cov-report term --cov-config=.coveragerc --cov=torch_harmonics ./tests/test_sht.py ./tests/test_convolution.py