name: tests
on:
  push:
    branches:
    - main
  pull_request:
    branches:
    - main
jobs:
  mypy:
    name: mypy
    runs-on: ubuntu-latest
    steps:
    - name: Clone repo
      uses: actions/checkout@v2
    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: '3.10'
    - name: Install dependencies
      run: pip3 install mypy pytest
    - name: Run tests
      run: mypy .
  pytest:
    name: pytest
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
    steps:
    - name: Clone repo
      uses: actions/checkout@v2
    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: pip3 install pytest pytest-cov
    - name: Run tests
      run: pytest --cov=. --cov-report=xml
    - name: Report coverage
      uses: codecov/codecov-action@v2
      with:
        token: ${{ secrets.CODECOV_TOKEN }}
