name: tox-pytest

on: push

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: 3.8
    - name: Install dependencies
      run: |
        sudo apt-get install libsnappy-dev
        python -m pip install --upgrade pip
        pip install tox
    - name: Survey the Scene
      run: |
        pwd
        find ./
    - name: Run PyTest with Tox
      env:
        API_KEY_EIA: ${{ secrets.API_KEY_EIA }}
        CI: True
        TRAVIS: True
      run: tox -ve travis -- --fast
    - name: Upload Test Coverage to codecov.io
      uses: codecov/codecov-action@v1

# TODO:
# * Add build status badge
# * Generate coverage and upload
# * Set up Slack notification of build
# * Discontinue Travis CI builds

name: tox-pytest

on: push

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: 3.8
    - name: Install dependencies
      run: |
        sudo apt-get install libsnappy-dev
        python -m pip install --upgrade pip
        pip install tox
    - name: Survey the Scene
      run: |
        pwd
        find ./
    - name: Run PyTest with Tox
      env:
        API_KEY_EIA: ${{ secrets.API_KEY_EIA }}
        CI: True
        TRAVIS: True
      run: tox -ve scripts
    - name: Upload Test Coverage to codecov.io
      uses: codecov/codecov-action@v1
    - name: Notify Slack
      uses: 8398a7/action-slack@v3
      with:
        status: ${{ job.status }}
        fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message)
      env:
        SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
      if: always() # Pick up events even if the job fails or is canceled.

# TODO:
# * Add build status badge
# * Generate coverage and upload
# * Set up Slack notification of build
# * Discontinue Travis CI builds

Add Slack build notification to GitHub Workflow
Add Slack build notification to GitHub Workflow
