name: Tests

on: ["push", "pull_request"]
jobs:

  test:
    strategy:
      fail-fast: false
      matrix:
        python:
          - "3.12"
          - "3.11"
          - "3.10"
          - "3.9"
    runs-on: ubuntu-latest

    steps:
    - name: Checkout repository
      uses: actions/checkout@v4

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

    - name: Install dependencies
      run: |
        python -m pip install .[docs,test]
        sudo apt install tesseract-ocr
    - name: Run tests
      run: pytest
    - name: Coveralls
      uses: coverallsapp/github-action@v2
      with:
        file: coverage.lcov
        github-token: ${{ secrets.GITHUB_TOKEN }}
        fail-on-error: false
