name: Run tests

on:
  push:
    paths:
    - ".github/workflows/unittest.yaml"
    - "python/**"
    - "requirements.txt"
    - "setup.py"
    - "tests/**"

jobs:
  unittest:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout out code
      uses: actions/checkout@v2
    - name: Set up Python 3.7
      uses: actions/setup-python@v2
      with:
        python-version: 3.7
    - name: Cache pip
      uses: actions/cache@v2
      with:
        path: ~/.cache/pip
        key: ${{ runner.os }}-pip-${{ hashFiles('requirements-*.txt') }}
    - name: Install dependencies
      run: |-
        python3 -m pip install --upgrade pip==20.3.4
        python3 -m pip install --requirement requirements.txt
        python3 -m pip install --requirement requirements-coverage.txt
        python3 setup.py develop
    - name: Run doctests
      env:
        AWS_DEFAULT_REGION: us-east-1
      run: |-
        python3 -m python.etl.selftest
    - name: Run unittests
      # TODO(tom): Keep increasing coverage so that we can raise the fail-under value.
      run: |-
        coverage3 run -m unittest --verbose
        coverage3 html --directory=docs/coverage_html/ --no-skip-covered --skip-empty
    - name: Archive code coverage results
      uses: actions/upload-artifact@v2
      with:
        name: code-coverage-report
        path: docs/coverage_html/
    - name: Test code coverage
      run: |-
        coverage3 report --fail-under=25 --skip-empty

name: Run tests

on:
  push:
    paths:
    - ".github/workflows/unittest.yaml"
    - "python/**"
    - "requirements.txt"
    - "setup.py"
    - "tests/**"

jobs:
  unittest:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout out code
      uses: actions/checkout@v2
    - name: Set up Python 3.7
      uses: actions/setup-python@v2
      with:
        python-version: 3.7
    - name: Cache pip
      uses: actions/cache@v2
      with:
        path: ~/.cache/pip
        key: ${{ runner.os }}-pip-${{ hashFiles('requirements-*.txt') }}
    - name: Install dependencies
      run: |-
        python3 -m pip install --upgrade pip==20.3.4
        python3 -m pip install --requirement requirements.txt
        python3 -m pip install --requirement requirements-coverage.txt
        python3 setup.py develop
    - name: Run doctests
      env:
        AWS_DEFAULT_REGION: us-east-1
      run: |-
        python3 -m python.etl.selftest
    - name: Run unittests
      # TODO(tom): Keep increasing coverage so that we can raise the fail-under value.
      run: |-
        coverage3 run -m unittest --verbose
        coverage3 report --fail-under=25 --no-skip-covered --show-missing --skip-empty

Remove upload of coverage report
Remove upload of coverage report
