1
- name : GitHub CI
1
+ name : CI
2
2
on :
3
3
pull_request :
4
4
workflow_dispatch :
@@ -20,44 +20,55 @@ concurrency:
20
20
21
21
jobs :
22
22
23
- docs-style :
24
- name : Documentation Style Check
23
+ code-style :
24
+ name : " Code style"
25
+ runs-on : ubuntu-latest
26
+ steps :
27
+ - uses : ansys/actions/code-style@v4
28
+ with :
29
+ python-version : ${{ env.MAIN_PYTHON_VERSION }}
30
+
31
+ doc-style :
32
+ name : " Documentation style"
25
33
runs-on : ubuntu-latest
26
34
steps :
27
35
- name : PyAnsys documentation style checks
28
36
uses : ansys/actions/doc-style@v4
29
37
with :
30
38
token : ${{ secrets.GITHUB_TOKEN }}
31
39
32
- docs :
33
- name : Documentation
40
+ doc :
41
+ name : " Documentation build "
34
42
runs-on : ubuntu-latest
35
- needs : [docs -style]
43
+ needs : [doc -style]
36
44
steps :
37
- - uses : actions/checkout@v3
45
+ - name : " Checkout project"
46
+ uses : actions/checkout@v3
38
47
39
- - name : Set up Python ${{ env.MAIN_PYTHON_VERSION }}
48
+ - name : " Set up Python ${{ env.MAIN_PYTHON_VERSION }}"
40
49
uses : actions/setup-python@v4
41
50
with :
42
51
python-version : ${{ env.MAIN_PYTHON_VERSION }}
43
52
cache : ' pip'
44
53
cache-dependency-path : ' pyproject.toml'
45
54
46
- - name : Install packages for documentation build
55
+ - name : " Install system dependencies "
47
56
run : |
48
57
sudo apt-get update
49
58
sudo apt-get install xvfb pandoc texlive-latex-extra latexmk
50
- pip install --upgrade build
51
- pip install .[doc]
52
59
53
- - name : Login to GitHub Container Registry
60
+ - name : " Install python dependencies"
61
+ run : |
62
+ python -m pip install .[doc]
63
+
64
+ - name : " Login to GitHub container registry"
54
65
uses : docker/login-action@v2
55
66
with :
56
67
registry : ghcr.io
57
68
username : ${{ github.actor }}
58
69
password : ${{ secrets.GITHUB_TOKEN }}
59
70
60
- - name : DPF server activation
71
+ - name : " Install and run DPF server"
61
72
run : |
62
73
docker pull ghcr.io/ansys/dpf-core:22.2dev
63
74
docker run -d --name dpfserver -p 50054:50052 ghcr.io/ansys/dpf-core:22.2dev && echo "DPF Server active on port 50054."
@@ -67,22 +78,22 @@ jobs:
67
78
docker pull ghcr.io/ansys/ls-pre:latest
68
79
docker run -d --name kw_server -p 50051:50051 ghcr.io/ansys/ls-pre:latest && echo "Keyword server active on port 50051."
69
80
70
- - name : Build the documentation (HTML)
81
+ - name : " Build the html documentation "
71
82
run : |
72
83
xvfb-run make -C doc html
73
84
74
- - name : Build the documentation (PDF)
85
+ - name : " Build the pdf documentation "
75
86
run : |
76
87
make -C doc pdf
77
88
78
- - name : Upload HTML documentation
89
+ - name : " Upload html documentation"
79
90
uses : actions/upload-artifact@v3
80
91
with :
81
92
name : documentation-html
82
93
path : doc/_build/html
83
94
retention-days : 7
84
95
85
- - name : Upload PDF documentation
96
+ - name : " Upload pdf documentation"
86
97
uses : actions/upload-artifact@v3
87
98
with :
88
99
name : documentation-pdf
94
105
run : |
95
106
docker logs kw_server > server_output.txt
96
107
97
- - name : Upload the server logs
108
+ - name : " Upload the server logs"
98
109
if : always()
99
110
uses : actions/upload-artifact@v3
100
111
with :
@@ -107,137 +118,123 @@ jobs:
107
118
docker logs dpfserver
108
119
docker stop dpfserver
109
120
110
- style :
111
- name : Code style
112
- runs-on : ubuntu-latest
113
- steps :
114
- - name : PyAnsys code style checks
115
- uses : ansys/actions/code-style@v4
116
- with :
117
- python-version : ${{ env.MAIN_PYTHON_VERSION }}
118
-
119
121
smoke-tests :
120
- name : Build and Smoke tests
122
+ name : " Build wheelhouse for ${{ matrix.os }} and Python ${{ matrix.python-version }} "
121
123
runs-on : ${{ matrix.os }}
122
- needs : [style]
124
+ needs : [code- style]
123
125
strategy :
124
126
fail-fast : false
125
127
matrix :
126
128
os : [windows-latest, ubuntu-latest]
127
- python-version : ['3.7', '3.8', '3.9', '3.10'] # , '3.11'] # --> At some point we should include Py3.11
128
-
129
+ python-version : ['3.7', '3.8', '3.9', '3.10']
129
130
steps :
130
- - name : Build wheelhouse and perform smoke test
131
- uses : ansys/actions/build-wheelhouse@v4
131
+ - uses : ansys/actions/build-wheelhouse@v4
132
132
with :
133
133
library-name : ${{ env.PACKAGE_NAME }}
134
134
library-namespace : ${{ env.PACKAGE_NAMESPACE }}
135
135
operating-system : ${{ matrix.os }}
136
136
python-version : ${{ matrix.python-version }}
137
137
138
138
tests :
139
- name : Testing
139
+ name : " Testing"
140
140
runs-on : ubuntu-latest
141
141
needs : [smoke-tests]
142
142
steps :
143
- - name : Checkout repository
143
+ - name : " Checkout repository"
144
144
uses : actions/checkout@v3
145
145
146
- - name : Set up Python
146
+ - name : " Set up Python"
147
147
uses : actions/setup-python@v4
148
148
with :
149
149
python-version : ${{ env.MAIN_PYTHON_VERSION }}
150
150
cache : ' pip'
151
151
cache-dependency-path : ' pyproject.toml'
152
152
153
- - name : Login to GitHub Container Registry
153
+ - name : " Login to GitHub container registry "
154
154
uses : docker/login-action@v2
155
155
with :
156
156
registry : ghcr.io
157
157
username : ${{ github.actor }}
158
158
password : ${{ secrets.GITHUB_TOKEN }}
159
159
160
- - name : LS-DYNA Keyword server activation
160
+ - name : " Pull and start LS-DYNA keyword server"
161
161
run : |
162
162
docker pull ghcr.io/ansys/ls-pre:latest
163
163
docker run -d --name kw_server -p 50051:50051 ghcr.io/ansys/ls-pre:latest && echo "Keyword server active on port 50051."
164
164
165
- - name : Install ansys-dyna-core (with test requirements)
165
+ - name : " Install package dependencies "
166
166
run : |
167
167
pip install -e .[tests]
168
168
169
- - name : Run tests
169
+ - name : " Run tests"
170
170
run : |
171
171
pytest
172
172
173
- - name : Extract the server logs
173
+ - name : " Extract the server logs"
174
174
if : always()
175
175
run : |
176
176
docker logs kw_server > server_output.txt
177
177
178
- - name : Upload the server logs
178
+ - name : " Upload the server logs"
179
179
if : always()
180
180
uses : actions/upload-artifact@v3
181
181
with :
182
182
name : server_output.txt
183
183
path : server_output.txt
184
184
185
- - name : Upload coverage results
185
+ - name : " Upload coverage results"
186
186
uses : actions/upload-artifact@v3
187
187
with :
188
188
name : coverage-html
189
189
path : .cov/html
190
190
retention-days : 7
191
191
192
- package :
193
- name : Package library
194
- needs : [docs , tests]
192
+ build-library :
193
+ name : " Build library"
194
+ needs : [doc , tests]
195
195
runs-on : ubuntu-latest
196
196
steps :
197
- - name : Build library source and wheel artifacts
198
- uses : ansys/actions/build-library@v4
197
+ - uses : ansys/actions/build-library@v4
199
198
with :
200
199
library-name : ${{ env.PACKAGE_NAME }}
201
200
python-version : ${{ env.MAIN_PYTHON_VERSION }}
202
201
203
202
release :
204
203
name : Release project
205
204
if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
206
- needs : [package ]
205
+ needs : [build-library ]
207
206
runs-on : ubuntu-latest
208
207
steps :
209
- - name : Release to the private PyPI repository
208
+ - name : " Release to the private PyPI repository"
210
209
uses : ansys/actions/release-pypi-private@v4
211
210
with :
212
211
library-name : ${{ env.PACKAGE_NAME }}
213
212
twine-username : " __token__"
214
213
twine-token : ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}
215
214
216
- - name : Release to GitHub
215
+ - name : " Release to GitHub"
217
216
uses : ansys/actions/release-github@v4
218
217
with :
219
218
library-name : ${{ env.PACKAGE_NAME }}
220
219
221
- upload_dev_docs :
222
- name : Upload dev documentation
220
+ doc-deploy-dev :
221
+ name : " Deploy development documentation"
223
222
if : github.ref == 'refs/heads/main'
224
223
runs-on : ubuntu-latest
225
- needs : [package ]
224
+ needs : [build-library ]
226
225
steps :
227
- - name : Deploy the latest documentation
228
- uses : ansys/actions/doc-deploy-dev@v4
226
+ - uses : ansys/actions/doc-deploy-dev@v4
229
227
with :
230
228
cname : ${{ env.DOCUMENTATION_CNAME }}
231
229
token : ${{ secrets.GITHUB_TOKEN }}
232
230
233
- upload_docs_release :
234
- name : Upload release documentation
231
+ doc-deploy-stable :
232
+ name : " Deploy stable documentation"
235
233
if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
236
234
runs-on : ubuntu-latest
237
235
needs : [release]
238
236
steps :
239
- - name : Deploy the stable documentation
240
- uses : ansys/actions/doc-deploy-stable@v4
237
+ - uses : ansys/actions/doc-deploy-stable@v4
241
238
with :
242
239
cname : ${{ env.DOCUMENTATION_CNAME }}
243
240
token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments