From 5c458ccd41b587d41b05651641c91970d297cfb3 Mon Sep 17 00:00:00 2001 From: Cathy Hu Date: Wed, 1 Jul 2020 20:49:24 +0200 Subject: [PATCH] [misc] Add github action for documentation and backend --- .github/workflows/backend.yml | 25 ++++++++++++++++++ .github/workflows/documentation.yml | 40 +++++++++++++++++++++++++++++ setup.py | 2 +- 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/backend.yml create mode 100644 .github/workflows/documentation.yml diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml new file mode 100644 index 0000000..0867d4d --- /dev/null +++ b/.github/workflows/backend.yml @@ -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 diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..8c31a85 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -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 diff --git a/setup.py b/setup.py index 064e084..b77c315 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ setup( 'pytoml', 'scrypt', ], - test_requires=[ + tests_require=[ 'flake8', 'pytest', ],