-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add requirements for testing/linting/docs and add CI workflow
- Loading branch information
1 parent
ff967d0
commit 88e8259
Showing
4 changed files
with
80 additions
and
0 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,69 @@ | ||
name: Hades CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
python-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out pycroft and submodules | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
cache: 'pip' | ||
- name: ensure presence of `wheel` | ||
run: pip install wheel | ||
- name: install pip dependencies | ||
run: > | ||
pip install | ||
vendor/arpreq | ||
-e . | ||
-r requirements.txt | ||
-r requirements.doc.txt | ||
-r requirements.lint.txt | ||
-r requirements.test.txt | ||
# TODO add script rendering mypy warnings as annotations | ||
- name: Execute mypy | ||
run: mypy | ||
|
||
- name: execute unittests | ||
run: pytest -v tests | ||
|
||
- name: Build sphinx docs | ||
run: make SPHINXOPTS="-EN -w sphinx.log" -C docs html | ||
# TODO add script rendering annotations | ||
# - name: Render sphinx warnings as annotations | ||
# run: python ./scripts/render_sphinx_log.py docs/sphinx.log | ||
- name: Publish sphinx docs as pages artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: docs/build/html | ||
|
||
# see https://github.com/actions/deploy-pages#usage | ||
deploy-docs: | ||
if: (github.event_name == 'push') && github.ref == 'refs/heads/main' | ||
# Add a dependency to the build job | ||
needs: python-lint | ||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | ||
permissions: | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source | ||
# Deploy to the github-pages environment. see | ||
# https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment | ||
# for general information abotu environments. | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy sphinx docs to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v1 |
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,5 @@ | ||
guzzle-sphinx-theme~=0.7.11 | ||
sphinx~=5.1.1 | ||
sphinx-argparse~=0.3.1 | ||
sphinx-autobuild~=2021.3.14 | ||
sphinx-paramlinks~=0.5.4 |
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,3 @@ | ||
mypy~=0.971 | ||
types-docutils~=0.19.1 | ||
types-setuptools~=65.3.0 |
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,3 @@ | ||
pytest~=7.1.3 | ||
pytest-mock~=3.8.2 | ||
trio~=0.21.0 |