update submodules and docs #176
Workflow file for this run
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
name: Build CI | |
on: | |
pull_request: | |
types: [opened, reopened] | |
push: | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Checkout Current Repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Install dependencies | |
# cmake ships with the ubuntu-latest runner | |
run: | | |
sudo apt-get install python3-dev graphviz | |
python3 -m pip install -r docs/requirements.txt -r requirements.txt -r requirements-dev.txt | |
- name: Run cpp-linter as a py pkg | |
id: linter | |
run: | | |
cpp-linter \ | |
--version=12 \ | |
--style=file \ | |
--tidy-checks='-*' \ | |
--files-changed-only='false' \ | |
--ignore='!src|' | |
- name: C++ Linter checks failed? | |
if: steps.linter.outputs.checks-failed > 0 | |
run: exit 1 | |
- name: Build package for docs extraction and linting examples | |
run: | | |
python3 setup.py sdist bdist_wheel | |
python3 -m pip install dist/pyrf24-*.whl | |
- name: check python typing | |
run: mypy src | |
- name: check python examples PEP8 compliance | |
# duplicate-code error gets flagged because some examples use similar code snippets | |
run: pylint examples/*.py src/pyrf24/*.py --disable=duplicate-code --output-format=json:pylint.json | |
- name: Match pylint problems to diff via github annotations | |
run: python ./.github/workflows/pylint_matcher.py pylint.json | |
- name: Build docs | |
working-directory: docs | |
run: sphinx-build -E -W -b html . _build/html | |
- name: Save built docs as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "pyRF24_docs" | |
path: ${{ github.workspace }}/docs/_build/html | |
- name: upload to github pages | |
if: github.event_name !='pull_request' | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/_build/html | |
- name: Save distributable wheels as artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "pyRF24_pkg_dist" | |
path: ${{ github.workspace }}/dist | |
- name: Validate distribution | |
run: | | |
python3 -m pip install twine | |
python3 -m twine check dist/* |