Skip to content

CI Build

CI Build #1519

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: CI Build
on:
workflow_dispatch:
schedule:
# Runs at 12am IST
- cron: '30 18 * * *'
pull_request:
branches:
- develop
- master
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up cache
uses: actions/cache@v2
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry flake8
poetry install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 setup.py udemy_enroller --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 setup.py udemy_enroller --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics
- name: Run unittests
run: |
poetry run pytest
- name: Make sure crawler is working (Attempt to subscribe to 1 course)
env:
UDEMY_EMAIL: ${{ secrets.UDEMY_EMAIL }}
UDEMY_PASSWORD: ${{ secrets.UDEMY_PASSWORD }}
CI_TEST: "True"
run: |
poetry run python run_enroller.py --debug