Skip to content

Commit 750d173

Browse files
Revathyvenugopal162pyansys-ci-botkoubaa
authored
docs: add keywords to autoapi docs (#800)
Co-authored-by: pyansys-ci-bot <[email protected]> Co-authored-by: Mohamed Koubaa <[email protected]>
1 parent d393b01 commit 750d173

File tree

14 files changed

+26094
-414
lines changed

14 files changed

+26094
-414
lines changed
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
name: Documentation Build
2+
description: Composite action to build and upload documentation (HTML and PDF)
3+
4+
inputs:
5+
6+
build-autokeywords-api:
7+
description: Enable building the autokeywords API
8+
required: false
9+
default: "False"
10+
pdf-pool-size:
11+
required: false
12+
pdf-string-vacancies:
13+
required: false
14+
pdf-max-strings:
15+
required: false
16+
PyDynaRunContainer:
17+
description: Run container name
18+
required: true
19+
python-version:
20+
description: Python version to use
21+
required: true
22+
default: "3.13"
23+
type: string
24+
github-token:
25+
description: GitHub token for authentication
26+
required: true
27+
28+
license-server:
29+
description: License server address
30+
required: true
31+
32+
bot-token:
33+
description: Bot token for authentication
34+
required: true
35+
36+
github-actor:
37+
description: GitHub actor for authentication
38+
required: true
39+
40+
41+
42+
runs:
43+
using: "composite"
44+
steps:
45+
- name: Checkout project
46+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
47+
48+
- name: Set up Python
49+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55
50+
with:
51+
python-version: ${{ inputs.python-version }}
52+
cache: 'pip'
53+
cache-dependency-path: 'pyproject.toml'
54+
55+
- name: Install system dependencies
56+
run: |
57+
sudo apt-get update
58+
sudo apt-get install xvfb pandoc texlive-latex-extra latexmk
59+
shell: bash
60+
61+
- name: Install python dependencies
62+
run: |
63+
python -m pip install .[doc]
64+
python -m pip install docker
65+
shell: bash
66+
67+
- name: Login to GitHub container registry
68+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
69+
with:
70+
registry: ghcr.io
71+
username: ${{ inputs.github-actor }}
72+
password: ${{ inputs.github-token }}
73+
74+
- name: Set Licensing
75+
run: |
76+
echo "ANSYS_DPF_ACCEPT_LA=Y" >> $GITHUB_ENV
77+
shell: bash
78+
79+
- name: Install DPF
80+
uses: ansys/pydpf-actions/[email protected]
81+
with:
82+
dpf-standalone-TOKEN: ${{ inputs.bot-token }}
83+
ANSYS_VERSION: "242"
84+
85+
- name: LS-DYNA Keyword server activation
86+
run: |
87+
docker pull ghcr.io/ansys/ls-pre:latest
88+
docker run -d --name kw_server -p 50051:50051 ghcr.io/ansys/ls-pre:latest && echo "Keyword server active on port 50051."
89+
shell: bash
90+
91+
- name: Pull PyDyna-run image
92+
run: |
93+
docker pull ghcr.io/ansys/pydyna-run:latest
94+
shell: bash
95+
96+
- name: Build the html documentation
97+
env:
98+
ANSYSLI_SERVERS: 2325@${{ inputs.license-server }}
99+
ANSYSLMD_LICENSE_FILE: 1055@${{ inputs.license-server }}
100+
PYDYNA_RUN_CONTAINER: ${{ inputs.PyDynaRunContainer }}
101+
BUILD_AUTOKEYWORS_API: ${{ inputs.build-autokeywords-api }}
102+
LSTC_LICENSE: ansys
103+
run: |
104+
timeout 7200 xvfb-run make -C doc html
105+
shell: bash
106+
107+
- name: Upload html documentation
108+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
109+
with:
110+
name: documentation-html
111+
path: doc/_build/html
112+
retention-days: 7
113+
114+
- name: "Build the pdf documentation"
115+
shell: bash
116+
run: |
117+
xvfb-run make -C doc pdf
118+
env:
119+
ANSYSLI_SERVERS: 2325@${{ inputs.license-server }}
120+
ANSYSLMD_LICENSE_FILE: 1055@${{ inputs.license-server }}
121+
LSTC_LICENSE: ansys
122+
PYDYNA_RUN_CONTAINER: ${{ inputs.PyDynaRunContainer }}
123+
PYDYNA_RUN_STREAM: "0"
124+
extra_mem_bot: 20000000
125+
extra_mem_top: 30000000
126+
pool_size: ${{ inputs.pdf-pool-size }}
127+
string_vacancies: ${{ inputs.pdf-string-vacancies }}
128+
max_strings: ${{ inputs.pdf-max-strings }}
129+
130+
- name: Upload pdf documentation
131+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
132+
with:
133+
name: documentation-pdf
134+
path: doc/_build/latex/*.pdf
135+
retention-days: 7
136+
137+
- name: Extract the server logs
138+
if: always()
139+
run: |
140+
docker logs kw_server > server_output.txt
141+
shell: bash
142+
143+
- name: Upload the server logs
144+
if: always()
145+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
146+
with:
147+
name: server_output_docs.txt
148+
path: server_output.txt
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Test codegen
2+
description: Run the codegen tests
3+
4+
inputs:
5+
python-version:
6+
description: "Python version to use"
7+
required: true
8+
default: "3.13"
9+
type: string
10+
11+
runs:
12+
using: "composite"
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ inputs.python-version }}
20+
21+
- name: Install library
22+
shell: bash
23+
run: pip install -e .[codegen]
24+
25+
- name: Generate codegen
26+
shell: bash
27+
run: |
28+
python codegen/generate.py -c
29+
python codegen/generate.py
30+
31+
- name: Run codegen testing
32+
shell: bash
33+
run: |
34+
if git -C src/ansys/dyna/core/keywords/keyword_classes/auto diff --relative --exit-code; then
35+
echo "CHANGES=false" >> "$GITHUB_ENV"
36+
else
37+
echo "CHANGES=true" >> "$GITHUB_ENV"
38+
fi
39+
40+
- name: Exit on changes
41+
if: ${{ env.CHANGES == 'true' }}
42+
shell: bash
43+
run: exit 1
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Run Tests
2+
description: Composite action to run tests with LS-DYNA keyword server
3+
4+
inputs:
5+
python-version:
6+
description: "Python version to use"
7+
required: true
8+
default: "3.13"
9+
type: string
10+
github-token:
11+
description: GitHub token for authentication
12+
required: true
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55
22+
with:
23+
python-version: ${{ inputs.python-version }}
24+
cache: 'pip'
25+
cache-dependency-path: 'pyproject.toml'
26+
27+
- name: Login to GitHub container registry
28+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ inputs.github-token }}
33+
34+
- name: Pull and start LS-DYNA keyword server
35+
run: |
36+
docker pull ghcr.io/ansys/ls-pre:latest
37+
docker run -d --name kw_server -p 50051:50051 ghcr.io/ansys/ls-pre:latest && echo "Keyword server active on port 50051."
38+
shell: bash
39+
40+
- name: Install package dependencies
41+
run: |
42+
pip install -e .[tests]
43+
shell: bash
44+
45+
- name: Run tests
46+
run: |
47+
pytest
48+
shell: bash
49+
50+
- name: Extract the server logs
51+
if: always()
52+
run: |
53+
docker logs kw_server > server_output.txt
54+
shell: bash
55+
56+
- name: Upload the server logs
57+
if: always()
58+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
59+
with:
60+
name: server_output_tests.txt
61+
path: server_output.txt
62+
63+
- name: Upload coverage results
64+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
65+
with:
66+
name: coverage-html
67+
path: .cov/html
68+
retention-days: 7

0 commit comments

Comments
 (0)