Nightly Documentation Build #1044
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: Nightly Documentation Build | |
on: | |
workflow_dispatch: | |
schedule: # UTC at 0300 | |
- cron: '0 3 * * *' | |
env: | |
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} | |
DOCUMENTATION_CNAME: 'aedt.docs.pyansys.com' | |
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }} | |
MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
docs_build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install pyaedt | |
run: | | |
pip install . | |
- name: Install doc build requirements | |
run: | | |
pip install .[doc] | |
- name: Install doc build requirements | |
run: | | |
sudo apt update | |
sudo apt install graphviz texlive-latex-extra latexmk texlive-xetex texlive-fonts-extra -y | |
- name: Documentation Build (HTML) | |
run: | | |
make -C doc clean | |
mkdir doc/source/examples -p | |
echo $'Examples\n========' > doc/source/examples/index.rst | |
make -C doc phtml-no-examples 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: Documentation Build (PDF) | |
run: | | |
make -C doc pdf-no-examples | |
- name: Add assets to HTML docs | |
run: | | |
zip -r documentation-html.zip ./doc/_build/html | |
mv documentation-html.zip ./doc/_build/html/_static/assets/download/ | |
cp doc/_build/latex/PyAEDT-Documentation-*.pdf ./doc/_build/html/_static/assets/download/pyaedt.pdf | |
- name: Upload documentation HTML artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: documentation-html | |
path: doc/_build/html | |
retention-days: 7 | |
- name: Upload documentation PDF artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Documentation-pdf | |
path: doc/_build/latex/*.pdf | |
retention-days: 7 | |
docs_upload: | |
needs: docs_build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Upload development documentation | |
uses: ansys/actions/doc-deploy-dev@v4 | |
with: | |
cname: ${{ env.DOCUMENTATION_CNAME }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
doc-index-dev: | |
name: "Deploy dev docs index" | |
runs-on: ubuntu-latest | |
needs: docs_upload | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v3 | |
- name: Display structure of downloaded files | |
run: ls -R | |
- name: "Deploy the dev documentation index for PyAEDT API" | |
uses: ansys/actions/doc-deploy-index@v4 | |
with: | |
cname: ${{ env.DOCUMENTATION_CNAME }}/version/dev | |
index-name: pyaedt-vdev | |
host-url: ${{ vars.MEILISEARCH_HOST_URL }} | |
api-key: ${{ env.MEILISEARCH_API_KEY }} | |
# docstring_testing: | |
# runs-on: Windows | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Setup Python | |
# uses: actions/setup-python@v2 | |
# with: | |
# python-version: 3.8 | |
# - name: 'Create virtual env' | |
# run: | | |
# python -m venv testenv | |
# testenv\Scripts\Activate.ps1 | |
# python -m pip install pip -U | |
# python -m pip install wheel setuptools -U | |
# python -c "import sys; print(sys.executable)" | |
# - name: 'Install pyaedt' | |
# run: | | |
# testenv\Scripts\Activate.ps1 | |
# pip install . --use-feature=in-tree-build | |
# cd _unittest | |
# python -c "import pyaedt; print('Imported pyaedt')" | |
# - name: Install testing requirements | |
# run: | | |
# testenv\Scripts\Activate.ps1 | |
# pip install -r requirements/requirements_test.txt | |
# pip install pytest-azurepipelines | |
# - name: Docstring testing | |
# run: | | |
# testenv\Scripts\Activate.ps1 | |
# pytest -v pyaedt/desktop.py pyaedt/icepak.py | |
# pytest -v pyaedt/desktop.py pyaedt/hfss.py |