-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from ansys-internal/ci/documentation_worklfow
CI: add documentation workflow
- Loading branch information
Showing
1 changed file
with
66 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,66 @@ | ||
name: Documentation Build | ||
|
||
on: [pull_request, workflow_dispatch] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
docs-style: | ||
name: Check documentation style | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check documentation style | ||
uses: ansys/actions/doc-style@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
vale-config: "doc/.vale.ini" | ||
vale-version: "2.29.6" | ||
|
||
docs_build: | ||
name: Build documentation | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install pyedb with doc dependencies | ||
run: | | ||
pip install .[doc] | ||
- name: Verify that pyedb can be imported | ||
run: python -c "import pyedb" | ||
|
||
- name: Retrieve pyedb version | ||
run: | | ||
echo "Pyedb version is: $(python -c "from pyedb import __version__; print(); print(__version__)" | tail -1)" | ||
- name: Install doc build requirements | ||
run: | | ||
sudo apt install graphviz | ||
# Run doc build, without creating the examples directory. | ||
# NOTE: we have to add the examples file here since it won't be created as gallery is disabled on linux. | ||
- name: Documentation Build | ||
run: | | ||
make -C doc clean | ||
mkdir doc/source/examples -p | ||
echo $'Examples\n========' > doc/source/examples/index.rst | ||
make -C doc html SPHINXOPTS="-j auto -w build_errors.txt -N" | ||
# Verify that sphinx generates no warnings | ||
- name: Check for warnings | ||
run: | | ||
python doc/print_errors.py | ||
- name: Upload Documentation | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Documentation | ||
path: doc/_build/html | ||
retention-days: 1 |