Skip to content

Add monitoring and rcs examples #2627

Add monitoring and rcs examples

Add monitoring and rcs examples #2627

Workflow file for this run

name: GitHub CI
on:
workflow_dispatch:
inputs:
hps-version:
description: HPS version to test against
default: 'latest-dev'
type: choice
options:
- 'v1.0.2'
- 'v1.1.1'
- 'v1.2.0'
- 'v1.3.45'
- 'v1.4.10'
- 'latest-dev'
hps-feature:
description: HPS feature to test against
type: 'string'
default: 'main'
pull_request:
push:
tags:
- "v*.*.*"
branches:
- main
env:
MAIN_PYTHON_VERSION: '3.14'
DOCUMENTATION_CNAME: 'hps.docs.pyansys.com'
PACKAGE_NAME: 'ansys-hps-client'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
style:
uses: ./.github/workflows/style.yml
check-actions-security:
name: Check actions security
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: ansys/actions/check-actions-security@v10.3.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
tests:
strategy:
matrix:
os: ['ubuntu-latest']
cfg: [
{ python-version: '3.10', toxenv: 'py310' },
]
fail-fast: false
uses: ./.github/workflows/tests.yml
secrets:
PYANSYS_CI_BOT_PACKAGE_TOKEN: ${{ secrets.PYANSYS_CI_BOT_PACKAGE_TOKEN }}
PYANSYS_CI_BOT_TOKEN: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
PYANSYS_CI_BOT_USERNAME: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
python-version: ${{ matrix.cfg.python-version }}
toxenv: ${{ matrix.cfg.toxenv }}
runner: ${{ matrix.os }}
hps-version: ${{ inputs.hps-version || 'latest-dev' }}
hps-feature: ${{ inputs.hps-feature || 'main' }}
backward-compatibility-tests:
strategy:
matrix:
hps-version: ['v1.2.0', 'v1.3.45', 'v1.4.10']
fail-fast: false
uses: ./.github/workflows/tests.yml
secrets:
PYANSYS_CI_BOT_PACKAGE_TOKEN: ${{ secrets.PYANSYS_CI_BOT_PACKAGE_TOKEN }}
PYANSYS_CI_BOT_TOKEN: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
PYANSYS_CI_BOT_USERNAME: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
python-version: '3.10'
toxenv: 'py310'
runner: 'ubuntu-latest'
hps-version: ${{ matrix.hps-version }}
hps-feature: 'main'
upload-coverage: false
docs:
name: Documentation
runs-on: ubuntu-latest
needs: [style]
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
- uses: extractions/netrc@c3879108aae6b4ed5c4eb60854ae04f06d2f2f68 # v3
with:
machine: github.com
username: pyansys-ci-bot
password: ${{ secrets.PYANSYS_CI_BOT_PACKAGE_TOKEN }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools tox
- name: Install OS dependencies
run: |
# Necessary for creating PDF
sudo apt update
sudo apt install latexmk texlive-latex-extra
- name: Generate the documentation with tox
env:
DOC_PLATFORM: ${{ runner.os == 'Linux' && 'linux' || 'windows' }}
run: tox -e "doc-html-${DOC_PLATFORM},doc-pdf-${DOC_PLATFORM}"
- name: Upload HTML Documentation
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: documentation-html
path: doc/_build/html
retention-days: 7
- name: Upload PDF Documentation
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: documentation-pdf
path: doc/_build/latex/*.pdf
retention-days: 7
smoke-tests:
name: Build and Smoke tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
should-release:
- ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
exclude:
- should-release: false
os: macos-latest
- should-release: false
os: windows-latest
- should-release: false
python-version: '3.11'
- should-release: false
python-version: '3.12'
- should-release: false
python-version: '3.13'
- should-release: false
python-version: '3.14'
steps:
- uses: extractions/netrc@c3879108aae6b4ed5c4eb60854ae04f06d2f2f68 # v3
with:
machine: github.com
username: pyansys-ci-bot
password: ${{ secrets.PYANSYS_CI_BOT_PACKAGE_TOKEN }}
- name: Build wheelhouse and perform smoke test
uses: ansys/actions/build-wheelhouse@v10.3.2
with:
library-name: ${{ env.PACKAGE_NAME }}
operating-system: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
check-vulnerabilities:
name: "Check library vulnerabilities"
runs-on: ubuntu-latest
steps:
- uses: ansys/actions/check-vulnerabilities@v10.3.2
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
python-package-name: 'ansys-hps-client'
dev-mode: ${{ github.ref != 'refs/heads/main' }}
package:
name: Package library
needs: [tests, docs, smoke-tests, check-vulnerabilities]
runs-on: ubuntu-latest
steps:
- name: Build library source and wheel artifacts
uses: ansys/actions/build-library@v10.3.2
with:
library-name: ${{ env.PACKAGE_NAME }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
library-version:
name: Get library version
runs-on: ubuntu-latest
outputs:
library_version: ${{ steps.version.outputs.library_version }}
steps:
- name: "Install Git and clone project"
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- uses: extractions/netrc@c3879108aae6b4ed5c4eb60854ae04f06d2f2f68 # v3
with:
machine: github.com
username: pyansys-ci-bot
password: ${{ secrets.PYANSYS_CI_BOT_PACKAGE_TOKEN }}
- name: "Set up Python ${{ env.MAIN_PYTHON_VERSION }}"
uses: ansys/actions/_setup-python@v10.3.2
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
use-cache: true
- name: "Install the library"
shell: bash
run: |
python -m pip install -e .
- name: "Verify library is properly installed and get its version number"
id: version
shell: bash
run: |
library_name="$PACKAGE_NAME"
library_version=$(python -c "import importlib.metadata as importlib_metadata; print(importlib_metadata.version('$library_name'))")
if [ -z "$library_version" ]; then
echo "Problem getting the library version"
exit 1;
else
echo "The library version is: $library_version";
fi;
echo "library_version=$library_version" >> $GITHUB_OUTPUT
pre-release:
name: Pre-release project
if: startsWith(github.ref, 'refs/heads/main')
needs: [package, library-version]
runs-on: ubuntu-latest
permissions:
contents: write # Required to publish a GitHub release for the latest-dev pre-release
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: ansys-hps-client-artifacts
path: /tmp/artifacts
- name: List artifacts
run: ls -ltR /tmp/artifacts
- name: Release to latest-dev
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
if: startsWith(github.ref, 'refs/heads/main')
with:
tag_name: "v${{ needs.library-version.outputs.library_version }}"
name: "v${{ needs.library-version.outputs.library_version }}"
prerelease: true
files: |
/tmp/artifacts/*.whl
upload_dev_docs:
name: "Deploy dev documentation"
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: [package]
permissions:
contents: write # Required to push generated docs to the gh-pages branch
steps:
- name: Deploy the latest documentation
uses: ansys/actions/doc-deploy-dev@v10.3.2
with:
doc-artifact-name: 'documentation-html'
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
release:
name: Release project
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: [package]
runs-on: ubuntu-latest
permissions:
id-token: write # Required for PyPI trusted publishing (OIDC)
contents: write # Required to publish the GitHub release for the tagged version
steps:
- name: "Download the library artifacts from package step"
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: ${{ env.PACKAGE_NAME }}-artifacts
path: ${{ env.PACKAGE_NAME }}-artifacts
- name: "Upload artifacts to PyPI using trusted publisher"
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
with:
repository-url: "https://upload.pypi.org/legacy/"
print-hash: true
packages-dir: ${{ env.PACKAGE_NAME }}-artifacts
skip-existing: false
- name: Release to GitHub
uses: ansys/actions/release-github@v10.3.2
with:
library-name: ${{ env.PACKAGE_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}
doc-deploy-stable:
name: "Deploy stable documentation"
# Deploy release documentation when creating a new tag
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: [release]
permissions:
contents: write # Required to push the stable docs to the gh-pages branch
steps:
- uses: ansys/actions/doc-deploy-stable@v10.3.2
with:
doc-artifact-name: 'documentation-html'
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}