-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from Travis CI and Appveyor to Github Actions (#292)
* Update pythonpackage.yml * use pipenv instead of requirements.txt in workflow * disable flake8 * activate virtual environment * run pytest in virtualenv * install development dependencies * run pytest in virtualenv again * Add documentation workflow * Added codecov action * add coverage report flag * add push, docs, and publish workflows * use html-proofer action * fix syntax error * fix syntax again * install sphinx and sphinx_rtd_theme * remove pipenv from make html * check directories in docs * switch html-proofer args order * add quotes to html-proofer args * modify search.html path * test runners, docs.yml, publish.yml * require python >=3.6 * update Pipfile.lock and publish.yml * move python requirement to setup.py * require python >=3.8 * temporarily remove windows runner * remove TODO * bump version and delete .travis.yml * add windows dependencies for pytest * add windows runner * remove appveyor * ignore pyproject.toml Co-authored-by: Oliver Leung <oal22@cornell.edu>
- Loading branch information
1 parent
9d42df4
commit 8121115
Showing
11 changed files
with
489 additions
and
503 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Build | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test-python: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: [3.8, 3.9] | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
|
||
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 pipenv | ||
pipenv install --dev | ||
- name: Run pytests and generate coverage report | ||
run: | | ||
pipenv run pytest --cov=./ --cov-report=xml | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
fail_ci_if_error: true | ||
|
||
test-docs: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pipenv | ||
pipenv install --dev | ||
pip install sphinx_rtd_theme | ||
- name: Run doctests and build html files | ||
run: | | ||
cd docs | ||
pipenv run make doctest | ||
make html | ||
- name: Run html-proofer | ||
uses: chabad360/htmlproofer@master | ||
with: | ||
directory: docs/build/html | ||
arguments: --allow_hash_href --file_ignore "docs/build/html/search.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
publish_docs: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install sphinx_rtd_theme | ||
- name: Build Sphinx documentation | ||
run: | | ||
cd docs | ||
make html | ||
- name: Publish Sphinx documentation | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: docs/build/html/ | ||
publish_branch: gh-pages | ||
user_name: 'github-actions[bot]' | ||
user_email: 'github-actions[bot]@users.noreply.github.com' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Publish to PyPi | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish_package: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel | ||
- name: Build package | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
- name: Publish package to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,7 @@ var/ | |
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
pyproject.toml | ||
|
||
# Installer logs | ||
pip-log.txt | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.