-
Notifications
You must be signed in to change notification settings - Fork 134
145 lines (118 loc) · 4.15 KB
/
nightly-docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
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