Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/actions/load-visor-env/action.yml
Original file line number Diff line number Diff line change
@@ -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"


7 changes: 0 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ updates:
open-pull-requests-limit: 5
labels:
- "maintenance"
- "dependencies"
commit-message:
prefix: "chore(actions):"
groups:
Expand All @@ -36,7 +35,6 @@ updates:
open-pull-requests-limit: 5
labels:
- "maintenance"
- "dependencies"
commit-message:
prefix: "build(deps):"
ignore:
Expand Down Expand Up @@ -64,7 +62,6 @@ updates:
open-pull-requests-limit: 3
labels:
- "maintenance"
- "dependencies"
commit-message:
prefix: "build(npm):"
ignore:
Expand All @@ -88,7 +85,6 @@ updates:
open-pull-requests-limit: 3
labels:
- "maintenance"
- "dependencies"
commit-message:
prefix: "build(dash):"
ignore:
Expand All @@ -112,7 +108,6 @@ updates:
open-pull-requests-limit: 2
labels:
- "maintenance"
- "dependencies"
commit-message:
prefix: "build(docker):"
groups:
Expand All @@ -129,7 +124,6 @@ updates:
open-pull-requests-limit: 2
labels:
- "maintenance"
- "dependencies"
commit-message:
prefix: "build(docker):"
groups:
Expand All @@ -146,7 +140,6 @@ updates:
open-pull-requests-limit: 2
labels:
- "maintenance"
- "dependencies"
commit-message:
prefix: "build(docker):"
groups:
Expand Down
31 changes: 17 additions & 14 deletions .github/workflows/build_and_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 }}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -220,6 +222,7 @@ jobs:

outputs:
package_version: ${{ steps.set_package_version.outputs.package_version }}
package_name: ${{ env.PACKAGE_NAME }}

release:
name: Release project
Expand All @@ -238,22 +241,22 @@ jobs:
- 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


Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/check-pr-docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand All @@ -45,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'
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/nightly-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:

env:
DOCUMENTATION_CNAME: 'visor.docs.pyansys.com'
MAIN_PYTHON_VERSION: '3.11'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

concurrency:
Expand All @@ -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: |
Expand All @@ -42,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'
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/nightly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ on:
- cron: '0 23 * * *'
workflow_dispatch:

env:
MAIN_PYTHON_VERSION: '3.11'


jobs:
nightly_test:
name: Testing
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ on:
permissions:
contents: read

env:
POETRY_VERSION: '2.3.2'

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/141.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a composite action to simplify workflows
Loading