From df37386371d3d8df6e54793ddb4061a36f0ee780 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Mon, 16 Oct 2023 10:59:34 +0200 Subject: [PATCH 1/7] Only run gltf example --- .ci/run_examples.py | 2 + .github/workflows/ci.yml | 332 +++++++++++++++++++-------------------- 2 files changed, 168 insertions(+), 166 deletions(-) diff --git a/.ci/run_examples.py b/.ci/run_examples.py index c18a1d4d433..ff0abfa4691 100644 --- a/.ci/run_examples.py +++ b/.ci/run_examples.py @@ -26,6 +26,8 @@ for file in glob.iglob(os.path.join(subdir, "*.py")): if sys.platform == "linux" and "08-python-operators" in file: continue + if "02-python_operators_with_dependencies" not in file: + continue print("\n--------------------------------------------------") print(file) minimum_version_str = get_example_required_minimum_dpf_version(file) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e87cf8506d..eb5f412bc6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,131 +27,131 @@ env: 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) }} - - style: - name: "Style Check" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: "Setup Python" - uses: actions/setup-python@v4.6.0 - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - - - name: "Install pre-commit" - run: pip install pre-commit - - - name: "Run pre-commit" - run: pre-commit run --all-files --show-diff-on-failure - - build_linux1: - name: "Build linux1 wheel" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - 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@v3 - with: - name: ${{ steps.wheel.outputs.wheel_name }} - path: dist/${{ steps.wheel.outputs.wheel_name }} - - tests: - uses: ./.github/workflows/tests.yml - with: - ANSYS_VERSION: "241" - python_versions: '["3.9"]' - wheel: true - wheelhouse: false - standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} - secrets: inherit - - tests_any: - uses: ./.github/workflows/tests.yml - with: - ANSYS_VERSION: "241" - python_versions: '["3.9"]' - wheel: true - wheelhouse: false - standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} - test_any: true - secrets: inherit - - docker_tests: - name: "Build and Test on Docker" - uses: ./.github/workflows/test_docker.yml - with: - ANSYS_VERSION: "241" - standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} - secrets: inherit - - docker_examples: - name: "Run examples on Docker" - uses: ./.github/workflows/examples_docker.yml - with: - ANSYS_VERSION: "241" - python_versions: '["3.9"]' - standalone_suffix: ${{ github.event.inputs.standalone_branch_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 - with: - ANSYS_VERSION: "241" - standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} - event_name: ${{ github.event_name }} - secrets: inherit - - upload-development-docs: - runs-on: ubuntu-latest - if: ${{ github.ref == 'refs/heads/master' }} - needs: [docs] - steps: - - name: "Upload development documentation" - uses: ansys/actions/doc-deploy-dev@v4 - 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@v4 - 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 +# debug: +# runs-on: ubuntu-latest +# steps: +# - name: Show the Github context for the triggered event +# run: echo "$GITHUB_CONTEXT" +# env: +# GITHUB_CONTEXT: ${{ toJson(github) }} +# +# style: +# name: "Style Check" +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# +# - name: "Setup Python" +# uses: actions/setup-python@v4.6.0 +# with: +# python-version: ${{ env.MAIN_PYTHON_VERSION }} +# +# - name: "Install pre-commit" +# run: pip install pre-commit +# +# - name: "Run pre-commit" +# run: pre-commit run --all-files --show-diff-on-failure +# +# build_linux1: +# name: "Build linux1 wheel" +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# +# - 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@v3 +# with: +# name: ${{ steps.wheel.outputs.wheel_name }} +# path: dist/${{ steps.wheel.outputs.wheel_name }} +# +# tests: +# uses: ./.github/workflows/tests.yml +# with: +# ANSYS_VERSION: "241" +# python_versions: '["3.9"]' +# wheel: true +# wheelhouse: false +# standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} +# secrets: inherit +# +# tests_any: +# uses: ./.github/workflows/tests.yml +# with: +# ANSYS_VERSION: "241" +# python_versions: '["3.9"]' +# wheel: true +# wheelhouse: false +# standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} +# test_any: true +# secrets: inherit +# +# docker_tests: +# name: "Build and Test on Docker" +# uses: ./.github/workflows/test_docker.yml +# with: +# ANSYS_VERSION: "241" +# standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} +# secrets: inherit +# +# docker_examples: +# name: "Run examples on Docker" +# uses: ./.github/workflows/examples_docker.yml +# with: +# ANSYS_VERSION: "241" +# python_versions: '["3.9"]' +# standalone_suffix: ${{ github.event.inputs.standalone_branch_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 +# with: +# ANSYS_VERSION: "241" +# standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} +# event_name: ${{ github.event_name }} +# secrets: inherit +# +# upload-development-docs: +# runs-on: ubuntu-latest +# if: ${{ github.ref == 'refs/heads/master' }} +# needs: [docs] +# steps: +# - name: "Upload development documentation" +# uses: ansys/actions/doc-deploy-dev@v4 +# 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@v4 +# 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 @@ -162,44 +162,44 @@ jobs: standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} 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 - with: - ANSYS_VERSION: "241" - post_branch: "master" - standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} - test_docstrings: "true" - 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 +# with: +# ANSYS_VERSION: "241" +# post_branch: "master" +# standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} +# test_docstrings: "true" +# secrets: inherit From fb81e4a52e74b76f9fe5464f883135154e9deffb Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Mon, 16 Oct 2023 11:01:27 +0200 Subject: [PATCH 2/7] Remove superfluous prints --- .../02-python_operators_with_dependencies.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/08-python-operators/02-python_operators_with_dependencies.py b/examples/08-python-operators/02-python_operators_with_dependencies.py index f1a22ac62e9..26f7c93e822 100644 --- a/examples/08-python-operators/02-python_operators_with_dependencies.py +++ b/examples/08-python-operators/02-python_operators_with_dependencies.py @@ -56,20 +56,20 @@ folder_root = os.path.join(os.getcwd().rsplit("pydpf-core", 1)[0], "pydpf-core") source_path_in_repo = r"docs\source\examples\07-python-operators\plugins" operator_folder = os.path.join(folder_root, source_path_in_repo) -print(operator_folder) +# print(operator_folder) plugin_path = None for file in file_list: operator_file_path = os.path.join(operator_folder, file) - print(f"\033[1m {file}\n \033[0m") + # print(f"\033[1m {file}\n \033[0m") if ( os.path.splitext(file)[1] == ".py" or os.path.splitext(file)[1] == ".xml" ) and file != "gltf_plugin/gltf_export.py": - with open(operator_file_path, "r") as f: - for line in f.readlines(): - print("\t\t\t" + line) - print("\n\n") + # with open(operator_file_path, "r") as f: + # for line in f.readlines(): + # print("\t\t\t" + line) + # print("\n\n") if plugin_path is None: plugin_path = os.path.dirname(operator_file_path) @@ -91,10 +91,10 @@ # # To simplify this step, you can add a requirements file in the plug-in package: # -print("\033[1m gltf_plugin/requirements.txt: \n \033[0m") -with open(os.path.join(plugin_path, "requirements.txt"), "r") as f: - for line in f.readlines(): - print("\t\t\t" + line) +# print("\033[1m gltf_plugin/requirements.txt: \n \033[0m") +# with open(os.path.join(plugin_path, "requirements.txt"), "r") as f: +# for line in f.readlines(): +# print("\t\t\t" + line) # %% From 93f594af2ba123f4002ddb5d6903cf0933f518fe Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Mon, 16 Oct 2023 11:13:45 +0200 Subject: [PATCH 3/7] Raise on stderr --- .../02-python_operators_with_dependencies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/08-python-operators/02-python_operators_with_dependencies.py b/examples/08-python-operators/02-python_operators_with_dependencies.py index 26f7c93e822..691d31fc29a 100644 --- a/examples/08-python-operators/02-python_operators_with_dependencies.py +++ b/examples/08-python-operators/02-python_operators_with_dependencies.py @@ -149,7 +149,7 @@ import subprocess process = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - if process.returncode != 0 and process.stderr: + if process.stderr: raise RuntimeError( "Installing pygltf in a virtual environment failed with error:\n" + f"return code = {process.returncode}\n" From 1804fb57c7df1873f5604521e282256d1362863a Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Mon, 16 Oct 2023 11:39:54 +0200 Subject: [PATCH 4/7] Fix path expansion --- docs/source/user_guide/create_sites_for_python_operators.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/source/user_guide/create_sites_for_python_operators.ps1 b/docs/source/user_guide/create_sites_for_python_operators.ps1 index a0198fb2ab3..ecd7b8ccf1e 100644 --- a/docs/source/user_guide/create_sites_for_python_operators.ps1 +++ b/docs/source/user_guide/create_sites_for_python_operators.ps1 @@ -6,7 +6,10 @@ Write-Host "-pythonexe" $pythonexe Write-Host "-tempfolder" $tempfolder # Expand shortcut in path -$tempfolder = Resolve-Path -Path $tempfolder +Write-Host "Expand temp path" +Write-Host "Initial path" $tempfolder +$tempfolder = Resolve-Path -Path $tempfolder -Relative +Write-Host "New path" $tempfolder Write-Host "make venv" Start-Process $pythonexe -ArgumentList ("-m venv "+ $tempfolder+"\venv") -NoNewWindow -Wait From 5e6bba1954d98a1c924d2a7840fecae205803cf5 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Mon, 16 Oct 2023 11:46:36 +0200 Subject: [PATCH 5/7] Final fix for create_sites_for_python_operators.ps1 --- docs/source/user_guide/create_sites_for_python_operators.ps1 | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/source/user_guide/create_sites_for_python_operators.ps1 b/docs/source/user_guide/create_sites_for_python_operators.ps1 index ecd7b8ccf1e..86ada6f0439 100644 --- a/docs/source/user_guide/create_sites_for_python_operators.ps1 +++ b/docs/source/user_guide/create_sites_for_python_operators.ps1 @@ -6,10 +6,7 @@ Write-Host "-pythonexe" $pythonexe Write-Host "-tempfolder" $tempfolder # Expand shortcut in path -Write-Host "Expand temp path" -Write-Host "Initial path" $tempfolder $tempfolder = Resolve-Path -Path $tempfolder -Relative -Write-Host "New path" $tempfolder Write-Host "make venv" Start-Process $pythonexe -ArgumentList ("-m venv "+ $tempfolder+"\venv") -NoNewWindow -Wait From bdc35c0f55e64d4eedbb1327fd62aa984313cdec Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Mon, 16 Oct 2023 11:47:11 +0200 Subject: [PATCH 6/7] Revert "Remove superfluous prints" This reverts commit fb81e4a52e74b76f9fe5464f883135154e9deffb. --- .../02-python_operators_with_dependencies.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/08-python-operators/02-python_operators_with_dependencies.py b/examples/08-python-operators/02-python_operators_with_dependencies.py index 691d31fc29a..720de18daf9 100644 --- a/examples/08-python-operators/02-python_operators_with_dependencies.py +++ b/examples/08-python-operators/02-python_operators_with_dependencies.py @@ -56,20 +56,20 @@ folder_root = os.path.join(os.getcwd().rsplit("pydpf-core", 1)[0], "pydpf-core") source_path_in_repo = r"docs\source\examples\07-python-operators\plugins" operator_folder = os.path.join(folder_root, source_path_in_repo) -# print(operator_folder) +print(operator_folder) plugin_path = None for file in file_list: operator_file_path = os.path.join(operator_folder, file) - # print(f"\033[1m {file}\n \033[0m") + print(f"\033[1m {file}\n \033[0m") if ( os.path.splitext(file)[1] == ".py" or os.path.splitext(file)[1] == ".xml" ) and file != "gltf_plugin/gltf_export.py": - # with open(operator_file_path, "r") as f: - # for line in f.readlines(): - # print("\t\t\t" + line) - # print("\n\n") + with open(operator_file_path, "r") as f: + for line in f.readlines(): + print("\t\t\t" + line) + print("\n\n") if plugin_path is None: plugin_path = os.path.dirname(operator_file_path) @@ -91,10 +91,10 @@ # # To simplify this step, you can add a requirements file in the plug-in package: # -# print("\033[1m gltf_plugin/requirements.txt: \n \033[0m") -# with open(os.path.join(plugin_path, "requirements.txt"), "r") as f: -# for line in f.readlines(): -# print("\t\t\t" + line) +print("\033[1m gltf_plugin/requirements.txt: \n \033[0m") +with open(os.path.join(plugin_path, "requirements.txt"), "r") as f: + for line in f.readlines(): + print("\t\t\t" + line) # %% From 6a5195d03e8de8db6eeecbc7e1e444c235d1c6b2 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Mon, 16 Oct 2023 11:47:12 +0200 Subject: [PATCH 7/7] Revert "Only run gltf example" This reverts commit df37386371d3d8df6e54793ddb4061a36f0ee780. --- .ci/run_examples.py | 2 - .github/workflows/ci.yml | 332 +++++++++++++++++++-------------------- 2 files changed, 166 insertions(+), 168 deletions(-) diff --git a/.ci/run_examples.py b/.ci/run_examples.py index ff0abfa4691..c18a1d4d433 100644 --- a/.ci/run_examples.py +++ b/.ci/run_examples.py @@ -26,8 +26,6 @@ for file in glob.iglob(os.path.join(subdir, "*.py")): if sys.platform == "linux" and "08-python-operators" in file: continue - if "02-python_operators_with_dependencies" not in file: - continue print("\n--------------------------------------------------") print(file) minimum_version_str = get_example_required_minimum_dpf_version(file) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb5f412bc6c..2e87cf8506d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,131 +27,131 @@ env: 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) }} -# -# style: -# name: "Style Check" -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# -# - name: "Setup Python" -# uses: actions/setup-python@v4.6.0 -# with: -# python-version: ${{ env.MAIN_PYTHON_VERSION }} -# -# - name: "Install pre-commit" -# run: pip install pre-commit -# -# - name: "Run pre-commit" -# run: pre-commit run --all-files --show-diff-on-failure -# -# build_linux1: -# name: "Build linux1 wheel" -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# -# - 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@v3 -# with: -# name: ${{ steps.wheel.outputs.wheel_name }} -# path: dist/${{ steps.wheel.outputs.wheel_name }} -# -# tests: -# uses: ./.github/workflows/tests.yml -# with: -# ANSYS_VERSION: "241" -# python_versions: '["3.9"]' -# wheel: true -# wheelhouse: false -# standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} -# secrets: inherit -# -# tests_any: -# uses: ./.github/workflows/tests.yml -# with: -# ANSYS_VERSION: "241" -# python_versions: '["3.9"]' -# wheel: true -# wheelhouse: false -# standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} -# test_any: true -# secrets: inherit -# -# docker_tests: -# name: "Build and Test on Docker" -# uses: ./.github/workflows/test_docker.yml -# with: -# ANSYS_VERSION: "241" -# standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} -# secrets: inherit -# -# docker_examples: -# name: "Run examples on Docker" -# uses: ./.github/workflows/examples_docker.yml -# with: -# ANSYS_VERSION: "241" -# python_versions: '["3.9"]' -# standalone_suffix: ${{ github.event.inputs.standalone_branch_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 -# with: -# ANSYS_VERSION: "241" -# standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} -# event_name: ${{ github.event_name }} -# secrets: inherit -# -# upload-development-docs: -# runs-on: ubuntu-latest -# if: ${{ github.ref == 'refs/heads/master' }} -# needs: [docs] -# steps: -# - name: "Upload development documentation" -# uses: ansys/actions/doc-deploy-dev@v4 -# 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@v4 -# 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 + debug: + runs-on: ubuntu-latest + steps: + - name: Show the Github context for the triggered event + run: echo "$GITHUB_CONTEXT" + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + + style: + name: "Style Check" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: "Setup Python" + uses: actions/setup-python@v4.6.0 + with: + python-version: ${{ env.MAIN_PYTHON_VERSION }} + + - name: "Install pre-commit" + run: pip install pre-commit + + - name: "Run pre-commit" + run: pre-commit run --all-files --show-diff-on-failure + + build_linux1: + name: "Build linux1 wheel" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - 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@v3 + with: + name: ${{ steps.wheel.outputs.wheel_name }} + path: dist/${{ steps.wheel.outputs.wheel_name }} + + tests: + uses: ./.github/workflows/tests.yml + with: + ANSYS_VERSION: "241" + python_versions: '["3.9"]' + wheel: true + wheelhouse: false + standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} + secrets: inherit + + tests_any: + uses: ./.github/workflows/tests.yml + with: + ANSYS_VERSION: "241" + python_versions: '["3.9"]' + wheel: true + wheelhouse: false + standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} + test_any: true + secrets: inherit + + docker_tests: + name: "Build and Test on Docker" + uses: ./.github/workflows/test_docker.yml + with: + ANSYS_VERSION: "241" + standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} + secrets: inherit + + docker_examples: + name: "Run examples on Docker" + uses: ./.github/workflows/examples_docker.yml + with: + ANSYS_VERSION: "241" + python_versions: '["3.9"]' + standalone_suffix: ${{ github.event.inputs.standalone_branch_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 + with: + ANSYS_VERSION: "241" + standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} + event_name: ${{ github.event_name }} + secrets: inherit + + upload-development-docs: + runs-on: ubuntu-latest + if: ${{ github.ref == 'refs/heads/master' }} + needs: [docs] + steps: + - name: "Upload development documentation" + uses: ansys/actions/doc-deploy-dev@v4 + 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@v4 + 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 @@ -162,44 +162,44 @@ jobs: standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} 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 -# with: -# ANSYS_VERSION: "241" -# post_branch: "master" -# standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} -# test_docstrings: "true" -# 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 + with: + ANSYS_VERSION: "241" + post_branch: "master" + standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} + test_docstrings: "true" + secrets: inherit