name: Pull request unit tests

on:
  pull_request:
    branches: [ main ]

jobs:

  build-pipenv:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.7.1, 3.8, 3.9]

    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 pipenv
      uses: dschep/install-pipenv-action@v1

    - name: Install dependencies
      run: |
       pipenv install --dev

    - name: Test with unittest
      run: |
        pipenv run python -m unittest discover -p 'test_*.py'
