-
Notifications
You must be signed in to change notification settings - Fork 25
154 lines (135 loc) · 4.31 KB
/
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
146
147
148
149
150
151
152
153
154
name: docs
on:
# Can be called by the CI
workflow_call:
inputs:
python_version:
required: false
type: string
default: "3.10"
ANSYS_VERSION:
required: false
type: string
default: "251"
standalone_suffix:
description: "Suffix of the branch on standalone"
required: false
type: string
default: ''
event_name:
description: "Name of event calling"
required: true
type: string
default: ''
# Can be called manually
workflow_dispatch:
inputs:
python_version:
description: "Python interpreter"
required: true
type: string
default: "3.10"
ANSYS_VERSION:
description: "ANSYS version"
required: true
type: string
default: "251"
standalone_suffix:
description: "Suffix of the branch on standalone"
required: false
type: string
default: ''
env:
PACKAGE_NAME: ansys-dpf-core
MODULE: core
VTK_OSMESA_VERSION: "9.2.20230527.dev0"
jobs:
doc-style:
name: "Check doc style"
runs-on: ubuntu-latest
steps:
- name: "Running documentation style checks"
uses: ansys/actions/doc-style@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
docs:
name: "Documentation"
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: "Set licensing if necessary"
if: inputs.ANSYS_VERSION > 231
shell: bash
run: |
echo "ANSYS_DPF_ACCEPT_LA=Y" >> $GITHUB_ENV
echo "ANSYSLMD_LICENSE_FILE=1055@${{ secrets.LICENSE_SERVER }}" >> $GITHUB_ENV
- name: "Setup Python"
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}
- name: "Update pip to the latest version and install tox"
shell: pwsh
run: |
python -m pip install -U pip
python -m pip install tox tox-uv
- name: "Build the wheel"
shell: pwsh
run: |
tox -e build-wheel
- name: "Expose the wheel"
shell: bash
id: wheel
working-directory: dist
run: |
export name=`ls ansys_dpf_core*.whl`
echo ${name}
echo "wheel_name=${name[0]}" >> $GITHUB_OUTPUT
- name: "Install DPF"
id: set-server-path
uses: ansys/pydpf-actions/[email protected]
with:
dpf-standalone-TOKEN: ${{secrets.DPF_PIPELINE}}
standalone_suffix: ${{ inputs.standalone_suffix }}
ANSYS_VERSION : ${{inputs.ANSYS_VERSION}}
- name: "Check licences of packages"
uses: ansys/pydpf-actions/[email protected]
- name: "Test import"
shell: bash
run: |
python -m pip install dist/${{ steps.wheel.outputs.wheel_name }}
python -c "from ansys.dpf import core"
- name: "Setup headless display"
uses: pyvista/setup-headless-display-action@v2
- name: "Setup Graphviz"
uses: ts-graphviz/setup-graphviz@v2
- name: "Install OS packages"
run: |
choco install pandoc
- name: "Build HTML Documentation"
shell: bash
run: |
tox -e doc-html --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:doc-html.setenv+='VIRTUALENV_SYSTEM_SITE_PACKAGES=true'
- name: "Retrieve package version"
shell: bash
run: |
echo "VERSION=$(python -c "from ansys.dpf.${{env.MODULE}} import __version__; print(__version__)")" >> GITHUB_OUTPUT
echo "${{env.PACKAGE_NAME}} version is: $(python -c "from ansys.dpf.${{env.MODULE}} import __version__; print(__version__)")"
id: version
if: always()
- name: "Upload Documentation Build log"
uses: actions/upload-artifact@v4
with:
name: doc-${{env.PACKAGE_NAME}}-log
path: doc/*.txt
if: always()
- name: "Zip HTML Documentation"
shell: pwsh
run: |
Compress-Archive -Path doc/build/html/* -Destination HTML-doc-${{env.PACKAGE_NAME}}.zip
if: always()
- name: "Upload HTML Documentation"
uses: actions/upload-artifact@v4
with:
name: HTML-doc-${{env.PACKAGE_NAME}}.zip
path: HTML-doc-${{env.PACKAGE_NAME}}.zip
if: always()