name: tests
on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  build:
    runs-on: ${{matrix.os}}
    strategy: 
      matrix: 
        os: [ubuntu-latest, macos-latest, windows-latest]
    steps:
      - uses: actions/checkout@v2
      - name: Install Python 3
        uses: actions/setup-python@v1
        with:
          python-version: 3.9
      - name: Install dependencies
        run: |
          python3 -m pip install --upgrade pip
          pip3 install -e .
          pip3 install pytest
          pip3 install pytest-cov
      - name: Pytest
        run: pytest -v --cov=./ --cov-report=xml
      - name: Upload coverage to codecov
        uses: codecov/codecov-action@v2
        with:
          env_vars: OS,PYTHON
          files: ./coverage.xml
          name: Coverage Report with codecov overview
          verbose: true
