Skip to content

Nightly Tests

Nightly Tests #280

Workflow file for this run

name: Nightly Tests
on:
workflow_dispatch:
schedule: # UTC at 0300
- cron: '0 3 * * *'
env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
TESTS_VERSION: '3.10'
ON_CI: True
PYAEDT_EDB_XFAIL: "1"
PYAEDT_LOCAL_SETTINGS_PATH: 'tests/pyaedt_settings.yaml'
PYTEST_ARGUMENTS: '-vvv --color=yes -rsa --durations=25 --maxfail=10 --cov=ansys.aedt.core --cov-report=html --cov-report=xml --junitxml=junit/test-results.xml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Disable all default permissions at workflow level for security (least privilege principle)
# Individual jobs will explicitly request only the permissions they need
permissions: {}
jobs:
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Install Xvfb
shell: bash
run: sudo apt-get install -y xvfb
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.TESTS_VERSION }}
- name: Set up uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
with:
activate-environment: true
enable-cache: false
prune-cache: true
python-version: ${{ env.TESTS_VERSION }}
- name: Install pyaedt and tests dependencies
env:
TESTS_VERSION: ${{ env.TESTS_VERSION }}
run: |
uv sync --frozen --group tests --extra all
- name: Run unit tests
env:
PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }}
run: |
xvfb-run pytest ${PYTEST_ARGUMENTS} tests/unit
- name: Upload coverage to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
name: codecov-unit-tests
files: ./coverage.xml
flags: linux_unit
- name: Upload pytest test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pytest-unit
path: junit/test-results.xml
if: ${{ always() }}
integration-tests:
name: Integration tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.TESTS_VERSION }}
- name: Set up uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
with:
activate-environment: true
enable-cache: false
prune-cache: true
python-version: ${{ env.TESTS_VERSION }}
- name: Install pyaedt and tests dependencies
env:
TESTS_VERSION: ${{ env.TESTS_VERSION }}
run: |
uv sync --frozen --group tests --extra all
- name: Run integration tests
env:
PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }}
run: |
pytest ${PYTEST_ARGUMENTS} tests/integration
- name: Upload coverage to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
name: codecov-integration-tests
files: ./coverage.xml
flags: linux_integration
- name: Upload pytest test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pytest-integration
path: junit/test-results.xml
if: ${{ always() }}
# # =================================================================================================
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================
system-tests-solvers-windows:
name: Test solvers (windows)
runs-on: [ self-hosted, Windows, pyaedt ]
steps:
- name: Install Git and checkout project
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.TESTS_VERSION }}
- name: Set up uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
with:
activate-environment: true
enable-cache: false
prune-cache: true
python-version: ${{ env.TESTS_VERSION }}
- name: Clean uv cache
run: uv cache clean
- name: Install pyaedt and tests dependencies
env:
TESTS_VERSION: ${{ env.TESTS_VERSION }}
run: |
uv sync --frozen --group tests --extra all
- name: Remove Ansys processes (if any)
shell: powershell
run: |
Get-Process | Where-Object {
$_.Path -like "*ansys inc*" -or $_.Path -like "*ansysem*"
} | ForEach-Object {
Write-Output "Killing $($_.Name) (PID: $($_.Id))"
Stop-Process -Id $_.Id -Force
}
- name: Run tests marked with 'solvers'
env:
PYTHONMALLOC: malloc
PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }}
run: |
$args = $env:PYTEST_ARGUMENTS -split ' '
pytest @args --timeout=600 tests/system/solvers
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
name: codecov-system-solvers-tests-windows
files: ./coverage.xml
flags: windows_system_solvers
- name: Upload pytest test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pytest-solvers-windows
path: junit/test-results.xml
if: ${{ always() }}
# # =================================================================================================
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================
system-tests-solvers-linux:
name: Test solvers (linux)
runs-on: [ self-hosted, Linux, pyaedt ]
env:
ANSYSEM_ROOT261: '/usr/ansys_inc/v261/AnsysEM'
ANS_NODEPCHECK: '1'
steps:
- name: Install Git and checkout project
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.TESTS_VERSION }}
- name: Set up uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
with:
activate-environment: true
enable-cache: false
prune-cache: true
python-version: ${{ env.TESTS_VERSION }}
- name: Clean uv cache
run: uv cache clean
- name: Install pyaedt and tests dependencies
env:
TESTS_VERSION: ${{ env.TESTS_VERSION }}
run: |
uv sync --frozen --group tests --extra all
- name: Remove Ansys processes (if any)
shell: bash
run: |
for pid in $(ps -eo pid,comm,args | grep -iE "ansys.inc|ansysem" | grep -v grep | awk '{print $1}'); do
echo "Killing PID $pid"
kill -9 "$pid"
done
- name: Run tests marked with 'solvers'
env:
PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }}
run: |
pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/system/solvers
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
name: codecov-system-solvers-tests-linux
files: ./coverage.xml
flags: linux_system_solvers
- name: Upload pytest test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pytest-solvers-linux
path: junit/test-results.xml
if: ${{ always() }}
# # =================================================================================================
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================
system-tests-general-windows:
name: Test general (windows)
runs-on: [ self-hosted, Windows, pyaedt ]
steps:
- name: Install Git and checkout project
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.TESTS_VERSION }}
- name: Set up uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
with:
activate-environment: true
enable-cache: false
prune-cache: true
python-version: ${{ env.TESTS_VERSION }}
- name: Clean uv cache
run: uv cache clean
- name: Set up headless display
uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3
- name: Install pyaedt and tests dependencies
env:
TESTS_VERSION: ${{ env.TESTS_VERSION }}
run: |
uv sync --frozen --group tests --extra all
- name: Remove Ansys processes (if any)
shell: powershell
run: |
Get-Process | Where-Object {
$_.Path -like "*ansys inc*" -or $_.Path -like "*ansysem*"
} | ForEach-Object {
Write-Output "Killing $($_.Name) (PID: $($_.Id))"
Stop-Process -Id $_.Id -Force
}
- name: Run tests marked with 'general'
env:
PYTHONMALLOC: malloc
PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }}
run: |
$args = $env:PYTEST_ARGUMENTS -split ' '
pytest @args -n 4 --dist loadfile --timeout=600 tests/system/general
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
name: codecov-system-general-tests-windows
files: ./coverage.xml
flags: windows_system_general
- name: Upload pytest test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pytest-general-windows
path: junit/test-results.xml
if: ${{ always() }}
# # =================================================================================================
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================
system-tests-general-linux:
name: Test general (linux)
runs-on: [ self-hosted, Linux, pyaedt ]
env:
ANSYSEM_ROOT261: '/usr/ansys_inc/v261/AnsysEM'
ANS_NODEPCHECK: '1'
steps:
- name: Install Git and checkout project
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.TESTS_VERSION }}
- name: Set up uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
with:
activate-environment: true
enable-cache: false
prune-cache: true
python-version: ${{ env.TESTS_VERSION }}
- name: Clean uv cache
run: uv cache clean
- name: Set up headless display
uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3
- name: Install pyaedt and tests dependencies
env:
TESTS_VERSION: ${{ env.TESTS_VERSION }}
run: |
uv sync --frozen --group tests --extra all
- name: Remove Ansys processes (if any)
shell: bash
run: |
for pid in $(ps -eo pid,comm,args | grep -iE "ansys.inc|ansysem" | grep -v grep | awk '{print $1}'); do
echo "Killing PID $pid"
kill -9 "$pid"
done
- name: Run tests marked with 'general'
run: |
pytest ${PYTEST_ARGUMENTS} -n 4 --dist loadfile --timeout=600 tests/system/general
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
name: codecov-system-general-tests-linux
files: ./coverage.xml
flags: linux_system_general
- name: Upload pytest test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pytest-general-linux
path: junit/test-results.xml
if: ${{ always() }}
# # =================================================================================================
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================
system-tests-visualization-windows:
name: Test visualization (windows)
runs-on: [ self-hosted, Windows, pyaedt ]
env:
MPLBACKEND: 'Agg'
steps:
- name: Install Git and checkout project
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.TESTS_VERSION }}
- name: Set up uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
with:
activate-environment: true
enable-cache: false
prune-cache: true
python-version: ${{ env.TESTS_VERSION }}
- name: Clean uv cache
run: uv cache clean
- name: Set up headless display
uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3
- name: Install pyaedt and tests dependencies
env:
TESTS_VERSION: ${{ env.TESTS_VERSION }}
run: |
uv sync --frozen --group tests --extra all
- name: Remove Ansys processes (if any)
shell: powershell
run: |
Get-Process | Where-Object {
$_.Path -like "*ansys inc*" -or $_.Path -like "*ansysem*"
} | ForEach-Object {
Write-Output "Killing $($_.Name) (PID: $($_.Id))"
Stop-Process -Id $_.Id -Force
}
- name: Run tests marked with 'visualization'
env:
PYTHONMALLOC: malloc
PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }}
run: |
$args = $env:PYTEST_ARGUMENTS -split ' '
pytest @args -n 4 --dist loadfile --timeout=600 tests/system/visualization -x
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
name: codecov-system-visualization-tests-windows
files: ./coverage.xml
flags: windows_system_visualization
- name: Upload pytest test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pytest-visualization-windows
path: junit/test-results.xml
if: ${{ always() }}
# # =================================================================================================
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================
system-tests-visualization-linux:
name: Test visualization (linux)
runs-on: [ self-hosted, Linux, pyaedt ]
env:
ANSYSEM_ROOT261: '/usr/ansys_inc/v261/AnsysEM'
ANS_NODEPCHECK: '1'
MPLBACKEND: 'Agg'
steps:
- name: Install Git and checkout project
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.TESTS_VERSION }}
- name: Set up uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
with:
activate-environment: true
enable-cache: false
prune-cache: true
python-version: ${{ env.TESTS_VERSION }}
- name: Clean uv cache
run: uv cache clean
- name: Set up headless display
uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3
- name: Install pyaedt and tests dependencies
env:
TESTS_VERSION: ${{ env.TESTS_VERSION }}
run: |
uv sync --frozen --group tests --extra all
- name: Remove Ansys processes (if any)
shell: bash
run: |
for pid in $(ps -eo pid,comm,args | grep -iE "ansys.inc|ansysem" | grep -v grep | awk '{print $1}'); do
echo "Killing PID $pid"
kill -9 "$pid"
done
- name: Run tests marked with 'visualization'
run: |
pytest ${PYTEST_ARGUMENTS} -n 4 --dist loadfile --timeout=300 tests/system/visualization -x
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
name: codecov-system-visualization-tests-linux
files: ./coverage.xml
flags: linux_system_visualization
- name: Upload pytest test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pytest-visualization-linux
path: junit/test-results.xml
if: ${{ always() }}
# # =================================================================================================
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================
system-tests-icepak-windows:
name: Test icepak (windows)
runs-on: [ self-hosted, Windows, pyaedt ]
steps:
- name: Install Git and checkout project
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.TESTS_VERSION }}
- name: Set up uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
with:
activate-environment: true
enable-cache: false
prune-cache: true
python-version: ${{ env.TESTS_VERSION }}
- name: Clean uv cache
run: uv cache clean
- name: Install pyaedt and tests dependencies
env:
TESTS_VERSION: ${{ env.TESTS_VERSION }}
run: |
uv sync --frozen --group tests --extra all
- name: Remove Ansys processes (if any)
shell: powershell
run: |
Get-Process | Where-Object {
$_.Path -like "*ansys inc*" -or $_.Path -like "*ansysem*"
} | ForEach-Object {
Write-Output "Killing $($_.Name) (PID: $($_.Id))"
Stop-Process -Id $_.Id -Force
}
- name: Run tests marked with 'icepak'
env:
PYTHONMALLOC: malloc
PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }}
run: |
$args = $env:PYTEST_ARGUMENTS -split ' '
pytest @args --timeout=600 tests/system/icepak
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
name: codecov-system-icepak-tests-windows
files: ./coverage.xml
flags: windows_system_icepak
- name: Upload pytest test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pytest-icepak-windows
path: junit/test-results.xml
if: ${{ always() }}
# # =================================================================================================
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================
system-tests-icepak-linux:
name: Test icepak (linux)
runs-on: [ self-hosted, Linux, pyaedt ]
env:
ANSYSEM_ROOT261: '/usr/ansys_inc/v261/AnsysEM'
ANS_NODEPCHECK: '1'
steps:
- name: Install Git and checkout project
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.TESTS_VERSION }}
- name: Set up uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
with:
activate-environment: true
enable-cache: false
prune-cache: true
python-version: ${{ env.TESTS_VERSION }}
- name: Clean uv cache
run: uv cache clean
- name: Install pyaedt and tests dependencies
env:
TESTS_VERSION: ${{ env.TESTS_VERSION }}
run: |
uv sync --frozen --group tests --extra all
- name: Remove Ansys processes (if any)
shell: bash
run: |
for pid in $(ps -eo pid,comm,args | grep -iE "ansys.inc|ansysem" | grep -v grep | awk '{print $1}'); do
echo "Killing PID $pid"
kill -9 "$pid"
done
- name: Run tests marked with 'icepak'
env:
PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }}
run: |
pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/system/icepak
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
name: codecov-system-icepak-tests-linux
files: ./coverage.xml
flags: linux_system_icepak
- name: Upload pytest test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pytest-icepak-linux
path: junit/test-results.xml
if: ${{ always() }}
# # =================================================================================================
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================
system-tests-layout-windows:
name: Test layout (windows)
runs-on: [ self-hosted, Windows, pyaedt ]
steps:
- name: Install Git and checkout project
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.TESTS_VERSION }}
- name: Set up uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
with:
activate-environment: true
enable-cache: false
prune-cache: true
python-version: ${{ env.TESTS_VERSION }}
- name: Clean uv cache
run: uv cache clean
- name: Install pyaedt and tests dependencies
env:
TESTS_VERSION: ${{ env.TESTS_VERSION }}
run: |
uv sync --frozen --group tests --extra all
- name: Remove Ansys processes (if any)
shell: powershell
run: |
Get-Process | Where-Object {
$_.Path -like "*ansys inc*" -or $_.Path -like "*ansysem*"
} | ForEach-Object {
Write-Output "Killing $($_.Name) (PID: $($_.Id))"
Stop-Process -Id $_.Id -Force
}
- name: Run tests marked with 'layout'
env:
PYTHONMALLOC: malloc
PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }}
run: |
$args = $env:PYTEST_ARGUMENTS -split ' '
pytest @args --timeout=600 tests/system/layout
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
name: codecov-system-layout-tests-windows
files: ./coverage.xml
flags: windows_system_layout
- name: Upload pytest test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pytest-layout-windows
path: junit/test-results.xml
if: ${{ always() }}
# # =================================================================================================
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================
system-tests-layout-linux:
name: Test layout (linux)
runs-on: [ self-hosted, Linux, pyaedt ]
env:
ANSYSEM_ROOT261: '/usr/ansys_inc/v261/AnsysEM'
ANS_NODEPCHECK: '1'
steps:
- name: Install Git and checkout project
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.TESTS_VERSION }}
- name: Set up uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
with:
activate-environment: true
enable-cache: false
prune-cache: true
python-version: ${{ env.TESTS_VERSION }}
- name: Clean uv cache
run: uv cache clean
- name: Install pyaedt and tests dependencies
env:
TESTS_VERSION: ${{ env.TESTS_VERSION }}
run: |
uv sync --frozen --group tests --extra all
- name: Remove Ansys processes (if any)
shell: bash
run: |
for pid in $(ps -eo pid,comm,args | grep -iE "ansys.inc|ansysem" | grep -v grep | awk '{print $1}'); do
echo "Killing PID $pid"
kill -9 "$pid"
done
- name: Run tests marked with 'layout'
env:
PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }}
run: |
pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/system/layout
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
name: codecov-system-layout-tests-linux
files: ./coverage.xml
flags: linux_system_layout
- name: Upload pytest test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pytest-layout-linux
path: junit/test-results.xml
if: ${{ always() }}
# # =================================================================================================
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================
system-tests-extensions-windows:
name: Test extensions (windows)
runs-on: [ self-hosted, Windows, pyaedt ]
steps:
- name: Install Git and checkout project
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
# NOTE: Our windows runners are impacted by nodejs/node#56645 so we cannot use astral-sh/setup-uv@v7
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.TESTS_VERSION }}
- name: Set up uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
with:
activate-environment: true
enable-cache: false
prune-cache: true
python-version: ${{ env.TESTS_VERSION }}
- name: Clean uv cache
run: uv cache clean
- name: Set up headless display
uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3
- name: Install pyaedt and tests dependencies
env:
TESTS_VERSION: ${{ env.TESTS_VERSION }}
run: |
uv sync --frozen --group tests --extra all
- name: Remove Ansys processes (if any)
shell: powershell
run: |
Get-Process | Where-Object {
$_.Path -like "*ansys inc*" -or $_.Path -like "*ansysem*"
} | ForEach-Object {
Write-Output "Killing $($_.Name) (PID: $($_.Id))"
Stop-Process -Id $_.Id -Force
}
- name: Fix TCL_LIBRARY for tkinter on Windows
id: fix-tcl
shell: powershell
run: |
# NOTE: In a venv, sys.prefix points to the venv and since Tcl lives in sys.base_prefix (the real install).
# To ensure we locate the correct Tcl directory, we check both sys.prefix and sys.base_prefix.
# NOTE: We also try to leverage actions/setup-python's environment variable to locate the Python installation
# and find the Tcl directory. See https://github.com/actions/setup-python/blob/main/src/find-python.ts
$prefixes = @()
if ($env:pythonLocation) { $prefixes += $env:pythonLocation }
$prefixes += (python -c "import sys; print(sys.base_prefix)").Trim()
$prefixes += (python -c "import sys; print(sys.prefix)").Trim()
$tclDir = $null
foreach ($prefix in $prefixes) {
$tclDir = Get-ChildItem -Path "$prefix\tcl" -Filter "tcl*" -Directory -ErrorAction SilentlyContinue |
Where-Object { Test-Path (Join-Path $_.FullName "init.tcl") } |
Sort-Object Name -Descending | Select-Object -First 1
if ($tclDir) { break }
}
if ($tclDir) {
"tcl_library=$($tclDir.FullName)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
Write-Output "TCL_LIBRARY set to $($tclDir.FullName)"
} else {
Write-Warning "Could not locate a valid tcl directory in any of: $($prefixes -join ', ')"
}
- name: Run tests marked with 'extensions'
env:
PYTHONMALLOC: malloc
PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }}
TCL_LIBRARY: ${{ steps.fix-tcl.outputs.tcl_library }}
run: |
$args = $env:PYTEST_ARGUMENTS -split ' '
pytest @args --timeout=600 tests/system/extensions
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
name: codecov-system-extensions-tests-windows
files: ./coverage.xml
flags: windows_system_extensions
- name: Upload pytest test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pytest-extensions-windows
path: junit/test-results.xml
if: ${{ always() }}
# # =================================================================================================
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================
system-tests-extensions-linux:
name: Test extensions (linux)
runs-on: [ self-hosted, Linux, pyaedt ]
env:
ANSYSEM_ROOT261: '/usr/ansys_inc/v261/AnsysEM'
ANS_NODEPCHECK: '1'
steps:
- name: Install Git and checkout project
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.TESTS_VERSION }}
- name: Set up uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
with:
activate-environment: true
enable-cache: false
prune-cache: true
python-version: ${{ env.TESTS_VERSION }}
- name: Clean uv cache
run: uv cache clean
- name: Set up headless display
uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3
- name: Install pyaedt and tests dependencies
env:
TESTS_VERSION: ${{ env.TESTS_VERSION }}
run: |
uv sync --frozen --group tests --extra all
- name: Remove Ansys processes (if any)
shell: bash
run: |
for pid in $(ps -eo pid,comm,args | grep -iE "ansys.inc|ansysem" | grep -v grep | awk '{print $1}'); do
echo "Killing PID $pid"
kill -9 "$pid"
done
- name: Run tests marked with 'extensions'
run: |
pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/system/extensions
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
name: codecov-system-extensions-tests-linux
files: ./coverage.xml
flags: linux_system_extensions
- name: Upload pytest test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pytest-extensions-linux
path: junit/test-results.xml
if: ${{ always() }}
# # =================================================================================================
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================
system-tests-filter-windows:
name: Test filter solutions (windows)
runs-on: [ self-hosted, Windows, pyaedt ]
steps:
- name: Install Git and checkout project
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
# NOTE: Our windows runners are impacted by nodejs/node#56645 so we cannot use astral-sh/setup-uv@v7
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.TESTS_VERSION }}
- name: Set up uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
with:
activate-environment: true
enable-cache: false
prune-cache: true
python-version: ${{ env.TESTS_VERSION }}
- name: Clean uv cache
run: uv cache clean
- name: Install pyaedt and tests dependencies
env:
TESTS_VERSION: ${{ env.TESTS_VERSION }}
run: |
uv sync --frozen --group tests --extra all
- name: Remove Ansys processes (if any)
shell: powershell
run: |
Get-Process | Where-Object {
$_.Path -like "*ansys inc*" -or $_.Path -like "*ansysem*"
} | ForEach-Object {
Write-Output "Killing $($_.Name) (PID: $($_.Id))"
Stop-Process -Id $_.Id -Force
}
- name: Run tests marked with 'filter_solutions'
env:
PYTHONMALLOC: malloc
PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }}
run: |
$args = $env:PYTEST_ARGUMENTS -split ' '
pytest @args --timeout=600 tests/system/filter_solutions
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
name: codecov-system-filter-tests-windows
files: ./coverage.xml
flags: windows_system_filter
- name: Upload pytest test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pytest-filter_solutions-windows
path: junit/test-results.xml
if: ${{ always() }}
# # =================================================================================================
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================
system-tests-emit-windows:
name: Test EMIT (windows)
runs-on: [ self-hosted, Windows, pyaedt ]
steps:
- name: Install Git and checkout project
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
# NOTE: Our windows runners are impacted by nodejs/node#56645 so we cannot use astral-sh/setup-uv@v7
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.TESTS_VERSION }}
- name: Set up uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
with:
activate-environment: true
enable-cache: false
prune-cache: true
python-version: ${{ env.TESTS_VERSION }}
- name: Clean uv cache
run: uv cache clean
- name: Install pyaedt and tests dependencies
env:
TESTS_VERSION: ${{ env.TESTS_VERSION }}
run: |
uv sync --frozen --group tests --extra all
- name: Remove Ansys processes (if any)
shell: powershell
run: |
Get-Process | Where-Object {
$_.Path -like "*ansys inc*" -or $_.Path -like "*ansysem*"
} | ForEach-Object {
Write-Output "Killing $($_.Name) (PID: $($_.Id))"
Stop-Process -Id $_.Id -Force
}
- name: Run tests marked with 'emit'
env:
PYTHONMALLOC: malloc
PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }}
run: |
$args = $env:PYTEST_ARGUMENTS -split ' '
pytest @args --timeout=600 -v -rA --color=yes tests/system/emit
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
name: codecov-system-emit-tests-windows
files: ./coverage.xml
flags: windows_system_emit
- name: Upload pytest test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pytest-emit-windows
path: junit/test-results.xml