name: testing

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

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ["3.10", "3.12"]

    steps:
      - uses: actions/checkout@v4
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}
      - name: Upgrade pip
        run: python -m pip install --upgrade pip
      - name: Install HMMER
        run: sudo apt-get -y install hmmer
      - name: Install MacSyFinder
        run: python -m pip install .[dev]
      - name: Test and Compute the code coverage
        run: coverage run --source macsypy tests/run_tests.py -vvv
      - name: Upload Coverage to Codecov
        uses: codecov/codecov-action@v3
        if: matrix.python-version == '3.12'
