Skip to content

Configure GitHub Actions CI workflow #23

Configure GitHub Actions CI workflow

Configure GitHub Actions CI workflow #23

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python package
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "*" ]
env:
CHATTERBOT_SHOW_TRAINING_PROGRESS: '0'
jobs:
build:
runs-on: ubuntu-20.04 # ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 nose coverage
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f dev-requirements.txt ]; then pip install -r dev-requirements.txt; fi
python -m spacy link en_core_web_sm en
python -m spacy link de_core_news_sm de
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test documentation build
run: |
sphinx-build -nW -b html ./docs/ /tmp/build/
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.11.0
with:
mongodb-version: '8.0'
- name: Run tests
run: |
nosetests -v
# TODO: Fix & re-enable Django tests
# - name: Run tests for Django example app
# run: |
# python setup.py develop
# python3 -m pip install "Django<=2.1"
# python runtests.py
# python examples/django_app/manage.py test examples/django_app/
# --------------------------------------------------------------
# https://github.com/marketplace/actions/coveralls-github-action
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2.3.4
- name: Generate code coverage
uses: paambaati/codeclimate-action@v9.0.0
env:
CC_TEST_REPORTER_ID: 3ec30a156224df0f59620967241d9659086e918fd824f4f69b8ce7b55b5a590f
with:
coverageCommand: coverage
debug: true