From eb0a196b64986639a061ec913cf1dad5f672ebab Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:00:53 +0100 Subject: [PATCH 01/16] ci: updating ci_cd.yml --- .github/workflows/ci_cd.yml | 132 ++++++++++-------------------- .github/workflows/label.yml | 16 ++-- requirements/requirements_doc.txt | 2 +- 3 files changed, 50 insertions(+), 100 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 2f33dc64a..2ff49c41c 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -19,28 +19,35 @@ env: MAPDL_IMAGE_VERSION_DOCS_BUILD: v24.2-ubuntu ON_CI: True PYANSYS_OFF_SCREEN: True - RESET_EXAMPLES_CACHE: 0 - RESET_DOC_BUILD_CACHE: 0 - USE_CACHE: False concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -permissions: - contents: write - pull-requests: write - packages: read +permissions: {} jobs: + actions-security: + name: "Check actions security" + runs-on: ubuntu-latest + steps: + - uses: ansys/actions/check-actions-security@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4 + with: + generate-summary: true + token: ${{ secrets.GITHUB_TOKEN }} + auditing-level: 'high' + trust-ansys-actions: true + code-style: name: "Code style" runs-on: ubuntu-latest + permissions: + contents: read steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ env.MAIN_PYTHON_VERSION }} - name: Install dependencies @@ -53,9 +60,11 @@ jobs: doc-style: name: "Documentation Style Check" runs-on: ubuntu-latest + permissions: + contents: read steps: - name: "PyAnsys documentation style checks" - uses: ansys/actions/doc-style@v10 + uses: ansys/actions/doc-style@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4 with: token: ${{ secrets.GITHUB_TOKEN }} @@ -63,6 +72,8 @@ jobs: name: "Documentation building" needs: [code-style, doc-style] timeout-minutes: 60 + permissions: + contents: read outputs: PYMAPDL_VERSION: ${{ steps.version.outputs.PYMAPDL_VERSION }} runs-on: ubuntu-22.04 @@ -74,10 +85,10 @@ jobs: steps: - name: "Install Git and checkout project" - uses: actions/checkout@v4 + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 - name: "Login in Github Container registry" - uses: docker/login-action@v3.6.0 + uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 with: registry: ghcr.io username: ${{ github.actor }} @@ -104,13 +115,6 @@ jobs: sudo apt-get update sudo apt install zip pandoc libgl1-mesa-glx xvfb texlive-latex-extra latexmk graphviz texlive-xetex libgomp1 - - name: "Set up Python using cache" - uses: actions/setup-python@v5 - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - cache: 'pip' - cache-dependency-path: 'requirements/requirements_doc.txt' - - name: "Install Python requirements" run: | pip uninstall ansys-mapdl-core @@ -126,31 +130,13 @@ jobs: echo "PYMAPDL_VERSION=$(python -c 'from ansys.mapdl.core import __version__; print(__version__)')" >> $GITHUB_OUTPUT echo "PyMAPDL version is: $(python -c "from ansys.mapdl.core import __version__; print(__version__)")" - - name: "Cache Verification Manual examples" - uses: actions/cache@v4 - if: env.USE_CACHE == true - with: - path: doc/source/verif-manual - key: Examples-v${{ env.RESET_EXAMPLES_CACHE }}-${{ steps.version.outputs.PYMAPDL_VERSION }}-${{ github.sha }} - restore-keys: | - Examples-v${{ env.RESET_EXAMPLES_CACHE }}-${{ steps.version.outputs.PYMAPDL_VERSION }} - - - name: "Cache docs build directory" - uses: actions/cache@v4 - if: env.USE_CACHE == true - with: - path: doc/_build - key: doc-build-v${{ env.RESET_DOC_BUILD_CACHE }}-${{ env.PYMAPDL_VERSION }}-${{ github.sha }} - restore-keys: | - doc-build-v${{ env.RESET_DOC_BUILD_CACHE }}-${{ env.PYMAPDL_VERSION }} - - name: "Waiting for the services to be up" timeout-minutes: 15 run: | .ci/waiting_services.sh - name: "Run Ansys documentation building action" - uses: ansys/actions/doc-build@v10 + uses: ansys/actions/doc-build@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4 env: LIBGL_ALWAYS_SOFTWARE: 1 PYANSYS_VISUALIZER_HTML_BACKEND: true @@ -160,19 +146,8 @@ jobs: checkout: false skip-install: true sphinxopts: -j auto - use-python-cache: False check-links: False - - name: "Deploy" - if: contains(github.ref, 'refs/heads/main') - uses: JamesIves/github-pages-deploy-action@v4.7.3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - branch: gh-pages - folder: doc/_build/html - clean: true - single-commit: true - - name: "Display Docker files structures" if: always() env: @@ -190,54 +165,29 @@ jobs: run: | .ci/collect_mapdl_logs.sh - - name: "Tar logs" - if: always() - run: | - cp -f doc/_build/latex/*.log ./logs-build-docs/ - cp log.txt ./logs-build-docs/ - tar cvzf ./logs-build-docs.tgz ./logs-build-docs - - - name: "Upload logs to GitHub" - if: always() - uses: actions/upload-artifact@v4 - with: - name: logs-build-docs.tgz - path: ./logs-build-docs.tgz - - name: "Display MAPDL Logs" if: always() - run: cat log.txt + run: cat logs-build-docs/* || echo "No logs collected." - - name: "List main files" + - name: "Stop MAPDL service" if: always() run: | - if compgen -G 'doc/_build/latex/*.log' > /dev/null ;then for f in doc/_build/latex/*.log; do echo "::group:: Output latex log file $f" && cat $f && echo "::endgroup::" ; done; fi - if compgen -G './logs-build-docs/*.err' > /dev/null ;then for f in ./logs-build-docs/*.err; do echo "::group:: Error file $f" && cat $f && echo "::endgroup::" ; done; fi - if compgen -G './logs-build-docs/*.log' > /dev/null ;then for f in ./logs-build-docs/*.log; do echo "::group:: Log file $f" && cat $f && echo "::endgroup::" ; done; fi - if compgen -G './logs-build-docs/*.out' > /dev/null ;then for f in ./logs-build-docs/*.out; do echo "::group:: Output file $f" && cat $f && echo "::endgroup::" ; done; fi + echo "Stopping MAPDL services" + pymapdl stop --all - release: - if: github.event_name == 'refs/heads/main' && !contains(github.ref, 'refs/tags') - needs: [doc-build] + + upload-docs: + name: "Upload documentation" + if: github.ref == 'refs/heads/main' && !contains(github.ref, 'refs/tags') runs-on: ubuntu-latest + permissions: + contents: write + needs: [doc-build] steps: - - uses: actions/checkout@v4 - - - uses: actions/download-artifact@v5 - - - name: Display structure of downloaded files - run: ls -R - - - name: Zip HTML documentation - uses: vimtor/action-zip@v1.2 + - name: "Deploy documentation to GitHub Pages" + uses: ansys/actions/doc-deploy-dev@c2fa7c93f6883114e0e643599431b33d29f0b13f #v10.1.4 with: - files: documentation-html - dest: documentation-html.zip - - - name: Release - uses: softprops/action-gh-release@v2 - with: - generate_release_notes: true - files: | - ./documentation-html.zip - ./documentation-pdf/*.pdf + cname: ${{ env.DOCUMENTATION_CNAME }} + token: ${{ secrets.GITHUB_TOKEN }} + bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} + bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index 7e533d8c2..0565bd005 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -16,8 +16,8 @@ jobs: name: Syncer runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: micnncim/action-label-syncer@v1 + - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 + - uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -32,20 +32,20 @@ jobs: # Label based on modified files - name: Label based on changed files - uses: actions/labeler@v5 + uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} sync-labels: true # Label based on branch name - - uses: actions-ecosystem/action-add-labels@v1 + - uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1.1.3 if: | startsWith(github.event.pull_request.head.ref, 'doc') || startsWith(github.event.pull_request.head.ref, 'docs') with: labels: documentation - - uses: actions-ecosystem/action-add-labels@v1 + - uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1.1.3 if: | startsWith(github.event.pull_request.head.ref, 'maint') || startsWith(github.event.pull_request.head.ref, 'no-ci') || @@ -53,13 +53,13 @@ jobs: with: labels: maintenance - - uses: actions-ecosystem/action-add-labels@v1 + - uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1.1.3 if: startsWith(github.event.pull_request.head.ref, 'feat') with: labels: | enhancement - - uses: actions-ecosystem/action-add-labels@v1 + - uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1.1.3 if: | startsWith(github.event.pull_request.head.ref, 'fix') || startsWith(github.event.pull_request.head.ref, 'patch') @@ -70,7 +70,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Suggest to add labels - uses: peter-evans/create-or-update-comment@v4 + uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0 # Execute only when no labels have been applied to the pull request if: toJSON(github.event.pull_request.labels.*.name) == '{}' with: diff --git a/requirements/requirements_doc.txt b/requirements/requirements_doc.txt index 782a52eb3..01cd01f6a 100644 --- a/requirements/requirements_doc.txt +++ b/requirements/requirements_doc.txt @@ -1,2 +1,2 @@ -#PyMAPDL dependencies and documentation requirements +# PyMAPDL dependencies and documentation requirements git+https://github.com/ansys/pymapdl.git#egg=ansys-mapdl-core[graphics,doc] From 2a311dba1bbd01d4293f83f6a145e4b478b750db Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:03:37 +0100 Subject: [PATCH 02/16] fix: checkout credentials --- .github/workflows/ci_cd.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 2ff49c41c..864a7caf9 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -50,6 +50,7 @@ jobs: uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ env.MAIN_PYTHON_VERSION }} + persist-credentials: false - name: Install dependencies run: | python -m pip install --upgrade pip tox @@ -86,6 +87,8 @@ jobs: steps: - name: "Install Git and checkout project" uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 + with: + persist-credentials: false - name: "Login in Github Container registry" uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 From ab801381dd1087f952e8b32849f1d1de944c984f Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:06:38 +0100 Subject: [PATCH 03/16] fix: label permissions --- .github/workflows/label.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index 0565bd005..cb39f33f4 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -10,11 +10,16 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +permissions: {} + jobs: label-syncer: name: Syncer runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write steps: - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 - uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0 @@ -68,6 +73,9 @@ jobs: commenter: runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write steps: - name: Suggest to add labels uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0 From 4cf5ea0d8bb7156b006e185de4859699c1a7777f Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:09:59 +0100 Subject: [PATCH 04/16] fix: env variable --- .github/workflows/ci_cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 864a7caf9..d79d2a8f3 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -111,7 +111,7 @@ jobs: - name: "DPF Server Activation" run: | - $(docker pull ghcr.io/ansys/dpf-core:22.2dev && docker run -d --name dpfserver -p ${{ env.DPF_PORT }}:50052 ghcr.io/ansys/dpf-core:22.2dev && echo "DPF Server active on port ${{ env.DPF_PORT }}.") & + $(docker pull ghcr.io/ansys/dpf-core:22.2dev && docker run -d --name dpfserver -p ${DPF_PORT}:50052 ghcr.io/ansys/dpf-core:22.2dev && echo "DPF Server active on port ${DPF_PORT}.") & - name: "Install OS packages" run: | From ec23265fa2ec83dd458ccb8053cfbc55b557b74e Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:12:12 +0100 Subject: [PATCH 05/16] fix: code style action --- .github/workflows/ci_cd.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index d79d2a8f3..adef0bf95 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -40,22 +40,11 @@ jobs: trust-ansys-actions: true code-style: - name: "Code style" + name: "Running code style checks" runs-on: ubuntu-latest - permissions: - contents: read steps: - - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 - - name: Set up Python - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - persist-credentials: false - - name: Install dependencies - run: | - python -m pip install --upgrade pip tox - - name: Test with tox - run: tox -e style + - name: "Run PyAnsys code style checks" + uses: ansys/actions/code-style@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4 doc-style: From 9d58b3bd76962e214e867a6b8cb3e012341f31f6 Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:15:25 +0100 Subject: [PATCH 06/16] ci: update ``label.yml`` --- .github/workflows/label.yml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index cb39f33f4..7973128ee 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -15,19 +15,23 @@ permissions: {} jobs: label-syncer: - name: Syncer + name: ""Syncer" runs-on: ubuntu-latest permissions: contents: read pull-requests: write steps: - - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 - - uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0 + - name: "Install Git and checkout project" + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 + with: + persist-credentials: false + - name : "Sync labels" + uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} labeler: - name: Set labels + name: "Set labels" needs: [label-syncer] permissions: contents: read @@ -36,21 +40,23 @@ jobs: steps: # Label based on modified files - - name: Label based on changed files + - name: "Label based on changed files" uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} sync-labels: true # Label based on branch name - - uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1.1.3 + - name: "Label based on branch name - docs" + uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1.1.3 if: | startsWith(github.event.pull_request.head.ref, 'doc') || startsWith(github.event.pull_request.head.ref, 'docs') with: labels: documentation - - uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1.1.3 + - name: "Label based on branch name - maintenance" + uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1.1.3 if: | startsWith(github.event.pull_request.head.ref, 'maint') || startsWith(github.event.pull_request.head.ref, 'no-ci') || @@ -58,13 +64,15 @@ jobs: with: labels: maintenance - - uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1.1.3 + - name: "Label based on branch name - enhancement" + uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1.1.3 if: startsWith(github.event.pull_request.head.ref, 'feat') with: labels: | enhancement - - uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1.1.3 + - name: "Label based on branch name - bug" + uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1.1.3 if: | startsWith(github.event.pull_request.head.ref, 'fix') || startsWith(github.event.pull_request.head.ref, 'patch') @@ -77,7 +85,7 @@ jobs: contents: read pull-requests: write steps: - - name: Suggest to add labels + - name: "Suggest to add labels" uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0 # Execute only when no labels have been applied to the pull request if: toJSON(github.event.pull_request.labels.*.name) == '{}' From 95375daab7a0b884a2ab397900624d81aaed6ca6 Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:18:34 +0100 Subject: [PATCH 07/16] fix: title --- .github/workflows/label.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index 7973128ee..ed43988b9 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -15,7 +15,7 @@ permissions: {} jobs: label-syncer: - name: ""Syncer" + name: "Syncer" runs-on: ubuntu-latest permissions: contents: read From ff67a8c6ef470e482f3022b28d6bd66527011fc1 Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:19:45 +0100 Subject: [PATCH 08/16] ci: adding name to label job --- .github/workflows/label.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index ed43988b9..93ae6d501 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -80,6 +80,7 @@ jobs: labels: bug commenter: + name: "Commenter" runs-on: ubuntu-latest permissions: contents: read From cb42b65c551a2f5ee32f6d3237ba75526aba0e95 Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:21:27 +0100 Subject: [PATCH 09/16] fix: pre-commit auto-update --- .pre-commit-config.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 51cc30559..c61389da2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,20 +1,20 @@ repos: - repo: https://github.com/ansys/pre-commit-hooks - rev: v0.2.8 + rev: v0.5.2 hooks: - id: add-license-headers args: - --start_year=2022 - repo: https://github.com/psf/black - rev: 22.10.0 + rev: 25.9.0 hooks: - id: black args: ["doc/source/conf.py"] - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 7.0.0 hooks: - id: isort args: [ @@ -24,23 +24,23 @@ repos: ] - repo: https://github.com/PyCQA/flake8 - rev: 5.0.4 + rev: 7.3.0 hooks: - id: flake8 - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.4.1 hooks: - id: codespell - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v6.0.0 hooks: - id: check-merge-conflict - id: debug-statements - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.21.0 + rev: 0.34.1 hooks: - id: check-github-workflows name: "Check GitHub workflows" From 17e91c4eb727babaa884b6803eec7e7584198e6e Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:21:54 +0100 Subject: [PATCH 10/16] fix: pre-commit --- doc/source/conf.py | 1 + .../21-example-technology-showcase-buckling.py | 14 +++++++------- examples/verif-manual/vm-006-pinched_cylinder.py | 8 ++++++++ ...m-007-plastic_compression_of_a_pipe_assembly.py | 5 ++++- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 5bcc5eaa6..adf36b288 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -1,4 +1,5 @@ """Sphinx documentation configuration file.""" + from datetime import datetime import os diff --git a/examples/tech-demos/21-example-technology-showcase-buckling.py b/examples/tech-demos/21-example-technology-showcase-buckling.py index fdc6eefb4..5b7a74848 100644 --- a/examples/tech-demos/21-example-technology-showcase-buckling.py +++ b/examples/tech-demos/21-example-technology-showcase-buckling.py @@ -227,7 +227,7 @@ ) print("End static prestress analysis") -#%% +# %% ############################################################################### # Run linear buckling analysis # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -263,7 +263,7 @@ ) print("End linear buckling analysis") -#%% +# %% ############################################################################### # Generate imperfections # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -290,7 +290,7 @@ mapdl.finish() print("Finish adding imperfections") -#%% +# %% ############################################################################### # Run nonlinear static analysis on geometry with imperfections # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -320,7 +320,7 @@ print("End nonlinear static analysis on imperfect geometry") -#%% +# %% ############################################################################### # Post-buckling analysis # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -348,7 +348,7 @@ print("End of post-buckling analysis run") -#%% +# %% ############################################################################### # Postprocess buckling analysis in POST1 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -363,7 +363,7 @@ mapdl.post_processing.plot_nodal_eqv_stress(savefig="nodal_stress_post_buckling.png") mapdl.finish() print("End POST1 postprocessing of post-buckling analysis") -#%% +# %% ############################################################################### # Postprocess buckling analysis in POST26 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -426,7 +426,7 @@ print("End POST26 postprocessing of post-buckling analysis") -#%% +# %% ############################################################################### # Exit MAPDL # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/examples/verif-manual/vm-006-pinched_cylinder.py b/examples/verif-manual/vm-006-pinched_cylinder.py index 3f6dfed93..2ee4be303 100644 --- a/examples/verif-manual/vm-006-pinched_cylinder.py +++ b/examples/verif-manual/vm-006-pinched_cylinder.py @@ -97,6 +97,7 @@ def start_prep7(): # ~~~~~~~~~~~~~~~~~~~ # Set up the element type (a shell-type). + # Define the element type number. def define_element(elem_type): # Type of analysis: Static. @@ -143,6 +144,7 @@ def define_element(elem_type): # Define material number. mat_num = 1 + # Define material properties. def define_material(): # Define material properties. @@ -164,6 +166,7 @@ def define_material(): sec_num = 1 t = 0.094 + # Define shell cross-section. def define_section(): # Define shell cross-section. @@ -181,6 +184,7 @@ def define_section(): # ~~~~~~~~~~~~~~~ # Set up the keypoints and create the area through the keypoints. + # Define geometry of the simplified mathematical model. def define_geometry(): # Change active coordinate system @@ -232,6 +236,7 @@ def keypoint_number(mapdl): # ~~~~~~~ # Define line division of the lines, then mesh the area with shell elements. + # Define mesh properties and create the mesh with shell elements. def meshing(): # Specify the default number of line divisions. @@ -275,6 +280,7 @@ def meshing(): # ~~~~~~~~~~~~~~~~~~~~~~~~~~ # Application of symmetric boundary conditions for simplified model. + # Select nodes by location and apply BC. def define_bc(): # Select nodes by location and apply BC. @@ -295,6 +301,7 @@ def define_bc(): # ~~~~~~~~~~~~~~~~~~~~~~~~ # Apply the force of :math:`F = (100/4) lb` in the y-direction. + # Define loads. def define_loads(): # Parametrization of the :math:`F` load for the quarter of the model. @@ -331,6 +338,7 @@ def solve_procedure(): # Plotting nodal displacement. # Get the the radial displacement at the node where force F is applied. + # Start post-processing mode. def post_processing(): mapdl.post1() diff --git a/examples/verif-manual/vm-007-plastic_compression_of_a_pipe_assembly.py b/examples/verif-manual/vm-007-plastic_compression_of_a_pipe_assembly.py index 6939283ef..890974f84 100644 --- a/examples/verif-manual/vm-007-plastic_compression_of_a_pipe_assembly.py +++ b/examples/verif-manual/vm-007-plastic_compression_of_a_pipe_assembly.py @@ -438,6 +438,7 @@ # Start solution procedure. mapdl.slashsolu() + # Define solution function. def solution(deflect): mapdl.nsel("R", "LOC", "Z", 10) @@ -583,7 +584,9 @@ def getload(): row_indexing = pd.MultiIndex.from_tuples(row_tuple) df = pd.DataFrame(main_columns, index=row_indexing) -df.style.set_caption("Results Comparison",).set_table_styles( +df.style.set_caption( + "Results Comparison", +).set_table_styles( [ { "selector": "th.col_heading", From 7d9d8c5526bdba9c1ff9ae5c2f77bc71a02e27ef Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:24:33 +0100 Subject: [PATCH 11/16] fix: pre-commit - 2 --- examples/verif-manual/vm-299.py | 2 +- examples/verif-manual/vm-nr1677-01-1a.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/verif-manual/vm-299.py b/examples/verif-manual/vm-299.py index fcdc95a04..63ab58e80 100644 --- a/examples/verif-manual/vm-299.py +++ b/examples/verif-manual/vm-299.py @@ -275,7 +275,7 @@ SPL_4 = 10 * (math.log10(x4)) SPL_5 = 10 * (math.log10(x5)) -# Fill the target tesult values in array +# Fill the target result values in array target_ref = np.array([80.0, 79.0, 77.5, 76.0, 74.5]) # Fill the simulated result values in array diff --git a/examples/verif-manual/vm-nr1677-01-1a.py b/examples/verif-manual/vm-nr1677-01-1a.py index df89b89dd..e5df04410 100644 --- a/examples/verif-manual/vm-nr1677-01-1a.py +++ b/examples/verif-manual/vm-nr1677-01-1a.py @@ -499,8 +499,8 @@ # Print table print( - f"""------------------- VM-NR1677-01-1-a.1 RESULTS COMPARISON --------------------- -{tabulate(data_freq, headers=headers, tablefmt="grid")} + f"""------------------- VM-NR1677-01-1-a.1 RESULTS COMPARISON --------------------- +{tabulate(data_freq, headers=headers, tablefmt="grid")} """ ) @@ -543,8 +543,8 @@ # Print table print( - f""" -{tabulate(data_freq, headers=headers, tablefmt="grid")} + f""" +{tabulate(data_freq, headers=headers, tablefmt="grid")} """ ) From ce976ba28fceb0753485b537ffeba1f181554847 Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:48:04 +0100 Subject: [PATCH 12/16] ci: fix setup python --- .github/workflows/ci_cd.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index adef0bf95..27fc821e3 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -79,6 +79,12 @@ jobs: with: persist-credentials: false + - name: "Setup Python without cache" + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c #v6.0.0 + if: steps.changes.outputs.workflows == 'true' + with: + python-version: ${{ env.MAIN_PYTHON_VERSION }} + - name: "Login in Github Container registry" uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 with: From fbf10cad2c79e36313e7448d47688ae8785c3e0a Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:48:21 +0100 Subject: [PATCH 13/16] fix: typo --- .github/workflows/ci_cd.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 27fc821e3..03c8ff1c1 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -81,7 +81,6 @@ jobs: - name: "Setup Python without cache" uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c #v6.0.0 - if: steps.changes.outputs.workflows == 'true' with: python-version: ${{ env.MAIN_PYTHON_VERSION }} From d850d075ca210b780940dcda6045c19e7be2b7cc Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:57:20 +0100 Subject: [PATCH 14/16] fix: cicd title --- .github/workflows/ci_cd.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 03c8ff1c1..910157ebf 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -29,7 +29,7 @@ permissions: {} jobs: actions-security: - name: "Check actions security" + name: "Action security check" runs-on: ubuntu-latest steps: - uses: ansys/actions/check-actions-security@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4 @@ -40,7 +40,7 @@ jobs: trust-ansys-actions: true code-style: - name: "Running code style checks" + name: "Code style checks" runs-on: ubuntu-latest steps: - name: "Run PyAnsys code style checks" @@ -48,7 +48,7 @@ jobs: doc-style: - name: "Documentation Style Check" + name: "Documentation style check" runs-on: ubuntu-latest permissions: contents: read From 1a89a5fe4c88133635cf8c78e05106b0c0624571 Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:58:08 +0100 Subject: [PATCH 15/16] fix: typo --- .github/workflows/ci_cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 910157ebf..24e6c93b5 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -29,7 +29,7 @@ permissions: {} jobs: actions-security: - name: "Action security check" + name: "Action security checks" runs-on: ubuntu-latest steps: - uses: ansys/actions/check-actions-security@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4 From 7e90b1c17a1bc330c94c2d5920df77c19a29b926 Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Fri, 31 Oct 2025 17:11:25 +0100 Subject: [PATCH 16/16] fix: updating ``MAPDL_IMAGE_VERSION_DOCS_BUILD`` --- .github/workflows/ci_cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 24e6c93b5..17bbd2f80 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -16,7 +16,7 @@ env: DPF_START_SERVER: False MAIN_PYTHON_VERSION: '3.12' MAPDL_PACKAGE: ghcr.io/ansys/mapdl - MAPDL_IMAGE_VERSION_DOCS_BUILD: v24.2-ubuntu + MAPDL_IMAGE_VERSION_DOCS_BUILD: v25.2-ubuntu-amd ON_CI: True PYANSYS_OFF_SCREEN: True @@ -66,7 +66,7 @@ jobs: contents: read outputs: PYMAPDL_VERSION: ${{ steps.version.outputs.PYMAPDL_VERSION }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest env: PYMAPDL_PORT: 21000 # default won't work on GitHub runners PYMAPDL_DB_PORT: 21001 # default won't work on GitHub runners