From a185d0c914d8cc58b1e06cb05c0754789adffa96 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Thu, 30 Nov 2023 10:36:26 +0100 Subject: [PATCH] CI: add documentation workflow The workflow is composed on two jobs: one for checking the documentation style and the other to build the documentation --- .github/workflows/build_documentation.yml | 66 +++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/build_documentation.yml diff --git a/.github/workflows/build_documentation.yml b/.github/workflows/build_documentation.yml new file mode 100644 index 0000000000..206f983cc9 --- /dev/null +++ b/.github/workflows/build_documentation.yml @@ -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 \ No newline at end of file