name: Tests
on:
  pull_request:
  push:
    branches:
      - master
jobs:
  tests:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ['3.8', '3.9', '3.10', '3.11']
    name: Run Tests with Python ${{ matrix.python-version }}
    steps:
      -
        name: Checkout
        uses: actions/checkout@v3
      - name: Set up Python
        uses: actions/setup-python@v3
        with:
          python-version: ${{ matrix.python-version }}
          architecture: x64
      -
        name: Install Dependencies
        run: pip install -r dev-requirements.txt
      -
        name: Unit tests
        run: pytest --cov=./readtime --cov-report=xml
      -
        name: Upload Coverage
        uses: codecov/codecov-action@v2
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          flags: unittests
