name: Unit tests

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: Set up Python
      uses: actions/setup-python@v1
      with:
        python-version: 3.8
    - name: Install dependencies
      run: |
        pip install --upgrade pip pipenv
        pipenv sync -d
    - name: Unit tests
      env:
        COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
      run: |
        make test
        COVERALLS_REPO_TOKEN=$COVERALLS_TOKEN pipenv run coveralls
