on: ["push", "pull_request"]

name: Test Coveralls

jobs:

  test:
    name: Build
    runs-on: ubuntu-latest
    steps:

    - uses: actions/checkout@v2

    - name: Setup Python 3.6
      uses: actions/setup-python@v2
      with:
        python-version: '3.6'

    - name: Make test-coverage
      run: |
        pip install -r requirements-dev.txt
        python -m pytest --cov=kaftools tests

    - name: Coveralls
      uses: AndreMiras/coveralls-python-action@develop

  coveralls_finish:
    needs: test
    runs-on: ubuntu-latest
    steps:
    - name: Coveralls Finished
      uses: AndreMiras/coveralls-python-action@develop
      with:
        parallel-finished: true

on: ["pull_request"]

name: Test Coveralls

jobs:

  test:
    name: Build
    runs-on: ubuntu-latest
    steps:

    - uses: actions/checkout@v2

    - name: Setup Python 3.6
      uses: actions/setup-python@v2
      with:
        python-version: '3.6'

    - name: Make test-coverage
      run: |
        pip install -r requirements-dev.txt
        python -m pytest --cov=kaftools tests

    - name: Coveralls
      uses: AndreMiras/coveralls-python-action@develop

  coveralls_finish:
    needs: test
    runs-on: ubuntu-latest
    steps:
    - name: Coveralls Finished
      uses: AndreMiras/coveralls-python-action@develop
      with:
        parallel-finished: true

Refactor action to execute on pr only
Refactor action to execute on pr only
