Update generated code #87
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update generated code | |
on: | |
# Can be called manually or remotely | |
workflow_dispatch: | |
inputs: | |
ANSYS_VERSION: | |
description: "ANSYS version" | |
required: false | |
type: string | |
default: "241" | |
standalone_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: | |
- uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4.6.0 | |
with: | |
python-version: "3.10" | |
- name: "Install DPF" | |
id: set-server-path | |
uses: ansys/pydpf-actions/install-dpf-server@v2.3 | |
with: | |
dpf-standalone-TOKEN: ${{secrets.DPF_PIPELINE}} | |
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '_test_pygate' }} | |
ANSYS_VERSION : ${{ github.event.inputs.ANSYS_VERSION || '241' }} | |
- 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 | |
unzip -o $wheel_file "ansys/**/*" -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/* | |
docs/source/_static/dpf_operators.html | |
commit-message: update operators | |
title: Update Operators for DPF ${{ github.event.inputs.ANSYS_VERSION || '241' }}${{ github.event.inputs.standalone_branch_suffix || '_test_pygate' }} on ${{ github.ref_name }} | |
body: An update of operators has been triggered either manually or by an update in the dpf-standalone repository. | |
branch: maint/update_operators_for_${{ github.event.inputs.ANSYS_VERSION || '241' }}${{ github.event.inputs.standalone_branch_suffix || '_test_pygate' }}_on_${{ github.ref_name }} | |
labels: maintenance | |
- name: "Kill all servers" | |
uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 | |
if: always() |