-
Notifications
You must be signed in to change notification settings - Fork 25
146 lines (126 loc) · 4.87 KB
/
update_operators.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
name: Update generated code
on:
# Can be called manually or remotely
workflow_dispatch:
inputs:
distinct_id:
description: "ID to give the job when run via dpf-standalone repo"
required: false
type: string
default: ""
ANSYS_VERSION:
description: "ANSYS version"
required: false
type: string
default: "251"
standalone_branch_suffix:
description: "Suffix of the branch on standalone"
required: false
type: string
default: ''
env:
PACKAGE_NAME: ansys-dpf-core
MODULE: core
ANSYSLMD_LICENSE_FILE: 1055@${{ secrets.LICENSE_SERVER }}
ANSYS_DPF_ACCEPT_LA: Y
jobs:
update_generated:
name: "Update Generated Code"
runs-on: windows-latest
steps:
- name: echo distinct ID ${{ github.event.inputs.distinct_id }}
run: echo ${{ github.event.inputs.distinct_id }}
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: "Install DPF"
id: set-server-path
uses: ansys/pydpf-actions/[email protected]
with:
dpf-standalone-TOKEN: ${{secrets.DPF_PIPELINE}}
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }}
ANSYS_VERSION : ${{ github.event.inputs.ANSYS_VERSION || '251' }}
- name: "Update ansys-grpc-dpf"
shell: bash
run: |
wheel_file=$(find ./dpf-standalone/v${{ github.event.inputs.ANSYS_VERSION }}/dist -name "ansys_grpc_dpf-*" -type f)
echo $wheel_file
rm -r src/ansys/grpc
unzip -o $wheel_file "ansys/**/*" -d src/
chmod -R 777 src/ansys/grpc
git add -f src/ansys/grpc
- name: "Update ansys-dpf-gate"
shell: bash
run: |
wheel_file=$(find ./dpf-standalone/v${{ github.event.inputs.ANSYS_VERSION }}/dist -name "ansys_dpf_gate-*" -type f)
echo $wheel_file
rm -r src/ansys/dpf/gate/generated
unzip -o $wheel_file "ansys/dpf/gate/generated/*" -d src/
unzip -o $wheel_file "ansys/dpf/gate/__init__.py" -d src/
chmod -R 777 src/ansys/dpf/gate
git add -f src/ansys/dpf/gate
- name: "Update ansys-dpf-gatebin lin"
shell: bash
run: |
wheel_file=$(find ./dpf-standalone/v${{ github.event.inputs.ANSYS_VERSION }}/dist -name "ansys_dpf_gatebin-*linux1*" -type f)
echo $wheel_file
rm -r src/ansys/dpf/gatebin
unzip -o $wheel_file "ansys/**/*" -d src/
chmod -R 777 src/ansys/dpf/gatebin
- name: "Update ansys-dpf-gatebin win"
shell: bash
run: |
wheel_file=$(find ./dpf-standalone/v${{ github.event.inputs.ANSYS_VERSION }}/dist -name "ansys_dpf_gatebin-*win*" -type f)
echo $wheel_file
unzip -o $wheel_file "ansys/**/*" -d src/
chmod -R 777 src/ansys/dpf/gatebin
git add -f src/ansys/dpf/gatebin
- name: "Install local package as editable"
shell: bash
run: |
pip install --find-links=.github/ -e .
- name: "Install requirements_build"
run: |
pip install -r requirements/requirements_build.txt
- name: "List installed packages"
shell: bash
run: pip list
- name: "Generate Operators"
shell: bash
working-directory: .ci
run: |
python code_generation.py
timeout-minutes: 5
- name: "Generate Operators Documentation"
shell: bash
working-directory: .ci
run: |
python build_operators_doc.py
timeout-minutes: 5
- name: "Show changes"
shell: bash
run: |
git status
- name: "Create Pull Request"
uses: peter-evans/create-pull-request@v4
with:
delete-branch: true
add-paths: |
src/ansys/dpf/gate/*
src/ansys/dpf/gatebin/*
src/ansys/grpc/*
src/ansys/dpf/core/operators/*
doc/source/_static/dpf_operators.html
commit-message: update generated code
title: Update generated code for DPF ${{ github.event.inputs.ANSYS_VERSION || '251' }}${{ github.event.inputs.standalone_branch_suffix || '' }} on ${{ github.ref_name }}
body: An update of generated code has been triggered either manually or by an update in the dpf-standalone repository.
branch: maint/update_code_for_${{ github.event.inputs.ANSYS_VERSION || '251' }}${{ github.event.inputs.standalone_branch_suffix || '' }}_on_${{ github.ref_name }}
labels: server-sync
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
reviewers: ansys/dpf_integration_proxies
assignees: ansys/dpf_integration_proxies
- name: "Kill all servers"
uses: ansys/pydpf-actions/[email protected]
if: always()