[misc] Add github action for documentation and backend

This commit is contained in:
Cathy Hu 2020-07-01 20:49:24 +02:00
parent 11050cf665
commit 5c458ccd41
3 changed files with 66 additions and 1 deletions

25
.github/workflows/backend.yml vendored Normal file
View file

@ -0,0 +1,25 @@
name: Python package
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
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: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest flake8
- name: Test with pytest
run: |
pytest

40
.github/workflows/documentation.yml vendored Normal file
View file

@ -0,0 +1,40 @@
name: Documentation
env:
packageName: 'kibicara'
on:
push:
branches:
- master
release:
types: [published, created, edited]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
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: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pdoc3
- name: Build documentation with pydoc3
run: |
pdoc -f -o build --html ${{ env.packageName }}
- name: Deploy documentation onto gh-pages
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: build/${{ env.packageName }} # The folder the action should deploy.
CLEAN: true

View file

@ -26,7 +26,7 @@ setup(
'pytoml', 'pytoml',
'scrypt', 'scrypt',
], ],
test_requires=[ tests_require=[
'flake8', 'flake8',
'pytest', 'pytest',
], ],