Skip to content

DOC: Update docstrings. #56

DOC: Update docstrings.

DOC: Update docstrings. #56

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python application
on: push
jobs:
build:
# services
services:
ioc:
image: tonyzhang/phantasy-ioc:jessie
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.1
with:
persist-credentials: false
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest wheel pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- 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: Initialize IOC
run: |
sleep 2.0
python -c "import epics;print(epics.caput('fac', 0.0))"
sleep 2.0
- name: Test with pytest
run: |
python setup.py bdist_wheel
pip install dist/*.whl --upgrade
cd ${GITHUB_WORKSPACE}/phantasy/tests
make test
- name: Build documentation
run: |
pip install -r requirements-doc.txt
cd docs
make html
! [ -e build/html/.nojekyll ] && touch build/html/.nojekyll || [ $? -eq 1 ]
- name: Publish documentation
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: docs/build/html
CLEAN: true
- name: Publish package to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@v1.4.1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}