-
Notifications
You must be signed in to change notification settings - Fork 25
259 lines (234 loc) · 8.22 KB
/
ci.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
name: CI
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches-ignore:
- '*no-ci*'
push:
branches:
- master
workflow_dispatch:
inputs:
ansys_version:
description: "ANSYS version"
required: false
type: string
default: "251"
standalone_branch_suffix:
description: 'Suffix of the branch on standalone'
required: false
default: ''
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
env:
DOCUMENTATION_CNAME: 'dpf.docs.pyansys.com'
MAIN_PYTHON_VERSION: '3.9'
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }}
jobs:
debug:
runs-on: ubuntu-latest
steps:
- name: Show the Github context for the triggered event
run: echo "$GITHUB_CONTEXT"
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
pick_server_suffix:
runs-on: ubuntu-latest
outputs:
suffix: ${{ steps.step1.outputs.suffix }}
steps:
- id: step1
name: Define server branch suffix to use
run: |
if ${{ github.event_name == 'push' }}; then
echo "suffix=" >> "$GITHUB_OUTPUT"
elif ${{ github.event_name == 'workflow_dispatch' }}; then
echo "suffix=${{ github.event.inputs.standalone_branch_suffix }}" >> "$GITHUB_OUTPUT"
elif ${{ github.event_name == 'pull_request' }}; then
# If the PR is server-sync then extract suffix from branch name
sub='maint/update_code_for_'
if [[ "${{ github.head_ref }}" == *"$sub"* ]]; then
ref_name=${{ github.head_ref }}
base_ref=${{ github.base_ref }}
suffix=${ref_name/$sub[0-9][0-9][0-9]/''}
suffix=${suffix/_on_$base_ref/''}
elif [[ "${{ github.base_ref }}" == *"$sub"* ]]; then
base_ref=${{ github.base_ref }}
suffix=${base_ref/$sub[0-9][0-9][0-9]/''}
suffix=${suffix/_on_*/''}
fi
echo "suffix=$suffix" >> "$GITHUB_OUTPUT"
fi
echo "branch suffix is: >$suffix<"
style:
name: "Style Check"
runs-on: ubuntu-latest
steps:
- uses: ansys/actions/code-style@v7
with:
use-python-cache: false
build_linux1:
name: "Build linux1 wheel"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Install requirements"
run: pip install -r requirements/requirements_build.txt
- name: "Build the manylinux1 wheel"
shell: bash
id: wheel
run: |
python .ci/build_wheel.py -p manylinux1
cd dist
export name=`ls ansys_dpf_core*.whl`
echo ${name}
echo "wheel_name=${name[0]}" >> $GITHUB_OUTPUT
cd ..
- name: "Upload wheel any as artifact"
uses: actions/upload-artifact@v4
with:
name: ${{ steps.wheel.outputs.wheel_name }}
path: dist/${{ steps.wheel.outputs.wheel_name }}
tests:
uses: ./.github/workflows/tests.yml
needs: pick_server_suffix
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
python_versions: '["3.9"]'
wheel: true
wheelhouse: false
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
secrets: inherit
tests_any:
uses: ./.github/workflows/tests.yml
needs: pick_server_suffix
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
python_versions: '["3.9"]'
wheel: true
wheelhouse: false
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
test_any: true
secrets: inherit
docker_tests:
name: "Build and Test on Docker"
uses: ./.github/workflows/test_docker.yml
needs: pick_server_suffix
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
secrets: inherit
docker_examples:
name: "Run examples on Docker"
uses: ./.github/workflows/examples_docker.yml
needs: pick_server_suffix
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
python_versions: '["3.9"]'
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
secrets: inherit
docs:
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
uses: ./.github/workflows/docs.yml
needs: pick_server_suffix
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
event_name: ${{ github.event_name }}
secrets: inherit
upload-development-docs:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}
needs: [docs]
steps:
- name: "Upload development documentation"
uses: ansys/actions/doc-deploy-dev@v7
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
doc-artifact-name: HTML-doc-ansys-dpf-core.zip
decompress-artifact: true
doc-index-dev:
name: "Deploy dev index docs"
runs-on: ubuntu-latest
needs: upload-development-docs
steps:
- name: "Deploy the latest documentation index"
uses: ansys/actions/doc-deploy-index@v7
with:
cname: ${{ env.DOCUMENTATION_CNAME }}/version/dev
index-name: pydpf-core-vdev
host-url: ${{ vars.MEILISEARCH_HOST_URL }}
api-key: ${{ env.MEILISEARCH_API_KEY }}
doc-artifact-name: HTML-doc-ansys-dpf-core.zip
decompress-artifact: true
examples:
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
uses: ./.github/workflows/examples.yml
needs: pick_server_suffix
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
python_versions: '["3.9"]'
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
secrets: inherit
retro_242:
name: "retro 242"
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
uses: ./.github/workflows/tests.yml
with:
ANSYS_VERSION: "242"
python_versions: '["3.9"]'
DOCSTRING: false
standalone_suffix: ''
secrets: inherit
retro_241:
name: "retro 241"
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
uses: ./.github/workflows/tests.yml
with:
ANSYS_VERSION: "241"
python_versions: '["3.9"]'
DOCSTRING: false
standalone_suffix: '.sp01'
secrets: inherit
retro_232:
name: "retro 232"
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
uses: ./.github/workflows/tests.yml
with:
ANSYS_VERSION: "232"
python_versions: '["3.9"]'
DOCSTRING: false
standalone_suffix: ''
secrets: inherit
retro_231:
name: "retro 231"
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
uses: ./.github/workflows/tests.yml
with:
ANSYS_VERSION: "231"
python_versions: '["3.9"]'
DOCSTRING: false
secrets: inherit
retro_222:
name: "retro 222"
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
uses: ./.github/workflows/tests.yml
with:
ANSYS_VERSION: "222"
python_versions: '["3.9"]'
DOCSTRING: false
secrets: inherit
pydpf-post:
name: "PyDPF-Post"
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
uses: ./.github/workflows/pydpf-post.yml
needs: pick_server_suffix
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
post_branch: "master"
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
test_docstrings: "true"
secrets: inherit