From 291909b98f7e1b6a5b9e058dbf29159d27470bef Mon Sep 17 00:00:00 2001 From: margalva Date: Tue, 22 Sep 2026 14:46:21 -0700 Subject: [PATCH 1/4] Small improvements in workflows. Add a common place for shared values. Remove a non-existing label from dependabot --- .github/actions/load-visor-env/action.yml | 17 ++++++++++++++ .github/dependabot.yml | 7 ------ .github/workflows/build_and_package.yml | 28 +++++++++++++++-------- .github/workflows/check-pr-docs-build.yml | 11 +++++---- .github/workflows/nightly-docs.yml | 7 +++++- .github/workflows/nightly-tests.yml | 4 ---- .github/workflows/python-tests.yml | 6 ++--- 7 files changed, 50 insertions(+), 30 deletions(-) create mode 100644 .github/actions/load-visor-env/action.yml diff --git a/.github/actions/load-visor-env/action.yml b/.github/actions/load-visor-env/action.yml new file mode 100644 index 00000000..89e5ee17 --- /dev/null +++ b/.github/actions/load-visor-env/action.yml @@ -0,0 +1,17 @@ +name: "Load Visor env" +description: "Export shared Visor CI constants as env vars for downstream steps." + +runs: + using: "composite" + steps: + - name: Export shared env vars + shell: bash + run: | + { + echo "MAIN_PYTHON_VERSION=3.11" + echo "PACKAGE_NAME=ansys-visor-viewer" + echo "POETRY_VERSION=2.3.2" + echo "NODE_VERSION=22.12.0" + } >> "$GITHUB_ENV" + + diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9cd88dea..6d093df6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -19,7 +19,6 @@ updates: open-pull-requests-limit: 5 labels: - "maintenance" - - "dependencies" commit-message: prefix: "chore(actions):" groups: @@ -36,7 +35,6 @@ updates: open-pull-requests-limit: 5 labels: - "maintenance" - - "dependencies" commit-message: prefix: "build(deps):" ignore: @@ -64,7 +62,6 @@ updates: open-pull-requests-limit: 3 labels: - "maintenance" - - "dependencies" commit-message: prefix: "build(npm):" ignore: @@ -88,7 +85,6 @@ updates: open-pull-requests-limit: 3 labels: - "maintenance" - - "dependencies" commit-message: prefix: "build(dash):" ignore: @@ -112,7 +108,6 @@ updates: open-pull-requests-limit: 2 labels: - "maintenance" - - "dependencies" commit-message: prefix: "build(docker):" groups: @@ -129,7 +124,6 @@ updates: open-pull-requests-limit: 2 labels: - "maintenance" - - "dependencies" commit-message: prefix: "build(docker):" groups: @@ -146,7 +140,6 @@ updates: open-pull-requests-limit: 2 labels: - "maintenance" - - "dependencies" commit-message: prefix: "build(docker):" groups: diff --git a/.github/workflows/build_and_package.yml b/.github/workflows/build_and_package.yml index 0861b51a..a8eade59 100644 --- a/.github/workflows/build_and_package.yml +++ b/.github/workflows/build_and_package.yml @@ -12,10 +12,6 @@ on: branches: - main env: - MAIN_PYTHON_VERSION: "3.11" - POETRY_VERSION: "2.3.2" - PACKAGE_NAME: "ansys-visor-viewer" - # For Solutions private PyPI: POETRY_HTTP_BASIC_SOLUTIONS_PRIVATE_PYPI_USERNAME: "PAT" POETRY_HTTP_BASIC_SOLUTIONS_PRIVATE_PYPI_PASSWORD: ${{ secrets.SOLUTIONS_PRIVATE_PYPI_PASSWORD }} @@ -46,15 +42,18 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Load Visor env + uses: ./.github/actions/load-visor-env + - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ env.MAIN_PYTHON_VERSION }} - name: Set up Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: - node-version: '22.12.0' + node-version: ${{ env.NODE_VERSION }} - name: Install visor-client npm dependencies working-directory: src/ansys/visor/visor-client @@ -86,9 +85,12 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Load Visor env + uses: ./.github/actions/load-visor-env + # Set up Python - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ env.MAIN_PYTHON_VERSION }} @@ -116,9 +118,9 @@ jobs: # Node.js package build - name: Set up Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: - node-version: '22.12.0' + node-version: ${{ env.NODE_VERSION }} - name: Install visor-client npm dependencies working-directory: src/ansys/visor/visor-client @@ -235,6 +237,12 @@ jobs: id-token: write # required for release to github contents: write # required to create releases steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Load Visor env + uses: ./.github/actions/load-visor-env + - name: "Download the library artifacts from build-library step" uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: diff --git a/.github/workflows/check-pr-docs-build.yml b/.github/workflows/check-pr-docs-build.yml index 059776b8..bc5e7ad5 100644 --- a/.github/workflows/check-pr-docs-build.yml +++ b/.github/workflows/check-pr-docs-build.yml @@ -10,11 +10,6 @@ on: - main -env: - DOCUMENTATION_CNAME: 'visor.docs.pyansys.com' - MAIN_PYTHON_VERSION: '3.11' - - concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -25,6 +20,12 @@ jobs: name: Build docs runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Load Visor env + uses: ./.github/actions/load-visor-env + # Install Xvfb and Mesa for headless OpenGL rendering (needed for VTK and similar libraries) - name: Install Xvfb and Mesa run: | diff --git a/.github/workflows/nightly-docs.yml b/.github/workflows/nightly-docs.yml index 5cb4c165..a673f5c5 100644 --- a/.github/workflows/nightly-docs.yml +++ b/.github/workflows/nightly-docs.yml @@ -10,7 +10,6 @@ on: env: DOCUMENTATION_CNAME: 'visor.docs.pyansys.com' - MAIN_PYTHON_VERSION: '3.11' GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} concurrency: @@ -22,6 +21,12 @@ jobs: name: Build docs runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Load Visor env + uses: ./.github/actions/load-visor-env + # Install Xvfb and Mesa for headless OpenGL rendering (needed for VTK and similar libraries) - name: Install Xvfb and Mesa run: | diff --git a/.github/workflows/nightly-tests.yml b/.github/workflows/nightly-tests.yml index 68e4fb16..dc2ef75f 100644 --- a/.github/workflows/nightly-tests.yml +++ b/.github/workflows/nightly-tests.yml @@ -5,10 +5,6 @@ on: - cron: '0 23 * * *' workflow_dispatch: -env: - MAIN_PYTHON_VERSION: '3.11' - - jobs: nightly_test: name: Testing diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 34bdae09..21d04e85 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -14,9 +14,6 @@ on: permissions: contents: read -env: - POETRY_VERSION: '2.3.2' - jobs: test: runs-on: ubuntu-latest @@ -29,6 +26,9 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Load Visor env + uses: ./.github/actions/load-visor-env + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: From 32c52bbd7631005d5571dc53308db8c6b2bbdff7 Mon Sep 17 00:00:00 2001 From: margalva Date: Wed, 23 Sep 2026 09:04:34 -0700 Subject: [PATCH 2/4] Simplify by eliminating a checkout --- .github/workflows/build_and_package.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_and_package.yml b/.github/workflows/build_and_package.yml index a8eade59..221412f3 100644 --- a/.github/workflows/build_and_package.yml +++ b/.github/workflows/build_and_package.yml @@ -222,6 +222,7 @@ jobs: outputs: package_version: ${{ steps.set_package_version.outputs.package_version }} + package_name: ${{ env.PACKAGE_NAME }} release: name: Release project @@ -237,31 +238,25 @@ jobs: id-token: write # required for release to github contents: write # required to create releases steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Load Visor env - uses: ./.github/actions/load-visor-env - - name: "Download the library artifacts from build-library step" uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - name: ${{ env.PACKAGE_NAME }}-artifacts - path: ${{ env.PACKAGE_NAME }}-artifacts + name: ${{ needs.build.outputs.package_name }}-artifacts + path: ${{ needs.build.outputs.package_name }}-artifacts - name: "Upload artifacts to PyPI using trusted publisher" uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 with: repository-url: "https://upload.pypi.org/legacy/" print-hash: true - packages-dir: ${{ env.PACKAGE_NAME }}-artifacts + packages-dir: ${{ needs.build.outputs.package_name }}-artifacts skip-existing: false - name: Release to GitHub uses: ansys/actions/release-github@7e89e00c5619374a1da8c2e876309d8b15ff0559 # v11.0.3 with: token: ${{ secrets.GITHUB_TOKEN }} - library-name: ${{ env.PACKAGE_NAME }} + library-name: ${{ needs.build.outputs.package_name }} only-code: true From 7e1b7cf2f2c70e9d8504f9e87a80d8a09f69a410 Mon Sep 17 00:00:00 2001 From: margalva Date: Wed, 23 Sep 2026 09:16:21 -0700 Subject: [PATCH 3/4] Remove unnecessary check outs --- .github/workflows/check-pr-docs-build.yml | 1 + .github/workflows/nightly-docs.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/check-pr-docs-build.yml b/.github/workflows/check-pr-docs-build.yml index bc5e7ad5..05526fbc 100644 --- a/.github/workflows/check-pr-docs-build.yml +++ b/.github/workflows/check-pr-docs-build.yml @@ -46,6 +46,7 @@ jobs: DISPLAY: ":99" # Use the virtual X server started by Xvfb VTK_DEFAULT_RENDER_WINDOW_OFFSCREEN: "1" # Force VTK to use offscreen rendering with: + checkout: false python-version: ${{ env.MAIN_PYTHON_VERSION }} check-links: false sphinxopts: '-j auto' diff --git a/.github/workflows/nightly-docs.yml b/.github/workflows/nightly-docs.yml index a673f5c5..564b5833 100644 --- a/.github/workflows/nightly-docs.yml +++ b/.github/workflows/nightly-docs.yml @@ -47,6 +47,7 @@ jobs: DISPLAY: ":99" # Use the virtual X server started by Xvfb VTK_DEFAULT_RENDER_WINDOW_OFFSCREEN: "1" # Force VTK to use offscreen rendering with: + checkout: false python-version: ${{ env.MAIN_PYTHON_VERSION }} check-links: false sphinxopts: '-j auto' From cf323cf52ec2bab737bb12f05df90360f3f987a3 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Wed, 23 Sep 2026 16:40:40 +0000 Subject: [PATCH 4/4] chore: adding changelog file 141.maintenance.md [dependabot-skip] --- doc/changelog.d/141.maintenance.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/141.maintenance.md diff --git a/doc/changelog.d/141.maintenance.md b/doc/changelog.d/141.maintenance.md new file mode 100644 index 00000000..e03dfaf7 --- /dev/null +++ b/doc/changelog.d/141.maintenance.md @@ -0,0 +1 @@ +Add a composite action to simplify workflows