Skip to content

Commit

Permalink
Add github action for python package and doc
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzamuto committed Jan 6, 2021
1 parent 7072668 commit 8a0494a
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ trim_trailing_whitespace = false

[Makefile]
indent_style = tab

[*.yml]
indent_size = 2
49 changes: 49 additions & 0 deletions .github/workflows/python-package-and-doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Python package and documentation

on:
push:
branches: [master]
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-pip-${{ hashFiles('./requirements.txt', './requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v2
with:
path: ~/.local
key: ${{ runner.os }}-pip-${{ hashFiles('./requirements.txt', './requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt
- name: Test
run: make test
- name: Build wheel
run: make
- name: sphinx
working-directory: ./doc
env:
PYTHONPATH: ..
run: make html
- name: GitHub Pages
uses: crazy-max/ghaction-github-pages@v2.2.0
with:
build_dir: doc/_build/html
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions requirements.dev.in → requirements-dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ numpydoc
pip-tools
sphinx
sphinx_rtd_theme
wheel
1 change: 1 addition & 0 deletions requirements.dev.txt → requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ sphinxcontrib-jsmath==1.0.1 # via sphinx
sphinxcontrib-qthelp==1.0.3 # via sphinx
sphinxcontrib-serializinghtml==1.1.4 # via sphinx
urllib3==1.26.2 # via requests
wheel==0.36.1 # via -r requirements.dev.in

# The following packages are considered to be unsafe in a requirements file:
# pip
Expand Down
Empty file added tests/__init__.py
Empty file.

0 comments on commit 8a0494a

Please sign in to comment.