name: Unit tests

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      max-parallel: 4
      matrix:
        python-version: [3.7]

    steps:
    - uses: actions/checkout@v1
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install Poetry
      uses: dschep/install-poetry-action@v1.2
      with:
        version: 1.0.5
    - name: Install dependencies
      run: |
        poetry install -v
    - name: Lint with flake8 and mypy
      run: |
        poetry run flake8 erasmus
        poetry run mypy erasmus
        cd ..
    - name: Test with pytest
      run: |
        poetry run py.test -p no:sugar --cov-report=xml:.coverage.xml
    - name: Upload coverage to codecov
      uses: codecov/codecov-action@v1.0.3
      with:
        token: ${{secrets.CODECOV_TOKEN}}
        file: ./.coverage.xml

Add unit test Github Action
Add unit test Github Action
