name: Run tests
on:
  pull_request:
    branches:
      - "main"

jobs:
  tests:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    strategy:
      matrix:
        python-version: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10]
    steps:
      - uses: actions/checkout@v2

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

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install "pytest==4.6.9" # pytest 4.6.X works best for older Python versions
          pip install -U codecov 'coverage==4.5.4' pytest-cov

      - run: py.test tests
        env:
          CI: 1
          PYTHONDONTWRITEBYTECODE: 1

Add GitHub action to run tests
Add GitHub action to run tests
