Skip to content

Added github workflow action to deploy changes on "push" #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Aug 26, 2020
Merged
26 changes: 26 additions & 0 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Code Quality
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I"m not sure running flake8u in this is worth it -- this isn't really a code project.

It would be nice to clean up all the code samples -- some of them are pretty old, but I dont hink we need to run a linter on every merge.


on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
lint:
name: Python Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "2.7"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some of thjat code is old, but we probably should go to py3 now

- name: Run flake8
uses: TrueBrain/actions-flake8@master
with:
path: Sources/code
ignore: E9,F63,F7,F82,E203,W293,E231,W291,W391,E265,E266,E226,E301,E228,E401,E303,E201,E202,E305,E501,E261




41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Python package

on: [push]

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 flake8 pytest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why these? They'd be pretty common for actual code, but in this case, we're only building Shinx docs.

if [ -f Sources/requirements.txt ]; then pip install -r Sources/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: Test with pytest
# run: |
# pytest
- name: Build static site
run: |
cd ./Sources; make html

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./Sources/build/html
21 changes: 10 additions & 11 deletions Sources/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Jinja2==2.7.2
MarkupSafe==0.19
Pygments==1.6
Sphinx==1.2.2
docutils==0.11
sphinx-rtd-theme==0.1.6
gnureadline==6.2.5
# hieroglyph==0.7.dev
-e git+https://github.com/nyergler/hieroglyph.git#egg=hieroglyph
ipython==2.3.0
libsass==0.5.1
Jinja2
MarkupSafe
Pygments
Sphinx
docutils
sphinx-rtd-theme
gnureadline
hieroglyph
ipython
libsass
2 changes: 1 addition & 1 deletion Sources/source/where_to_put_tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ https://docs.pytest.org/en/stable/goodpractices.html

For ``nose``, read https://nose.readthedocs.io/en/latest/finding_tests.html

and for ``unittest`` read https://docs.python.org/3/library/unittest.html#test-discovery .
and for ``unittest`` read https://docs.python.org/3/library/unittest.html#test-discovery.


Two Options
Expand Down