Skip to content

CI

CI #683

Workflow file for this run

name: CI
# Run on main, tags, or any pull request
on:
schedule:
- cron: '0 2 * * *' # Daily at 2 AM UTC (8 PM CST)
push:
branches: [main]
tags: ["*"]
pull_request:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
check:
runs-on: ubuntu-latest
steps:
# Checkout Repo
- uses: actions/checkout@v2
# Set up python
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: 3.x
# Install Deps
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
# Run Check
- name: Run Code Linters
run: tox -e check
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9]
steps:
# Checkout Repo
- uses: actions/checkout@v2
# Set up python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# Install Deps
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
# Run Tests
- name: Run Python Tests
run: tox
# Upload Coverage Artifacts
- name: Upload Coverage Data
uses: actions/upload-artifact@v2
with:
name: coverage_${{ matrix.python-version }}
path: .coverage.*
slack:
name: Notify Slack Failure
needs: test
runs-on: ubuntu-latest
if: always() && github.event_name == 'schedule'
steps:
- uses: technote-space/workflow-conclusion-action@v2
- uses: voxmedia/github-action-slack-notify-build@v1
if: env.WORKFLOW_CONCLUSION == 'failure'
with:
channel: nightly-dev
status: FAILED
color: danger
env:
SLACK_BOT_TOKEN: ${{ secrets.DEV_SLACK_BOT_TOKEN }}
coverage:
needs: test
runs-on: ubuntu-latest
steps:
# Checkout Repo
- uses: actions/checkout@v2
# Set up python
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: 3.x
# Install Deps
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install tox
# Download Coverage Artifacts
- name: Download Coverage Data
uses: actions/download-artifact@v2
- name: Move coverage data
run: |
mv coverage_*/.coverage* .
rm -rf coverage_*/
# Run Coverage
- name: Run Coverage
run: tox -e coverage