diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml deleted file mode 100644 index b20b3f5fa366..000000000000 --- a/.github/workflows/ci-release.yml +++ /dev/null @@ -1,1279 +0,0 @@ -name: CI - Release -on: - push: - tags: - - "v*.*.*" - -env: - ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} - DOCUMENTATION_CNAME: 'aedt.docs.pyansys.com' - MAIN_PYTHON_VERSION: '3.14' - ON_CI: True - PACKAGE_NAME: 'PyAEDT' - PYTEST_ARGUMENTS: -vvv --color=yes -ra --durations=25 --maxfail=10 --cov=ansys.aedt.core --cov-report=html --cov-report=xml --junitxml=junit/test-results.xml - PYAEDT_LOCAL_SETTINGS_PATH: 'tests/pyaedt_settings.yaml' - TESTS_VERSION: '3.10' - -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: - - update-changelog: - name: "Update CHANGELOG" - runs-on: ubuntu-latest - permissions: - contents: write # Required to commit and push changelog updates to the repository - pull-requests: write # Required to create pull requests with changelog updates - steps: - - uses: ansys/actions/doc-deploy-changelog@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} - bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} - token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} - use-upper-case: true - use-python-cache: false - - vulnerabilities: - name: "Vulnerabilities" - runs-on: ubuntu-latest - permissions: - contents: read # Required to read repository content for vulnerability scanning - steps: - - uses: ansys/actions/check-vulnerabilities@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - python-package-name: ${{ env.PACKAGE_NAME }} - token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} - dev-mode: ${{ github.ref != 'refs/heads/main' }} - extra-targets: 'all' - - actions-security: - name: "Check actions security" - runs-on: ubuntu-latest - permissions: - contents: read # Required to read workflow files and check for security issues - steps: - - uses: ansys/actions/check-actions-security@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - generate-summary: true - token: ${{ secrets.GITHUB_TOKEN }} - auditing-level: 'high' - - doc-style: - name: Documentation style check - runs-on: ubuntu-latest - permissions: - contents: read # Required to read documentation files for style checking - steps: - - name: Check documentation style - uses: ansys/actions/doc-style@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - fail-level: 'warning' - - doc-build: - name: Documentation build - runs-on: ubuntu-latest - needs: [doc-style] - steps: - - name: Documentation build - uses: ansys/actions/doc-build@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - dependencies: "graphviz texlive-latex-extra latexmk texlive-xetex texlive-fonts-extra" - skip-install: true - python-version: ${{ env.MAIN_PYTHON_VERSION }} - use-python-cache: false - sphinxopts: '-j auto --color -w build_errors.txt' - check-links: false - needs-quarto: true - optional-dependencies-name: 'all' - group-dependencies-name: 'doc' - - smoke-tests: - name: Build wheelhouse and smoke tests (${{ matrix.target }}) - runs-on: ${{ matrix.os }} - permissions: - attestations: write # Required to create and publish build attestations (SLSA provenance) - contents: read # Required to read repository content for building - id-token: write # Required for OIDC token generation (for provenance signing) - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] - target: ['all', 'all-dotnet'] - steps: - - name: Build wheelhouse and perform smoke test - id: build-wheelhouse - uses: ansys/actions/build-wheelhouse@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - library-name: ${{ env.PACKAGE_NAME }} - operating-system: ${{ matrix.os }} - python-version: ${{ matrix.python-version }} - target: ${{ matrix.target }} - attest-provenance: true - use-python-cache: false - whitelist-license-check: 'fpdf2' - - - name: Import python package - env: - ACTIVATE_VENV: ${{ steps.build-wheelhouse.outputs.activate-venv }} - shell: bash - run: | - ${ACTIVATE_VENV} - python -c "import ansys.aedt.core; from ansys.aedt.core import __version__" - - build-wheelhouse-rocky: - name: Build wheelhouse (Rocky Linux) - permissions: - attestations: write # Required to create and publish build attestations (SLSA provenance) - contents: read # Required to read repository content for building - id-token: write # Required for OIDC token generation (for provenance signing) - uses: ./.github/workflows/reusable-smoke-tests-rocky.yml - with: - python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' - extras: '["all", "all-dotnet"]' - - unit-tests: - name: Unit tests - needs: smoke-tests - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Install Xvfb - shell: bash - run: sudo apt-get install -y xvfb - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Run unit tests - env: - PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }} - run: | - source .venv/bin/activate - xvfb-run pytest ${PYTEST_ARGUMENTS} tests/unit - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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 - needs: unit-tests - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Run integration tests - env: - PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }} - run: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} tests/integration - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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) - needs: integration-tests - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/solvers - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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) - needs: integration-tests - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/system/solvers - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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) - needs: integration-tests - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args -n 4 --dist loadfile --timeout=600 tests/system/general - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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) - needs: integration-tests - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} -n 4 --dist loadfile --timeout=600 tests/system/general - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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) - needs: integration-tests - runs-on: [ self-hosted, Windows, pyaedt ] - env: - MPLBACKEND: 'Agg' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args -n 4 --dist loadfile --timeout=600 tests/system/visualization -x - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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) - needs: integration-tests - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} -n 4 --dist loadfile --timeout=300 tests/system/visualization -x - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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) - needs: integration-tests - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/icepak - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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) - needs: integration-tests - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/system/icepak - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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) - needs: integration-tests - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/layout - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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) - needs: integration-tests - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/system/layout - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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) - needs: integration-tests - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - 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@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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 'extensions' - env: - PYTHONMALLOC: malloc - PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }} - run: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/extensions - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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) - needs: integration-tests - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/system/extensions - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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) - needs: integration-tests - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - 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@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/filter_solutions - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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) - needs: integration-tests - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - 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@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 -v -rA --color=yes tests/system/emit - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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 - - package: - name: Package library - needs: [system-tests-solvers-windows, - system-tests-solvers-linux, - system-tests-general-windows, - system-tests-general-linux, - system-tests-visualization-windows, - system-tests-visualization-linux, - system-tests-icepak-windows, - system-tests-icepak-linux, - system-tests-layout-windows, - system-tests-layout-linux, - system-tests-extensions-windows, - system-tests-extensions-linux, - system-tests-filter-windows, - system-tests-emit-windows, - doc-build] - runs-on: ubuntu-latest - permissions: - attestations: write # Required to create and publish package attestations (SLSA provenance) - contents: read # Required to read repository content for packaging - id-token: write # Required for OIDC token generation (for provenance signing) - steps: - - name: Build library source and wheel artifacts - uses: ansys/actions/build-library@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - attest-provenance: true - library-name: ${{ env.PACKAGE_NAME }} - python-version: ${{ env.MAIN_PYTHON_VERSION }} - use-python-cache: false - - # TODO: If we can fix the PDF issue and leverage classic ansys/release-github - release: - name: Release project - needs: [package, doc-build, build-wheelhouse-rocky] - runs-on: ubuntu-latest - # Specifying a GitHub environment is optional, but strongly encouraged - environment: release - permissions: - id-token: write # Required for OIDC authentication to PyPI (trusted publisher) - contents: write # Required to create GitHub releases and upload release assets - steps: - - 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: Release 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@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - add-artifact-attestation-notes: true - generate-release-notes: false - library-name: ${{ env.PACKAGE_NAME }} - token: ${{ secrets.GITHUB_TOKEN }} - use-python-cache: false - - upload-release-doc: - name: Upload release documentation - runs-on: ubuntu-latest - needs: [release] - permissions: - contents: write # Required to commit and push documentation to gh-pages branch - steps: - - name: Deploy the stable documentation - uses: ansys/actions/doc-deploy-stable@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} - bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} - cname: ${{ env.DOCUMENTATION_CNAME }} - token: ${{ secrets.GITHUB_TOKEN }} - use-python-cache: false diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index a2112d5e774d..4afc7a9c36ca 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -43,203 +43,6 @@ permissions: {} jobs: - # NOTE: We do not allow dependabot to trigger the CI/CD pipeline automatically. - # This is to mitigate supply chain attacks, where a malicious dependency update - # could execute arbitrary code in our build environment. - # Dependabot PRs must be reviewed carefully and approved manually before - # running the CI. - block-dependabot: - name: "Block dependabot (on dependabot PR)" - runs-on: ubuntu-latest - steps: - - name: Exit if dependabot triggered the workflow # zizmor: ignore[bot-conditions] safe ignore because we exit if dependabot is triggering the action - if: github.triggering_actor == 'dependabot[bot]' - run: | - echo "::warning::Dependabot is not allowed to trigger this workflow. Please review carefully the changes before running the workflow manually." - exit 1 - - - # NOTE: We do not allow the pre-commit-ci bot to trigger the CI/CD pipeline - # automatically on PR it creates. - # This is to mitigate supply chain attacks, where a malicious dependency update - # could execute arbitrary code in our build environment. - # PRs opened by the pre-commit-ci bot must be reviewed carefully and approved - # manually before running the CI. - block-pre-commit-ci-bot-PR: - name: "Block pre-commit-ci bot (on pre-commit-ci bot PR only)" - runs-on: ubuntu-latest - steps: - - name: Exit if pre-commit-ci bot triggered the workflow # zizmor: ignore[bot-conditions] safe ignore because we exit if pre-commit-ci bot is triggering the action - if: github.triggering_actor == 'pre-commit-ci[bot]' && github.event.pull_request.head.ref == 'pre-commit-ci-update-config' - run: | - echo "::warning::pre-commit-ci bot is not allowed to trigger this workflow. Please review carefully the changes before running the workflow manually." - exit 1 - - - # NOTE: We do not allow pyansys-ci-bot to trigger the CI/CD pipeline automatically - # on dependabot's and pre-commit-ci bot's PR. This is to mitigate supply chain attacks, - # where a malicious dependency update could execute arbitrary code in our build environment. - # Dependabot and pre-commit-ci bot PRs must be reviewed carefully and approved manually before - # running the CI. - block-pyansys-ci-bot: - name: "Block PyAnsys-CI-bot (on dependabot and pre-commit-ci bot PR)" - needs: [block-dependabot, block-pre-commit-ci-bot-PR] - runs-on: ubuntu-latest - steps: - - name: Exit if pyansys-ci-bot triggered the workflow on dependabot's PR - if: github.triggering_actor == 'pyansys-ci-bot' && startsWith(github.head_ref, 'dependabot') - run: | - echo "::warning::PyAnsys CI bot is not allowed to trigger this workflow in dependabot's PR. Please review carefully the changes before running the workflow manually." - exit 1 - - name: Exit if pyansys-ci-bot triggered the workflow on pre-commit-ci bot's PR - if: github.triggering_actor == 'pyansys-ci-bot' && github.event.pull_request.head.ref == 'pre-commit-ci-update-config' - run: | - echo "::warning::PyAnsys CI bot is not allowed to trigger this workflow in pre-commit-ci bot's PR. Please review carefully the changes before running the workflow manually." - exit 1 - - - vulnerabilities: - name: "Vulnerabilities" - runs-on: ubuntu-latest - needs: [block-pyansys-ci-bot] - permissions: - contents: read # Required to read repository content for vulnerability scanning - steps: - - uses: ansys/actions/check-vulnerabilities@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - dev-mode: ${{ github.ref != 'refs/heads/main' }} - extra-targets: 'all' - python-version: ${{ env.MAIN_PYTHON_VERSION }} - python-package-name: ${{ env.PACKAGE_NAME }} - token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} - - actions-security: - name: "Check actions security" - runs-on: ubuntu-latest - needs: [block-pyansys-ci-bot] - permissions: - contents: read # Required to read workflow files and check for security issues - steps: - - uses: ansys/actions/check-actions-security@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - generate-summary: true - token: ${{ secrets.GITHUB_TOKEN }} - auditing-level: 'high' - - pr-title: - name: Check the title of the PR (if needed) - runs-on: ubuntu-latest - needs: [block-pyansys-ci-bot] - permissions: - pull-requests: read # Required to read PR metadata - steps: - - name: Check the title of the pull request - if: github.event_name == 'pull_request' - uses: ansys/actions/check-pr-title@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - use-upper-case: true - - name: Check the title of the pull request - if: github.event_name != 'pull_request' - shell: bash - run: echo "::notice::Skipping PR title check for non-PR events" - - analyze-changes: - name: Analyze code changes - runs-on: ubuntu-latest - needs: [pr-title] - outputs: - skip_tests: ${{ steps.analyze.outputs.skip_tests }} - doc_only: ${{ steps.analyze.outputs.doc_only }} - run_all: ${{ steps.analyze.outputs.run_all }} - emit_changed: ${{ steps.analyze.outputs.emit_changed }} - extensions_changed: ${{ steps.analyze.outputs.extensions_changed }} - filter_solutions_changed: ${{ steps.analyze.outputs.filter_solutions_changed }} - permissions: - contents: read # Required to read repository content and git history - steps: - - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - fetch-depth: 0 # Need full history for git diff - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Analyze changes - id: analyze - shell: bash - run: | - # Run the analyze-changes script in CI mode - python .ci/scripts/analyze_changes.py --base origin/main - - # If no outputs were set, default to run_all=true - if [ ! -f "$GITHUB_OUTPUT" ] || ! grep -q "skip_tests\|doc_only\|run_all" "$GITHUB_OUTPUT" 2>/dev/null; then - echo "run_all=true" >> $GITHUB_OUTPUT - echo "skip_tests=false" >> $GITHUB_OUTPUT - echo "doc_only=false" >> $GITHUB_OUTPUT - fi - - doc-style: - name: Documentation style check - runs-on: ubuntu-latest - needs: [analyze-changes] - permissions: - contents: read # Required to read documentation files for style checking - steps: - - name: Check documentation style - uses: ansys/actions/doc-style@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - files: '["doc/source", ".github/plugin", ".github/skills"]' - fail-level: 'warning' - - doc-build: - name: Documentation build - runs-on: ubuntu-latest - needs: [doc-style] - steps: - - name: Documentation build - uses: ansys/actions/doc-build@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - dependencies: "graphviz texlive-latex-extra latexmk texlive-xetex texlive-fonts-extra" - skip-install: true - python-version: ${{ env.MAIN_PYTHON_VERSION }} - use-python-cache: false - sphinxopts: '-j auto --color -w build_errors.txt' - check-links: false - needs-quarto: false - optional-dependencies-name: 'all' - group-dependencies-name: 'doc' - - doc-deploy-pr: - name: Deploy PR documentation - if: contains(github.event.pull_request.labels.*.name, 'deploy-pr-doc') - needs: doc-build - runs-on: ubuntu-latest - permissions: - contents: write # Needed to update files on the gh-pages branch - pull-requests: write # Needed to create deployment comments on PRs - steps: - - uses: ansys/actions/doc-deploy-pr@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} - bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} - cname: ${{ env.DOCUMENTATION_CNAME }} - doc-artifact-name: documentation-ubuntu-latest-html - maximum-pr-doc-deployments: 3 - token: ${{ secrets.GITHUB_TOKEN }} - - smoke-tests: name: Build wheelhouse and smoke tests runs-on: ${{ matrix.os }} @@ -247,7 +50,6 @@ jobs: attestations: write # Required to create and publish build attestations (SLSA provenance) contents: read # Required to read repository content for building id-token: write # Required for OIDC token generation (for provenance signing) - needs: [analyze-changes] strategy: fail-fast: false matrix: @@ -257,7 +59,7 @@ jobs: steps: - name: Build wheelhouse and perform smoke test id: build-wheelhouse - uses: ansys/actions/build-wheelhouse@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 + uses: ansys/actions/build-wheelhouse@refactor/split-check-licenses-into-different-venvs with: attest-provenance: true library-name: ${{ env.PACKAGE_NAME }} @@ -275,1126 +77,31 @@ jobs: ${ACTIVATE_VENV} python -c "import ansys.aedt.core; from ansys.aedt.core import __version__" - smoke-tests-rocky: - name: Build wheelhouse and smoke tests (Rocky Linux) + failing-smoke-tests: + name: Build wheelhouse failure + runs-on: ubuntu-latest permissions: attestations: write # Required to create and publish build attestations (SLSA provenance) contents: read # Required to read repository content for building id-token: write # Required for OIDC token generation (for provenance signing) - uses: ./.github/workflows/reusable-smoke-tests-rocky.yml - with: - python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' - - unit-tests: - name: Unit tests - needs: [smoke-tests, smoke-tests-rocky, analyze-changes] - if: needs.analyze-changes.outputs.skip_tests != 'true' - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Install Xvfb - shell: bash - run: sudo apt-get install -y xvfb - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Run unit tests - env: - PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS_NON_TESTMON }} - run: | - source .venv/bin/activate - xvfb-run pytest ${PYTEST_ARGUMENTS_NON_TESTMON} tests/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 - needs: [unit-tests, analyze-changes] - if: needs.analyze-changes.outputs.skip_tests != 'true' - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Run integration tests - env: - PYTEST_ARGUMENTS_NON_TESTMON: ${{ env.PYTEST_ARGUMENTS_NON_TESTMON }} - run: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS_NON_TESTMON} tests/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) - needs: [integration-tests, analyze-changes] - if: github.event.pull_request.draft == false && needs.analyze-changes.outputs.skip_tests != 'true' - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - uv sync --frozen --group tests --extra all - - - name: Wait for master cache update - uses: ./.github/actions/check-cache - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_SOLVERS_WIN }} - - - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/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) - needs: [integration-tests, analyze-changes] - if: github.event.pull_request.draft == false && needs.analyze-changes.outputs.skip_tests != 'true' - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Wait for master cache update - uses: ./.github/actions/check-cache - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_SOLVERS_LINUX }} - - - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/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) - needs: [integration-tests, analyze-changes] - if: github.event.pull_request.draft == false && needs.analyze-changes.outputs.skip_tests != 'true' - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - uv sync --frozen --group tests --extra all - - - name: Wait for master cache update - uses: ./.github/actions/check-cache - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_GENERAL_WIN }} - - - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args -n 4 --dist loadfile --timeout=600 tests/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) - if: github.event.pull_request.draft == false && needs.analyze-changes.outputs.skip_tests != 'true' - needs: [integration-tests, analyze-changes] - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Wait for master cache update - uses: ./.github/actions/check-cache - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_GENERAL_LINUX }} - - - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} -n 4 --dist loadfile --timeout=600 tests/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) - needs: [integration-tests, analyze-changes] - if: github.event.pull_request.draft == false && needs.analyze-changes.outputs.skip_tests != 'true' - runs-on: [ self-hosted, Windows, pyaedt ] - env: - MPLBACKEND: 'Agg' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - uv sync --frozen --group tests --extra all - - - name: Wait for master cache update - uses: ./.github/actions/check-cache - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_VISUALIZATION_WIN }} - - - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args -n 4 --dist loadfile --timeout=600 tests/system/visualization -x - - - 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) - if: github.event.pull_request.draft == false && needs.analyze-changes.outputs.skip_tests != 'true' - needs: [integration-tests, analyze-changes] - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Wait for master cache update - uses: ./.github/actions/check-cache - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_VISUALIZATION_LINUX }} - - - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} -n 4 --dist loadfile --timeout=300 tests/system/visualization -x - - - 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) - needs: [integration-tests, analyze-changes] - if: github.event.pull_request.draft == false && needs.analyze-changes.outputs.skip_tests != 'true' - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - uv sync --frozen --group tests --extra all - - - name: Wait for master cache update - uses: ./.github/actions/check-cache - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_ICEPAK_WIN }} - - - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/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) - needs: [integration-tests, analyze-changes] - if: github.event.pull_request.draft == false && needs.analyze-changes.outputs.skip_tests != 'true' - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Wait for master cache update - uses: ./.github/actions/check-cache - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_ICEPAK_LINUX }} - - - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/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) - needs: [integration-tests, analyze-changes] - if: github.event.pull_request.draft == false && needs.analyze-changes.outputs.skip_tests != 'true' - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - uv sync --frozen --group tests --extra all - - - name: Wait for master cache update - uses: ./.github/actions/check-cache - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_LAYOUT_WIN }} - - - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/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) - needs: [integration-tests, analyze-changes] - if: github.event.pull_request.draft == false && needs.analyze-changes.outputs.skip_tests != 'true' - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Wait for master cache update - uses: ./.github/actions/check-cache - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_LAYOUT_LINUX }} - - - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/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() }} - -# ================================================================================================= -# vvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# ================================================================================================= - - system-tests-extensions-windows: - name: Test extensions (windows) - needs: [integration-tests, analyze-changes] - if: github.event.pull_request.draft == false && needs.analyze-changes.outputs.skip_tests != 'true' && needs.analyze-changes.outputs.extensions_changed == 'true' - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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 'extensions' - env: - PYTHONMALLOC: malloc - PYTEST_ARGUMENTS_NON_TESTMON: ${{ env.PYTEST_ARGUMENTS_NON_TESTMON }} - run: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS_NON_TESTMON -split ' ' - pytest @args --timeout=600 tests/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) - if: github.event.pull_request.draft == false && needs.analyze-changes.outputs.skip_tests != 'true' && needs.analyze-changes.outputs.extensions_changed == 'true' - needs: [integration-tests, analyze-changes] - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS_NON_TESTMON} --timeout=600 tests/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) - needs: [integration-tests, analyze-changes] - if: github.event.pull_request.draft == false && needs.analyze-changes.outputs.skip_tests != 'true' - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - uv sync --frozen --group tests --extra all - - - name: Wait for master cache update - uses: ./.github/actions/check-cache - -# - name: Restore testmondata cache -# uses: ./.github/actions/testmon-cache -# with: -# testmon-datafile: ${{ env.TESTMON_DATAFILE }} -# cache-key: ${{ env.TESTMON_CACHE_KEY_FILTER_WIN }} - - - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/filter_solutions - - - 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) - needs: [integration-tests, analyze-changes] - if: github.event.pull_request.draft == false && needs.analyze-changes.outputs.skip_tests != 'true' - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - uv sync --frozen --group tests --extra all - - - name: Wait for master cache update - uses: ./.github/actions/check-cache - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_EMIT_WIN }} - - - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 -v -rA --color=yes tests/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 - - package: - name: Package library - needs: [analyze-changes, - system-tests-solvers-windows, - system-tests-solvers-linux, - system-tests-general-windows, - system-tests-general-linux, - system-tests-visualization-windows, - system-tests-visualization-linux, - system-tests-icepak-windows, - system-tests-icepak-linux, - system-tests-layout-windows, - system-tests-layout-linux, - system-tests-extensions-windows, - system-tests-extensions-linux, - system-tests-filter-windows, - system-tests-emit-windows, - doc-build] - runs-on: ubuntu-latest - if: | - always() && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') - permissions: - attestations: write # Required to create and publish package attestations (SLSA provenance) - contents: read # Required to read repository content for packaging - id-token: write # Required for OIDC token generation (for provenance signing) steps: - - name: Build library source and wheel artifacts - uses: ansys/actions/build-library@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 + - name: Build wheelhouse and perform smoke test + id: build-wheelhouse + uses: ansys/actions/build-wheelhouse@refactor/split-check-licenses-into-different-venvs with: attest-provenance: true library-name: ${{ env.PACKAGE_NAME }} - python-version: ${{ env.MAIN_PYTHON_VERSION }} + operating-system: ubuntu-latest + python-version: '3.10' + target: 'all' use-python-cache: false + + smoke-tests-rocky: + name: Build wheelhouse and smoke tests (Rocky Linux) + permissions: + attestations: write # Required to create and publish build attestations (SLSA provenance) + contents: read # Required to read repository content for building + id-token: write # Required for OIDC token generation (for provenance signing) + uses: ./.github/workflows/reusable-smoke-tests-rocky.yml + with: + python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml deleted file mode 100644 index 8060abdeb9ae..000000000000 --- a/.github/workflows/label.yml +++ /dev/null @@ -1,189 +0,0 @@ -name: Labeler - -on: - pull_request: - # opened, reopened, and synchronize are default for pull_request - # edited - when PR title or body is changed - # labeled - when labels are added to PR - types: [opened, reopened, synchronize, edited, labeled] - push: - branches: [ main ] - paths: - - '../labels.yml' - -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: - - label-syncer: - name: Syncer - runs-on: ubuntu-latest - permissions: - pull-requests: write # Needed to add existing labels to PRs - issues: write # Needed to create labels that do not already exist - steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - labeler: - name: Set labels - needs: [label-syncer] - permissions: - contents: read # Required to read repository files and .github/labeler.yml configuration - pull-requests: write # Required to add/modify labels on pull requests - runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUMBER: ${{ github.event.pull_request.number }} - steps: - # Label based on modified files - - name: Label based on changed files - uses: actions/labeler@f27b608878404679385c85cfa523b85ccb86e213 # v6.1.0 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - - # Label based on branch name - - name: Label docs - if: startsWith(github.event.pull_request.head.ref, 'docs') - run: gh pr edit "$PR_NUMBER" --add-label "documentation" --repo ansys/pyaedt - - - name: Label maintenance - if: | - startsWith(github.event.pull_request.head.ref, 'maint') || - startsWith(github.event.pull_request.head.ref, 'ci') - run: gh pr edit "$PR_NUMBER" --add-label "maintenance" --repo ansys/pyaedt - - - name: Label enhancement - if: startsWith(github.event.pull_request.head.ref, 'feat') - run: gh pr edit "$PR_NUMBER" --add-label "enhancement" --repo ansys/pyaedt - - - name: Label bug - if: startsWith(github.event.pull_request.head.ref, 'fix') - run: gh pr edit "$PR_NUMBER" --add-label "bug" --repo ansys/pyaedt - - - name: Label testing - if: startsWith(github.event.pull_request.head.ref, 'test') - run: gh pr edit "$PR_NUMBER" --add-label "testing" --repo ansys/pyaedt - - - name: Label extension - if: | - contains(github.event.pull_request.title, 'extension') || - contains(github.event.pull_request.title, 'extensions') - run: gh pr edit "$PR_NUMBER" --add-label "extensions" --repo ansys/pyaedt - - - name: Label examples - if: contains(github.event.pull_request.title, 'pyaedt-examples') - run: gh pr edit "$PR_NUMBER" --add-label "examples" --repo ansys/pyaedt - - # Label based on trailers in PR description and commit messages - - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - sparse-checkout: .github/actions/label-from-trailers/action.yml - persist-credentials: false - sparse-checkout-cone-mode: false - - - name: Label based on trailers - if: github.event_name == 'pull_request' - uses: ./.github/actions/label-from-trailers - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - pr-number: ${{ github.event.pull_request.number }} - - commenter: - name: Suggest labels if none assigned - runs-on: ubuntu-latest - permissions: - contents: read # Required to read PR metadata - pull-requests: write # Required to post comments on pull requests - steps: - - name: Suggest to add labels - uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 - # Execute only when no labels have been applied to the pull request - if: toJSON(github.event.pull_request.labels.*.name) == '{}' - with: - issue-number: ${{ github.event.pull_request.number }} - body: | - Please add one of the following labels to add this contribution to the Release Notes :point_down: - - [bug](https://github.com/ansys/pyaedt/pulls?q=label%3Abug+) - - [documentation](https://github.com/ansys/pyaedt/pulls?q=label%3Adocumentation+) - - [enhancement](https://github.com/ansys/pyaedt/pulls?q=label%3Aenhancement+) - - [good first issue](https://github.com/ansys/pyaedt/pulls?q=label%3Agood+first+issue) - - [maintenance](https://github.com/ansys/pyaedt/pulls?q=label%3Amaintenance+) - - [release](https://github.com/ansys/pyaedt/pulls?q=label%3Arelease+) - - [testing](https://github.com/ansys/pyaedt/pulls?q=label%Atesting+) - - changelog-fragment: - name: "Create changelog fragment" - needs: [labeler] - permissions: - contents: write # Required to commit changelog fragments to the repository - pull-requests: write # Required to update PR with changelog information - runs-on: ubuntu-latest - steps: - - uses: ansys/actions/doc-changelog@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} - bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} - token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} - use-pull-request-title: true - use-default-towncrier-config: true - use-python-cache: false - - check-pr-template: - name: Check PR template - # NOTE: Disable checking for dependabot and other automated PRs - if: | - !startsWith(github.event.pull_request.title, 'BUILD(uv):') && - !startsWith(github.event.pull_request.title, 'BUILD(actions):') && - !startsWith(github.event.pull_request.title, 'BUILD(pre-commit):') && - !startsWith(github.event.pull_request.title, 'CHORE: update CHANGELOG for v') && - github.event.pull_request.user.login != 'pyansys-automation' - runs-on: ubuntu-latest - permissions: - pull-requests: read # Required to read PR content for validation - steps: - - name: Check PR description - env: - PR_BODY: ${{ github.event.pull_request.body }} - run: | - ERRORS=() - - # Check required sections exist - for section in "## Description" "## Issue linked" "## Checklist"; do - if ! echo "$PR_BODY" | grep -qF "$section"; then - ERRORS+=("Missing section: '$section'") - fi - done - - # Check placeholder texts have been replaced - PLACEHOLDERS=( - "**Please provide a brief description of the changes made in this pull request.**" - "**Please mention the issue number or describe the problem this pull request addresses.**" - ) - for placeholder in "${PLACEHOLDERS[@]}"; do - if echo "$PR_BODY" | grep -qF "$placeholder"; then - ERRORS+=("Placeholder not replaced: '$placeholder'") - fi - done - - # Report - if [ ${#ERRORS[@]} -ne 0 ]; then - echo "PR description validation failed:" - for err in "${ERRORS[@]}"; do - echo " - $err" - done - exit 1 - fi - - echo "PR description is valid." diff --git a/.github/workflows/manual-build-wheelhouse.yml b/.github/workflows/manual-build-wheelhouse.yml deleted file mode 100644 index 41d4676af501..000000000000 --- a/.github/workflows/manual-build-wheelhouse.yml +++ /dev/null @@ -1,219 +0,0 @@ -name: Manual Build Wheelhouse - -on: - workflow_dispatch: - inputs: - pyaedt-branch: - description: "PyAEDT branch used to run the test" - default: 'main' - type: string - build-ubuntu-wheels: - description: "Build Ubuntu wheelhouse artifacts" - default: 'no' - type: choice - options: - - 'yes' - - 'no' - build-windows-wheels: - description: "Build Windows wheelhouse artifacts" - default: 'no' - type: choice - options: - - 'yes' - - 'no' - build-rocky-wheels: - description: "Build Rocky Linux wheelhouse artifacts" - default: 'no' - type: choice - options: - - 'yes' - - 'no' - python-version: - description: "Python version to build for (choose 'all' for all supported versions)" - default: '3.10' - type: choice - options: - - 'all' - - '3.10' - - '3.11' - - '3.12' - - '3.13' - - '3.14' - target: - description: "Package extras to build" - default: 'all' - type: choice - options: - - 'all' - - 'all-dotnet' - -env: - PACKAGE_NAME: 'PyAEDT' - -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: - - build-wheelhouse-ubuntu-all: - if: github.event.inputs.build-ubuntu-wheels == 'yes' && github.event.inputs.python-version == 'all' - name: Build wheelhouse (Ubuntu, all) - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python-version: ['3.10','3.11','3.12','3.13', '3.14'] - steps: - - name: Clone PyAEDT using specified input branch - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - ref: ${{ github.event.inputs.pyaedt-branch }} - persist-credentials: false - - - name: Build wheelhouse and perform smoke test - id: build-wheelhouse-ubuntu - uses: ansys/actions/build-wheelhouse@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - checkout: false - library-name: ${{ env.PACKAGE_NAME }} - operating-system: ubuntu-latest - python-version: ${{ matrix.python-version }} - target: ${{ github.event.inputs.target }} - use-python-cache: false - whitelist-license-check: 'fpdf2' - - - name: Import python package - env: - ACTIVATE_VENV: ${{ steps.build-wheelhouse-ubuntu.outputs.activate-venv }} - shell: bash - run: | - ${ACTIVATE_VENV} - python -c "import ansys.aedt.core; from ansys.aedt.core import __version__" - - build-wheelhouse-ubuntu-single: - if: github.event.inputs.build-ubuntu-wheels == 'yes' && github.event.inputs.python-version != 'all' - name: Build wheelhouse (Ubuntu, single) - runs-on: ubuntu-latest - steps: - - name: Clone PyAEDT using specified input branch - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - ref: ${{ github.event.inputs.pyaedt-branch }} - persist-credentials: false - - - name: Build wheelhouse and perform smoke test - id: build-wheelhouse-ubuntu - uses: ansys/actions/build-wheelhouse@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - checkout: false - library-name: ${{ env.PACKAGE_NAME }} - operating-system: ubuntu-latest - python-version: ${{ github.event.inputs.python-version }} - target: ${{ github.event.inputs.target }} - use-python-cache: false - whitelist-license-check: 'fpdf2' - - - name: Import python package - env: - ACTIVATE_VENV: ${{ steps.build-wheelhouse-ubuntu.outputs.activate-venv }} - shell: bash - run: | - ${ACTIVATE_VENV} - python -c "import ansys.aedt.core; from ansys.aedt.core import __version__" - - build-wheelhouse-windows-all: - if: github.event.inputs.build-windows-wheels == 'yes' && github.event.inputs.python-version == 'all' - name: Build wheelhouse (Windows, all) - runs-on: windows-latest - strategy: - fail-fast: false - matrix: - python-version: ['3.10','3.11','3.12','3.13', '3.14'] - steps: - - name: Clone PyAEDT using specified input branch - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - ref: ${{ github.event.inputs.pyaedt-branch }} - persist-credentials: false - - - name: Build wheelhouse and perform smoke test - id: build-wheelhouse-windows - uses: ansys/actions/build-wheelhouse@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - checkout: false - library-name: ${{ env.PACKAGE_NAME }} - operating-system: windows-latest - python-version: ${{ matrix.python-version }} - target: ${{ github.event.inputs.target }} - use-python-cache: false - whitelist-license-check: 'fpdf2' - - - name: Import python package - env: - ACTIVATE_VENV: ${{ steps.build-wheelhouse-windows.outputs.activate-venv }} - shell: bash - run: | - ${ACTIVATE_VENV} - python -c "import ansys.aedt.core; from ansys.aedt.core import __version__" - - build-wheelhouse-windows-single: - if: github.event.inputs.build-windows-wheels == 'yes' && github.event.inputs.python-version != 'all' - name: Build wheelhouse (Windows, single) - runs-on: windows-latest - steps: - - name: Clone PyAEDT using specified input branch - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - ref: ${{ github.event.inputs.pyaedt-branch }} - persist-credentials: false - - - name: Build wheelhouse and perform smoke test - id: build-wheelhouse-windows - uses: ansys/actions/build-wheelhouse@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - checkout: false - library-name: ${{ env.PACKAGE_NAME }} - operating-system: windows-latest - python-version: ${{ github.event.inputs.python-version }} - target: ${{ github.event.inputs.target }} - use-python-cache: false - whitelist-license-check: 'fpdf2' - - - name: Import python package - env: - ACTIVATE_VENV: ${{ steps.build-wheelhouse-windows.outputs.activate-venv }} - shell: bash - run: | - ${ACTIVATE_VENV} - python -c "import ansys.aedt.core; from ansys.aedt.core import __version__" - - build-wheelhouse-rocky-all: - if: github.event.inputs.build-rocky-wheels == 'yes' && github.event.inputs.python-version == 'all' - name: Build wheelhouse (Rocky Linux) - permissions: - attestations: write # Required to create and publish build attestations (SLSA provenance) - contents: read # Required to read repository content for building - id-token: write # Required for OIDC token generation (for provenance signing) - uses: ./.github/workflows/reusable-smoke-tests-rocky.yml - with: - python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' - extras: ${{ format('["{0}"]', github.event.inputs.target) }} - checkout-ref: ${{ github.event.inputs.pyaedt-branch }} - - build-wheelhouse-rocky-single: - if: github.event.inputs.build-rocky-wheels == 'yes' && github.event.inputs.python-version != 'all' - name: Build wheelhouse (Rocky Linux) - permissions: - attestations: write # Required to create and publish build attestations (SLSA provenance) - contents: read # Required to read repository content for building - id-token: write # Required for OIDC token generation (for provenance signing) - uses: ./.github/workflows/reusable-smoke-tests-rocky.yml - with: - python-versions: ${{ format('["{0}"]', github.event.inputs.python-version) }} - extras: ${{ format('["{0}"]', github.event.inputs.target) }} - checkout-ref: ${{ github.event.inputs.pyaedt-branch }} diff --git a/.github/workflows/manual_draft.yml b/.github/workflows/manual_draft.yml deleted file mode 100644 index 9c1725bab06c..000000000000 --- a/.github/workflows/manual_draft.yml +++ /dev/null @@ -1,749 +0,0 @@ -name: Draft workflow - -on: - workflow_dispatch: - inputs: - test-solvers-windows: - description: "Testing solvers (Windows)" - default: 'no' - type: choice - options: - - 'yes' - - 'no' - test-solvers-linux: - description: "Testing solvers (Linux)" - default: 'no' - type: choice - options: - - 'yes' - - 'no' - test-general-windows: - description: "Testing general (Windows)" - default: 'no' - type: choice - options: - - 'yes' - - 'no' - test-general-linux: - description: "Testing general (Linux)" - type: choice - default: 'no' - options: - - 'yes' - - 'no' - test-visualization-windows: - description: "Testing visualization (Windows)" - default: 'no' - type: choice - options: - - 'yes' - - 'no' - test-visualization-linux: - description: "Testing visualization (Linux)" - default: 'no' - type: choice - options: - - 'yes' - - 'no' - test-extensions-windows: - description: "Testing extensions (Windows)" - default: 'no' - type: choice - options: - - 'yes' - - 'no' - test-extensions-linux: - description: "Testing extensions (Linux)" - type: choice - default: 'no' - options: - - 'yes' - - 'no' - test-emit-windows: - description: "Testing Emit (Windows)" - default: 'no' - type: choice - options: - - 'yes' - - 'no' - test-filter-solutions-windows: - description: "Testing Filter Solutions (Windows)" - default: 'no' - type: choice - options: - - 'yes' - - 'no' - -env: - MAIN_PYTHON_VERSION: '3.10' - PACKAGE_NAME: 'PyAEDT' - PYTEST_ARGUMENTS: '-vvv --color=yes -ra --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: - - system-test-solvers-windows: - name: Testing solvers and coverage (Windows) - if: github.event.inputs.test-solvers-windows == 'yes' - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - - - name: Create virtual environment - run: | - python -m venv .venv - .venv\Scripts\Activate.ps1 - python -m pip install pip -U - python -m pip install wheel setuptools -U - python -c "import sys; print(sys.executable)" - - - name: Install pyaedt and tests dependencies - run: | - .venv\Scripts\Activate.ps1 - pip install . --group tests - pip install pytest-azurepipelines - - - 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: | - .venv\Scripts\Activate.ps1 - pytest ${PYTEST_ARGUMENTS} -m solvers - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-system-solvers-tests-windows - files: ./coverage.xml - flags: system,solvers,windows - - - 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() }} - - system-test-solvers-linux: - name: Testing solvers and coverage (Linux) - if: github.event.inputs.test-solvers-linux == 'yes' - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - - - name: Create virtual environment - run: | - python -m venv .venv - source .venv/bin/activate - python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pip -U - python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org wheel setuptools -U - python -c "import sys; print(sys.executable)" - - - name: Install pyaedt and tests dependencies - run: | - source .venv/bin/activate - pip install . --group tests - pip install pytest-azurepipelines - - - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} -m solvers - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-system-solvers-tests-linux - files: ./coverage.xml - flags: system,solver,linux - - - 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() }} - - system-tests-general-windows: - name: Testing general and coverage (Windows) - if: github.event.inputs.test-general-windows == 'yes' - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - - - name: Create virtual environment - run: | - python -m venv .venv - .venv\Scripts\Activate.ps1 - python -m pip install pip -U - python -m pip install wheel setuptools -U - python -c "import sys; print(sys.executable)" - - - name: Install pyaedt and tests dependencies - run: | - .venv\Scripts\Activate.ps1 - pip install . --group tests - pip install pytest-azurepipelines - - - 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' - uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 - env: - PYTHONMALLOC: malloc - with: - max_attempts: 2 - retry_on: error - timeout_minutes: 50 - command: | - .venv\Scripts\Activate.ps1 - pytest ${{ env.PYTEST_ARGUMENTS }} -n 4 --dist loadfile -m general - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-system-general-tests-windows - files: ./coverage.xml - flags: system,general,windows - - - 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() }} - - system-tests-general-linux: - name: Testing general and coverage (Linux) - if: github.event.inputs.test-general-linux == 'yes' - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - - - name: Create virtual environment - run: | - python -m venv .venv - source .venv/bin/activate - python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pip -U - python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org wheel setuptools -U - python -c "import sys; print(sys.executable)" - - - name: Install pyaedt and tests dependencies - run: | - source .venv/bin/activate - pip install . --group tests - pip install pytest-azurepipelines - - - name: Install CI dependencies (e.g. vtk-osmesa) - run: | - source .venv/bin/activate - # Uninstall conflicting dependencies - pip uninstall --yes vtk - pip install --index-url https://wheels.vtk.org vtk-osmesa==9.3.1 - - - 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' - uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 - with: - max_attempts: 2 - retry_on: error - timeout_minutes: 50 - command: | - source .venv/bin/activate - pytest ${{ env.PYTEST_ARGUMENTS }} -n 4 --dist loadfile -m general - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-system-general-tests - files: ./coverage.xml - flags: system,solver,linux - - - 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() }} - - system-tests-visualization-windows: - name: Test visualization (windows) - if: github.event.inputs.test-visualization-windows == 'yes' - runs-on: [ self-hosted, Windows, pyaedt ] - env: - MPLBACKEND: 'Agg' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - - - name: Create virtual environment - run: | - python -m venv .venv - .venv\Scripts\Activate.ps1 - python -m pip install pip -U - python -m pip install wheel setuptools -U - python -c "import sys; print(sys.executable)" - - - name: Install pyaedt and tests dependencies - run: | - .venv\Scripts\Activate.ps1 - pip install . --group tests - - - 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' - uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 - env: - PYTHONMALLOC: malloc - with: - max_attempts: 2 - retry_on: error - timeout_minutes: 40 - command: | - .venv\Scripts\Activate.ps1 - pytest ${{ env.PYTEST_ARGUMENTS }} -n 4 --dist loadfile --timeout=600 -m visualization -x - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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() }} - - system-tests-visualization-linux: - name: Test visualization (linux) - if: github.event.inputs.test-visualization-linux == 'yes' - - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - - - name: Create virtual environment - run: | - python -m venv .venv - source .venv/bin/activate - python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pip -U - python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org wheel setuptools -U - python -c "import sys; print(sys.executable)" - - - name: Install pyaedt and tests dependencies - run: | - source .venv/bin/activate - pip install . --group tests - - - 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 - - # NOTE: Run visualization tests in two separate steps to avoid conflicts when - # loading Ansys EM libraries and vtk osmesa backend. - - name: Run tests marked with 'visualization' and not 'avoid_ansys_load' - uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 - with: - max_attempts: 2 - retry_on: error - timeout_minutes: 30 - command: | - source .venv/bin/activate - pytest ${{ env.PYTEST_ARGUMENTS }} -n 4 --dist loadfile --timeout=300 -m "visualization and not avoid_ansys_load" -x --cov-append - - - name: Run tests marked with 'visualization' and 'avoid_ansys_load' - uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 - with: - max_attempts: 2 - retry_on: error - timeout_minutes: 40 - command: | - source .venv/bin/activate - pytest ${{ env.PYTEST_ARGUMENTS }} -n 4 --dist loadfile --timeout=300 -m "visualization and avoid_ansys_load" -x --cov-append - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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() }} - - system-tests-extensions-windows: - name: Test extensions (windows) - if: github.event.inputs.test-extensions-windows == 'yes' - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - - - name: Create virtual environment - run: | - python -m venv .venv - .venv\Scripts\Activate.ps1 - python -m pip install pip -U - python -m pip install wheel setuptools -U - python -c "import sys; print(sys.executable)" - - - name: Install pyaedt and tests dependencies - run: | - .venv\Scripts\Activate.ps1 - pip install . --group tests - - - 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 'extensions' - uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 - env: - PYTHONMALLOC: malloc - with: - max_attempts: 2 - retry_on: error - timeout_minutes: 120 - command: | - .venv\Scripts\Activate.ps1 - pytest ${{ env.PYTEST_ARGUMENTS }} --timeout=600 -m extensions - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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() }} - - system-tests-extensions-linux: - name: Test extensions (linux) - if: github.event.inputs.test-extensions-linux == 'yes' - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - - - name: Create virtual environment - run: | - python -m venv .venv - source .venv/bin/activate - python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pip -U - python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org wheel setuptools -U - python -c "import sys; print(sys.executable)" - - - name: Install pyaedt and tests dependencies - run: | - source .venv/bin/activate - pip install . --group tests - - - 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' - uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 - with: - max_attempts: 2 - retry_on: error - timeout_minutes: 120 - command: | - source .venv/bin/activate - pytest ${{ env.PYTEST_ARGUMENTS }} --timeout=600 -m extensions - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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() }} - - - system-tests-emit-windows: - name: Test EMIT (windows) - if: github.event.inputs.test-emit-windows == 'yes' - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - - - name: Create virtual environment - run: | - python -m venv .venv - .venv\Scripts\Activate.ps1 - python -m pip install pip -U - python -m pip install wheel setuptools -U - python -c "import sys; print(sys.executable)" - - - name: Install pyaedt and tests dependencies - run: | - .venv\Scripts\Activate.ps1 - pip install . --group tests - - - 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' - uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 - env: - PYTHONMALLOC: malloc - with: - max_attempts: 2 - retry_on: error - timeout_minutes: 30 - command: | - .venv\Scripts\Activate.ps1 - pytest ${{ env.PYTEST_ARGUMENTS }} --timeout=600 -v -rA --color=yes -m emit - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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 - if: ${{ always() }} - - system-tests-filter-solutions: - name: Test filter solutions (windows) - if: github.event.inputs.test-filter-solutions-windows == 'yes' - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - - - name: Create virtual environment - run: | - python -m venv .venv - .venv\Scripts\Activate.ps1 - python -m pip install pip -U - python -m pip install wheel setuptools -U - python -c "import sys; print(sys.executable)" - - - name: Install pyaedt and tests dependencies - run: | - .venv\Scripts\Activate.ps1 - pip install . --group tests - - - 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' - uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 - env: - PYTHONMALLOC: malloc - with: - max_attempts: 2 - retry_on: error - timeout_minutes: 120 - command: | - .venv\Scripts\Activate.ps1 - pytest ${{ env.PYTEST_ARGUMENTS }} --timeout=600 -m filter_solutions - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-system-filter-tests-windows - files: ./coverage.xml - flags: windows_system_filter - - - name: Upload pytest test results - if: ${{ always() }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pytest-filter_solutions-windows - path: junit/test-results.xml \ No newline at end of file diff --git a/.github/workflows/nightly-docs.yml b/.github/workflows/nightly-docs.yml deleted file mode 100644 index 914e8e2b9de3..000000000000 --- a/.github/workflows/nightly-docs.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Nightly Documentation Build - -on: - workflow_dispatch: - schedule: # UTC at 0300 - - cron: '0 3 * * *' - -env: - ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} - MAIN_PYTHON_VERSION: '3.14' - DOCUMENTATION_CNAME: 'aedt.docs.pyansys.com' - -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: - - doc-build: - name: Documentation build - runs-on: ubuntu-latest - steps: - - name: Documentation build - uses: ansys/actions/doc-build@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - dependencies: "graphviz texlive-latex-extra latexmk texlive-xetex texlive-fonts-extra" - skip-install: true - python-version: ${{ env.MAIN_PYTHON_VERSION }} - use-python-cache: false - sphinxopts: '-j auto --color -w build_errors.txt' - check-links: false - needs-quarto: true - optional-dependencies-name: 'all' - group-dependencies-name: 'doc' - - upload-dev-doc: - name: Upload dev documentation - runs-on: ubuntu-latest - needs: doc-build - permissions: - contents: write # Required to commit and push development documentation to gh-pages branch - steps: - - name: Upload development documentation - uses: ansys/actions/doc-deploy-dev@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} - bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} - cname: ${{ env.DOCUMENTATION_CNAME }} - token: ${{ secrets.GITHUB_TOKEN }} - use-python-cache: false diff --git a/.github/workflows/nightly-tests.yml b/.github/workflows/nightly-tests.yml deleted file mode 100644 index 028508d75b13..000000000000 --- a/.github/workflows/nightly-tests.yml +++ /dev/null @@ -1,1064 +0,0 @@ -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_LOCAL_SETTINGS_PATH: 'tests/pyaedt_settings.yaml' - PYTEST_ARGUMENTS: '-vvv --color=yes -ra --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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Install Xvfb - shell: bash - run: sudo apt-get install -y xvfb - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Run unit tests - env: - PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }} - run: | - source .venv/bin/activate - xvfb-run pytest ${PYTEST_ARGUMENTS} tests/unit - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Run integration tests - env: - PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }} - run: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} tests/integration - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/solvers - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/system/solvers - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args -n 4 --dist loadfile --timeout=600 tests/system/general - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} -n 4 --dist loadfile --timeout=600 tests/system/general - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args -n 4 --dist loadfile --timeout=600 tests/system/visualization -x - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} -n 4 --dist loadfile --timeout=300 tests/system/visualization -x - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/icepak - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/system/icepak - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/layout - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/system/layout - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - 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@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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 'extensions' - env: - PYTHONMALLOC: malloc - PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }} - run: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/extensions - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/system/extensions - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - 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@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/filter_solutions - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - 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@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 -v -rA --color=yes tests/system/emit - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - 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 diff --git a/.github/workflows/prune-testmon-caches.yml b/.github/workflows/prune-testmon-caches.yml deleted file mode 100644 index 9996d215c92f..000000000000 --- a/.github/workflows/prune-testmon-caches.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: prune Testmon Caches - -on: - workflow_dispatch: - -permissions: {} - -concurrency: - group: prune-testmon-caches - cancel-in-progress: true - -jobs: - prune-testmon-caches: - name: prune all testmon caches - runs-on: ubuntu-latest - permissions: - actions: write # Required to delete workflow caches - steps: - - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Delete testmon caches - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - REPO: ${{ github.repository }} - run: | - echo "Pruning testmon caches..." - - # Get all caches that start with "testmondata-" - cache_ids=$(gh cache list --repo "$REPO" --json id,key --jq '.[] | select(.key | startswith("testmondata-")) | .id' 2>/dev/null) - - if [ -z "$cache_ids" ]; then - echo "No testmon caches found" - else - total_deleted=0 - for cache_id in $cache_ids; do - echo "Deleting cache ID: $cache_id" - gh cache delete "$cache_id" --repo "$REPO" && ((total_deleted++)) || echo "Failed to delete cache ID: $cache_id" - done - echo "" - echo "Testmon cache prune completed - deleted $total_deleted cache(s)" - fi diff --git a/.github/workflows/reusable-smoke-tests-rocky.yml b/.github/workflows/reusable-smoke-tests-rocky.yml index 73f7e58f8c28..27beb9c54b54 100644 --- a/.github/workflows/reusable-smoke-tests-rocky.yml +++ b/.github/workflows/reusable-smoke-tests-rocky.yml @@ -74,7 +74,7 @@ jobs: - name: Build wheelhouse and perform smoke test id: build-wheelhouse-rocky - uses: ansys/actions/build-wheelhouse@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 + uses: ansys/actions/build-wheelhouse@refactor/split-check-licenses-into-different-venvs with: attest-provenance: true checkout: false diff --git a/.github/workflows/sync-release.yml b/.github/workflows/sync-release.yml deleted file mode 100644 index e9892bdd2d1f..000000000000 --- a/.github/workflows/sync-release.yml +++ /dev/null @@ -1,1358 +0,0 @@ -name: Sync main to release/2.0 - -on: - schedule: - - cron: '0 6 * * 1' # Every Monday at 06:00 UTC - workflow_dispatch: # Manual trigger - pull_request: - branches: - - release/2.0 - types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] - -env: - ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} - MAIN_PYTHON_VERSION: '3.14' - TESTS_VERSION: '3.10' - PACKAGE_NAME: 'PyAEDT' - ON_CI: True - PYAEDT_DOC_BUILD_CHEATSHEET: False - PYTEST_ARGUMENTS: -vvv --color=yes -ra --durations=25 --maxfail=10 --junitxml=junit/test-results.xml - PYAEDT_LOCAL_SETTINGS_PATH: 'tests/pyaedt_settings.yaml' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: {} - -jobs: - - # Sync jobs: only on schedule / workflow_dispatch - check-conflicts: - name: "Check merge conflicts (main to release/2.0)" - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' - runs-on: ubuntu-latest - permissions: - contents: read - outputs: - has_conflicts: ${{ steps.check.outputs.has_conflicts }} - steps: - - name: Checkout release/2.0 - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - ref: release/2.0 - fetch-depth: 0 - persist-credentials: false - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Fetch main - run: git fetch origin main - - - name: Try merge (dry-run) - id: check - run: | - git config user.email "github-actions[bot]@users.noreply.github.com" - git config user.name "github-actions[bot]" - if git merge --no-commit --no-ff origin/main; then - echo "has_conflicts=false" >> "$GITHUB_OUTPUT" - else - echo "has_conflicts=true" >> "$GITHUB_OUTPUT" - fi - - - report-conflicts: - name: "Report merge conflicts" - needs: check-conflicts - if: | - (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && - needs.check-conflicts.outputs.has_conflicts == 'true' - runs-on: ubuntu-latest - permissions: {} - steps: - - name: Fail with conflict message - run: | - echo "::error::Merge conflicts detected between main and release/2.0. Manual intervention required." - exit 1 - - - create-sync-pr: - name: "Create sync PR (main to release/2.0)" - needs: check-conflicts - if: | - (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && - needs.check-conflicts.outputs.has_conflicts == 'false' - runs-on: ubuntu-latest - permissions: - contents: write # Push sync branch - pull-requests: write # Create PR - steps: - - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - fetch-depth: 0 - persist-credentials: true - token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} - - - name: Create or update sync branch - id: sync - run: | - git config user.email "github-actions[bot]@users.noreply.github.com" - git config user.name "github-actions[bot]" - git fetch origin main release/2.0 - BRANCH="auto/sync-main-to-release-2.0" - git checkout -b "$BRANCH" origin/release/2.0 - MERGE_OUTPUT=$(git merge --no-ff origin/main -m "chore: sync main into release/2.0" 2>&1) - MERGE_EXIT=$? - if [ $MERGE_EXIT -ne 0 ]; then - echo "::error::Merge failed unexpectedly. Output: $MERGE_OUTPUT" - exit 1 - elif echo "$MERGE_OUTPUT" | grep -q "Already up to date"; then - echo "up_to_date=true" >> "$GITHUB_OUTPUT" - echo "Branches are already up to date. Skipping." - else - echo "up_to_date=false" >> "$GITHUB_OUTPUT" - git push origin "$BRANCH" --force - fi - - - name: Open PR (skip if already exists) - if: steps.sync.outputs.up_to_date != 'true' - env: - GH_TOKEN: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} - run: | - BRANCH="auto/sync-main-to-release-2.0" - EXISTING=$(gh pr list --head "$BRANCH" --base release/2.0 --json number --jq '.[0].number') - if [ -z "$EXISTING" ]; then - BODY="## Description - Automated weekly sync of \`main\` into \`release/2.0\`. No conflicts detected. - - ## Issue linked - N/A - automated sync. - - ## Checklist - - [x] I have tested my changes locally. - - [x] I have followed the coding style guidelines of this project. - - [x] I have reviewed my changes before submitting this pull request." - - gh pr create \ - --head "$BRANCH" \ - --base release/2.0 \ - --title "CHORE: sync main into release/2.0" \ - --body "$BODY" - else - echo "PR #$EXISTING already exists, skipping creation." - fi - - - # CI jobs: run on PRs toward release/2.0 - pr-title: - name: Check the title of the PR - if: github.event_name == 'pull_request' - runs-on: ubuntu-latest - permissions: - pull-requests: read # Read PR title - steps: - - name: Check the title of the pull request - uses: ansys/actions/check-pr-title@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - use-upper-case: true - - breaking-change-check: - name: Check breaking change info - if: github.event_name == 'pull_request' - runs-on: ubuntu-latest - permissions: - pull-requests: read # Read PR title and labels - steps: - - name: Verify breaking change information - env: - PR_TITLE: ${{ github.event.pull_request.title }} - PR_LABELS: ${{ join(github.event.pull_request.labels.*.name, ',') }} - run: | - # Skip for automated sync PRs - if echo "$PR_TITLE" | grep -qi "sync main into release"; then - echo "Automated sync PR detected, skipping breaking change check." - exit 0 - fi - - # Skip for manual changes related to the release/2.0 maintenance - if echo "$PR_LABELS" | grep -qi "release-maintenance"; then - echo "Label 'release-maintenance' detected, skipping breaking change check." - exit 0 - fi - - # Check for breaking change indicators - if echo "$PR_TITLE" | grep -q '!:' || echo "$PR_LABELS" | grep -qi 'breaking'; then - echo "Breaking change information found." - else - echo "::error::PRs targeting release/2.0 must indicate breaking changes. Add '!' to the PR title (e.g., 'FEAT!: ...') or the 'Breaking-Change:' trailer, or apply a 'breaking-change' label." - exit 1 - fi - - vulnerabilities: - name: "Vulnerabilities" - if: github.event_name == 'pull_request' - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: ansys/actions/check-vulnerabilities@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - dev-mode: true - extra-targets: 'all' - python-version: ${{ env.MAIN_PYTHON_VERSION }} - python-package-name: ${{ env.PACKAGE_NAME }} - token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} - - actions-security: - name: "Check actions security" - if: github.event_name == 'pull_request' - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: ansys/actions/check-actions-security@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - generate-summary: true - token: ${{ secrets.GITHUB_TOKEN }} - auditing-level: 'high' - - doc-style: - name: Documentation style check - if: github.event_name == 'pull_request' - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - name: Check documentation style - uses: ansys/actions/doc-style@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - files: '["doc/source", ".github/plugin", ".github/skills"]' - fail-level: 'warning' - - doc-build: - name: Documentation build - if: github.event_name == 'pull_request' - needs: [doc-style] - runs-on: ubuntu-latest - steps: - - name: Documentation build - uses: ansys/actions/doc-build@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - dependencies: "graphviz texlive-latex-extra latexmk texlive-xetex texlive-fonts-extra" - skip-install: true - python-version: ${{ env.MAIN_PYTHON_VERSION }} - use-python-cache: false - sphinxopts: '-j auto --color -w build_errors.txt' - check-links: false - needs-quarto: false - optional-dependencies-name: 'all' - group-dependencies-name: 'doc' - - smoke-tests: - name: Build wheelhouse and smoke tests - if: github.event_name == 'pull_request' - runs-on: ${{ matrix.os }} - permissions: - attestations: write # Attest build provenance - contents: read - id-token: write # Sign attestations - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] - target: ['', 'all', 'all-dotnet'] - steps: - - name: Build wheelhouse and perform smoke test - id: build-wheelhouse - uses: ansys/actions/build-wheelhouse@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 - with: - attest-provenance: true - library-name: ${{ env.PACKAGE_NAME }} - operating-system: ${{ matrix.os }} - python-version: ${{ matrix.python-version }} - target: ${{ matrix.target }} - use-python-cache: false - whitelist-license-check: 'fpdf2' - - - name: Import python package - env: - ACTIVATE_VENV: ${{ steps.build-wheelhouse.outputs.activate-venv }} - shell: bash - run: | - ${ACTIVATE_VENV} - python -c "import ansys.aedt.core; from ansys.aedt.core import __version__" - - - smoke-tests-rocky: - name: Build wheelhouse and smoke tests (Rocky Linux) - if: github.event_name == 'pull_request' - permissions: - attestations: write # Required to create and publish build attestations (SLSA provenance) - contents: read # Required to read repository content for building - id-token: write # Required for OIDC token generation (for provenance signing) - uses: ./.github/workflows/reusable-smoke-tests-rocky.yml - with: - python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' - - unit-tests: - name: Unit tests - if: github.event_name == 'pull_request' - needs: [smoke-tests, smoke-tests-rocky] - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Install Xvfb - shell: bash - run: sudo apt-get install -y xvfb - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Run unit tests - env: - PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }} - run: | - source .venv/bin/activate - xvfb-run pytest ${PYTEST_ARGUMENTS} tests/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() }} - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-unit-tests - files: ./coverage.xml - flags: unit_tests - if: ${{ always() }} - - integration-tests: - name: Integration tests - if: github.event_name == 'pull_request' - needs: [unit-tests] - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Run integration tests - env: - PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }} - run: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} tests/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() }} - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-integration-tests - files: ./coverage.xml - flags: integration_tests - if: ${{ always() }} - -# ================================================================================================= -# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# ================================================================================================= - - system-tests-solvers-windows: - name: Test solvers (windows) - needs: [integration-tests] - if: github.event_name == 'pull_request' && github.event.pull_request.draft == false - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/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() }} - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-system-solvers-tests-windows - files: ./coverage.xml - flags: windows_system_solvers - if: ${{ always() }} - -# ================================================================================================= -# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# ================================================================================================= - - system-tests-solvers-linux: - name: Test solvers (linux) - needs: [integration-tests] - if: github.event_name == 'pull_request' && github.event.pull_request.draft == false - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/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() }} - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-system-solvers-tests-linux - files: ./coverage.xml - flags: linux_system_solvers - if: ${{ always() }} - -# ================================================================================================= -# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# ================================================================================================= - - system-tests-general-windows: - name: Test general (windows) - needs: [integration-tests] - if: github.event_name == 'pull_request' && github.event.pull_request.draft == false - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args -n 4 --dist loadfile --timeout=600 tests/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() }} - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-system-general-tests-windows - files: ./coverage.xml - flags: windows_system_general - if: ${{ always() }} - -# ================================================================================================= -# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# ================================================================================================= - - system-tests-general-linux: - name: Test general (linux) - needs: [integration-tests] - if: github.event_name == 'pull_request' && github.event.pull_request.draft == false - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - run: | - source .venv/bin/activate - 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' - env: - PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }} - run: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} -n 4 --dist loadfile --timeout=600 tests/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() }} - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-system-general-tests-linux - files: ./coverage.xml - flags: linux_system_general - if: ${{ always() }} - -# ================================================================================================= -# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# ================================================================================================= - - system-tests-visualization-windows: - name: Test visualization (windows) - needs: [integration-tests] - if: github.event_name == 'pull_request' && github.event.pull_request.draft == false - runs-on: [ self-hosted, Windows, pyaedt ] - env: - MPLBACKEND: 'Agg' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args -n 4 --dist loadfile --timeout=600 tests/system/visualization -x - - - 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() }} - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-system-visualization-tests-windows - files: ./coverage.xml - flags: windows_system_visualization - if: ${{ always() }} - -# ================================================================================================= -# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# ================================================================================================= - - system-tests-visualization-linux: - name: Test visualization (linux) - needs: [integration-tests] - if: github.event_name == 'pull_request' && github.event.pull_request.draft == false - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - run: | - source .venv/bin/activate - 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' - env: - PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }} - run: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} -n 4 --dist loadfile --timeout=300 tests/system/visualization -x - - - 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() }} - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-system-visualization-tests-linux - files: ./coverage.xml - flags: linux_system_visualization - if: ${{ always() }} - -# ================================================================================================= -# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# ================================================================================================= - - system-tests-icepak-windows: - name: Test icepak (windows) - needs: [integration-tests] - if: github.event_name == 'pull_request' && github.event.pull_request.draft == false - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/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() }} - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-system-icepak-tests-windows - files: ./coverage.xml - flags: windows_system_icepak - if: ${{ always() }} - -# ================================================================================================= -# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# ================================================================================================= - - system-tests-icepak-linux: - name: Test icepak (linux) - needs: [integration-tests] - if: github.event_name == 'pull_request' && github.event.pull_request.draft == false - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/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() }} - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-system-icepak-tests-linux - files: ./coverage.xml - flags: linux_system_icepak - if: ${{ always() }} - -# ================================================================================================= -# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# ================================================================================================= - - system-tests-layout-windows: - name: Test layout (windows) - needs: [integration-tests] - if: github.event_name == 'pull_request' && github.event.pull_request.draft == false - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/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() }} - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-system-layout-tests-windows - files: ./coverage.xml - flags: windows_system_layout - if: ${{ always() }} - -# ================================================================================================= -# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# ================================================================================================= - - system-tests-layout-linux: - name: Test layout (linux) - needs: [integration-tests] - if: github.event_name == 'pull_request' && github.event.pull_request.draft == false - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/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() }} - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-system-layout-tests-linux - files: ./coverage.xml - flags: linux_system_layout - if: ${{ always() }} - -# ================================================================================================= -# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# ================================================================================================= - - system-tests-extensions-windows: - name: Test extensions (windows) - needs: [integration-tests] - if: github.event_name == 'pull_request' && github.event.pull_request.draft == false - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - run: | - .venv\Scripts\Activate.ps1 - 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 'extensions' - env: - PYTHONMALLOC: malloc - PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }} - run: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/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() }} - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-system-extensions-tests-windows - files: ./coverage.xml - flags: windows_system_extensions - if: ${{ always() }} - -# ================================================================================================= -# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# ================================================================================================= - - system-tests-extensions-linux: - name: Test extensions (linux) - needs: [integration-tests] - if: github.event_name == 'pull_request' && github.event.pull_request.draft == false - 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - run: | - source .venv/bin/activate - 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' - env: - PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }} - run: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/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() }} - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-system-extensions-tests-linux - files: ./coverage.xml - flags: linux_system_extensions - if: ${{ always() }} - -# ================================================================================================= -# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# ================================================================================================= - - system-tests-filter-windows: - name: Test filter solutions (windows) - needs: [integration-tests] - if: github.event_name == 'pull_request' && github.event.pull_request.draft == false - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/filter_solutions - - - 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() }} - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-system-filter-tests-windows - files: ./coverage.xml - flags: windows_system_filter - if: ${{ always() }} - -# ================================================================================================= -# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# ================================================================================================= - - system-tests-emit-windows: - name: Test EMIT (windows) - needs: [integration-tests] - if: github.event_name == 'pull_request' && github.event.pull_request.draft == false - runs-on: [ self-hosted, Windows, pyaedt ] - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 -v -rA --color=yes tests/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 - if: ${{ always() }} - - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - name: codecov-system-emit-tests-windows - files: ./coverage.xml - flags: windows_system_emit - if: ${{ always() }} - diff --git a/.github/workflows/update-testmondata-cache.yml b/.github/workflows/update-testmondata-cache.yml deleted file mode 100644 index 3f28c383c694..000000000000 --- a/.github/workflows/update-testmondata-cache.yml +++ /dev/null @@ -1,1096 +0,0 @@ -name: Update Testmon Cache on Merge - -on: - push: - branches: - - main - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: {} - -env: - ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} - ON_CI: True - PYTEST_ARGUMENTS: -vvv --color=yes -ra --durations=25 --maxfail=10 --cov=ansys.aedt.core --cov-report=html --cov-report=xml --junitxml=junit/test-results.xml --testmon - PYAEDT_LOCAL_SETTINGS_PATH: 'tests/pyaedt_settings.yaml' - TESTMON_DATAFILE: '.testmondata' - TESTMON_CACHE_KEY_SOLVERS_WIN: 'testmondata-solvers-win' - TESTMON_CACHE_KEY_SOLVERS_LINUX: 'testmondata-solvers-linux' - TESTMON_CACHE_KEY_GENERAL_WIN: 'testmondata-general-win' - TESTMON_CACHE_KEY_GENERAL_LINUX: 'testmondata-general-linux' - TESTMON_CACHE_KEY_VISUALIZATION_WIN: 'testmondata-visualization-win' - TESTMON_CACHE_KEY_VISUALIZATION_LINUX: 'testmondata-visualization-linux' - TESTMON_CACHE_KEY_ICEPAK_WIN: 'testmondata-icepak-win' - TESTMON_CACHE_KEY_ICEPAK_LINUX: 'testmondata-icepak-linux' - TESTMON_CACHE_KEY_LAYOUT_WIN: 'testmondata-layout-win' - TESTMON_CACHE_KEY_LAYOUT_LINUX: 'testmondata-layout-linux' - TESTMON_CACHE_KEY_FILTER_WIN: 'testmondata-filter-win' - TESTMON_CACHE_KEY_EMIT_WIN: 'testmondata-emit-win' - -jobs: - # ------------------------------------------------------------------ - # WORKFLOW DISPATCH GUARD - # ------------------------------------------------------------------ - check-reference: - name: Check reference is main - runs-on: ubuntu-latest - steps: - - name: Check reference is main - if: ${{ github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main' }} - run: | - echo "This workflow can only run on main" - exit 1 - - # ------------------------------------------------------------------ - # ANALYZE CHANGES - # ------------------------------------------------------------------ - analyze-changes: - name: Analyze code changes - runs-on: ubuntu-latest - needs: check-reference - outputs: - skip_tests: ${{ steps.analyze.outputs.skip_tests }} - doc_only: ${{ steps.analyze.outputs.doc_only }} - run_all: ${{ steps.analyze.outputs.run_all }} - permissions: - contents: read # Required to read repository content and git history - steps: - - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - fetch-depth: 0 # Need full history for git diff - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: '3.10' - - - name: Analyze changes - id: analyze - shell: bash - run: | - if [ "$GITHUB_EVENT_NAME" = "push" ]; then - BASE_REF="HEAD~1" - else - BASE_REF="origin/main" - fi - python .ci/scripts/analyze_changes.py --base "$BASE_REF" - - - name: Log skip status - if: ${{ steps.analyze.outputs.skip_tests == 'true' }} - run: | - echo "Tests will be skipped - no relevant code changes detected." - - - # ------------------------------------------------------------------ - # SOLVERS TESTS CACHE UPDATE (WINDOWS) - # ------------------------------------------------------------------ - update-solvers-win: - name: Update solvers test cache (Windows) - needs: [check-reference, analyze-changes] - if: ${{ needs.analyze-changes.outputs.skip_tests != 'true' }} - runs-on: [ self-hosted, Windows, pyaedt ] - permissions: - actions: write # Needed to delete cache - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - uv sync --frozen --group tests --extra all - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_SOLVERS_WIN }} - - - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/solvers - - - name: Prepare testmon data for caching - run: | - .venv\Scripts\Activate.ps1 - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_SOLVERS_WIN }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_SOLVERS_WIN }}-main-${{ github.sha }} - - # ------------------------------------------------------------------ - # SOLVERS TESTS CACHE UPDATE (LINUX) - # ------------------------------------------------------------------ - update-solvers-linux: - name: Update solvers test cache (Linux) - needs: [check-reference, analyze-changes] - if: ${{ needs.analyze-changes.outputs.skip_tests != 'true' }} - runs-on: [ self-hosted, Linux, pyaedt ] - permissions: - actions: write # Needed to delete cache - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - ANSYSEM_ROOT261: '/usr/ansys_inc/v261/AnsysEM' - ANS_NODEPCHECK: '1' - steps: - - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_SOLVERS_LINUX }} - - - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/system/solvers - - - name: Prepare testmon data for caching - run: | - source .venv/bin/activate - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_SOLVERS_LINUX }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_SOLVERS_LINUX }}-main-${{ github.sha }} - - # ------------------------------------------------------------------ - # GENERAL TESTS CACHE UPDATE (WINDOWS) - # ------------------------------------------------------------------ - update-general-win: - name: Update general test cache (Windows) - needs: [check-reference, analyze-changes] - if: ${{ needs.analyze-changes.outputs.skip_tests != 'true' }} - runs-on: [ self-hosted, Windows, pyaedt ] - permissions: - actions: write # Needed to delete cache - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - uv sync --frozen --group tests --extra all - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_GENERAL_WIN }} - - - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args -n 4 --dist loadfile --timeout=600 tests/system/general - - - name: Prepare testmon data for caching - run: | - .venv\Scripts\Activate.ps1 - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_GENERAL_WIN }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_GENERAL_WIN }}-main-${{ github.sha }} - - # ------------------------------------------------------------------ - # GENERAL TESTS CACHE UPDATE (LINUX) - # ------------------------------------------------------------------ - update-general-linux: - name: Update general test cache (Linux) - needs: [check-reference, analyze-changes] - if: ${{ needs.analyze-changes.outputs.skip_tests != 'true' }} - runs-on: [ self-hosted, Linux, pyaedt ] - permissions: - actions: write # Needed to delete cache - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - ANSYSEM_ROOT261: '/usr/ansys_inc/v261/AnsysEM' - ANS_NODEPCHECK: '1' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_GENERAL_LINUX }} - - - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} -n 4 --dist loadfile --timeout=600 tests/system/general - - - name: Prepare testmon data for caching - run: | - source .venv/bin/activate - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_GENERAL_LINUX }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_GENERAL_LINUX }}-main-${{ github.sha }} - - # ------------------------------------------------------------------ - # VISUALIZATION TESTS CACHE UPDATE (WINDOWS) - # ------------------------------------------------------------------ - update-visualization-win: - name: Update visualization test cache (Windows) - needs: [check-reference, analyze-changes] - if: ${{ needs.analyze-changes.outputs.skip_tests != 'true' }} - runs-on: [ self-hosted, Windows, pyaedt ] - permissions: - actions: write # Needed to delete cache - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - MPLBACKEND: 'Agg' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - uv sync --frozen --group tests --extra all - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_VISUALIZATION_WIN }} - - - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args -n 4 --dist loadfile --timeout=600 tests/system/visualization -x - - - name: Prepare testmon data for caching - run: | - .venv\Scripts\Activate.ps1 - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_VISUALIZATION_WIN }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_VISUALIZATION_WIN }}-main-${{ github.sha }} - - # ------------------------------------------------------------------ - # VISUALIZATION TESTS CACHE UPDATE (LINUX) - # ------------------------------------------------------------------ - update-visualization-linux: - name: Update visualization test cache (Linux) - needs: [check-reference, analyze-changes] - if: ${{ needs.analyze-changes.outputs.skip_tests != 'true' }} - runs-on: [ self-hosted, Linux, pyaedt ] - permissions: - actions: write # Needed to delete cache - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - ANSYSEM_ROOT261: '/usr/ansys_inc/v261/AnsysEM' - ANS_NODEPCHECK: '1' - MPLBACKEND: 'Agg' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_VISUALIZATION_LINUX }} - - - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} -n 4 --dist loadfile --timeout=300 tests/system/visualization -x - - - name: Prepare testmon data for caching - run: | - source .venv/bin/activate - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_VISUALIZATION_LINUX }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_VISUALIZATION_LINUX }}-main-${{ github.sha }} - - # ------------------------------------------------------------------ - # ICEPAK TESTS CACHE UPDATE (WINDOWS) - # ------------------------------------------------------------------ - update-icepak-win: - name: Update icepak test cache (Windows) - needs: [check-reference, analyze-changes] - if: ${{ needs.analyze-changes.outputs.skip_tests != 'true' }} - runs-on: [ self-hosted, Windows, pyaedt ] - permissions: - actions: write # Needed to delete cache - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - uv sync --frozen --group tests --extra all - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_ICEPAK_WIN }} - - - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/icepak - - - name: Prepare testmon data for caching - run: | - .venv\Scripts\Activate.ps1 - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_ICEPAK_WIN }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_ICEPAK_WIN }}-main-${{ github.sha }} - - # ------------------------------------------------------------------ - # ICEPAK TESTS CACHE UPDATE (LINUX) - # ------------------------------------------------------------------ - update-icepak-linux: - name: Update icepak test cache (Linux) - needs: [check-reference, analyze-changes] - if: ${{ needs.analyze-changes.outputs.skip_tests != 'true' }} - runs-on: [ self-hosted, Linux, pyaedt ] - permissions: - actions: write # Needed to delete cache - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - ANSYSEM_ROOT261: '/usr/ansys_inc/v261/AnsysEM' - ANS_NODEPCHECK: '1' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_ICEPAK_LINUX }} - - - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/system/icepak - - - name: Prepare testmon data for caching - run: | - source .venv/bin/activate - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_ICEPAK_LINUX }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_ICEPAK_LINUX }}-main-${{ github.sha }} - - # ------------------------------------------------------------------ - # LAYOUT TESTS CACHE UPDATE (WINDOWS) - # ------------------------------------------------------------------ - update-layout-win: - name: Update layout test cache (Windows) - needs: [check-reference, analyze-changes] - if: ${{ needs.analyze-changes.outputs.skip_tests != 'true' }} - runs-on: [ self-hosted, Windows, pyaedt ] - permissions: - actions: write # Needed to delete cache - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - uv sync --frozen --group tests --extra all - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_LAYOUT_WIN }} - - - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/layout - - - name: Prepare testmon data for caching - run: | - .venv\Scripts\Activate.ps1 - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_LAYOUT_WIN }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_LAYOUT_WIN }}-main-${{ github.sha }} - - # ------------------------------------------------------------------ - # LAYOUT TESTS CACHE UPDATE (LINUX) - # ------------------------------------------------------------------ - update-layout-linux: - name: Update layout test cache (Linux) - needs: [check-reference, analyze-changes] - if: ${{ needs.analyze-changes.outputs.skip_tests != 'true' }} - runs-on: [ self-hosted, Linux, pyaedt ] - permissions: - actions: write # Needed to delete cache - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - ANSYSEM_ROOT261: '/usr/ansys_inc/v261/AnsysEM' - ANS_NODEPCHECK: '1' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_LAYOUT_LINUX }} - - - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/system/layout - - - name: Prepare testmon data for caching - run: | - source .venv/bin/activate - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_LAYOUT_LINUX }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_LAYOUT_LINUX }}-main-${{ github.sha }} - - # ------------------------------------------------------------------ - # FILTER TESTS CACHE UPDATE (WINDOWS) - # ------------------------------------------------------------------ - update-filter-win: - name: Update filter test cache (Windows) - needs: [check-reference, analyze-changes] - if: ${{ needs.analyze-changes.outputs.skip_tests != 'true' }} - runs-on: [ self-hosted, Windows, pyaedt ] - permissions: - actions: write # Needed to delete cache - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - uv sync --frozen --group tests --extra all - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_FILTER_WIN }} - - - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/filter_solutions - - - name: Prepare testmon data for caching - run: | - .venv\Scripts\Activate.ps1 - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_FILTER_WIN }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_FILTER_WIN }}-main-${{ github.sha }} - - # ------------------------------------------------------------------ - # EMIT TESTS CACHE UPDATE (WINDOWS) - # ------------------------------------------------------------------ - update-emit-win: - name: Update emit test cache (Windows) - needs: [check-reference, analyze-changes] - if: ${{ needs.analyze-changes.outputs.skip_tests != 'true' }} - runs-on: [ self-hosted, Windows, pyaedt ] - permissions: - actions: write # Needed to delete cache - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - uv sync --frozen --group tests --extra all - - - name: Restore testmondata cache - uses: ./.github/actions/testmon-cache - with: - testmon-datafile: ${{ env.TESTMON_DATAFILE }} - cache-key: ${{ env.TESTMON_CACHE_KEY_EMIT_WIN }} - - - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 -v -rA --color=yes tests/system/emit - - - name: Prepare testmon data for caching - run: | - .venv\Scripts\Activate.ps1 - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_EMIT_WIN }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_EMIT_WIN }}-main-${{ github.sha }} \ No newline at end of file diff --git a/.github/workflows/weekly-tests.yml b/.github/workflows/weekly-tests.yml deleted file mode 100644 index 9d278a8a43b3..000000000000 --- a/.github/workflows/weekly-tests.yml +++ /dev/null @@ -1,1108 +0,0 @@ -name: Weekly Tests Updating Testmon Caches - -on: - workflow_dispatch: - schedule: # UTC at 2pm on Saturday - - cron: '0 14 * * 6' - -env: - ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} - MAIN_PYTHON_VERSION: '3.10' - ON_CI: True - PYAEDT_LOCAL_SETTINGS_PATH: 'tests/pyaedt_settings.yaml' - PYTEST_ARGUMENTS: -vvv --color=yes -ra --durations=25 --maxfail=10 --junitxml=junit/test-results.xml --testmon - PYTEST_ARGUMENTS_NON_TESTMON: -vvv --color=yes -ra --durations=25 --maxfail=10 --junitxml=junit/test-results.xml - TESTMON_DATAFILE: '.testmondata' - TESTMON_CACHE_KEY_SOLVERS_WIN: 'testmondata-solvers-win' - TESTMON_CACHE_KEY_SOLVERS_LINUX: 'testmondata-solvers-linux' - TESTMON_CACHE_KEY_GENERAL_WIN: 'testmondata-general-win' - TESTMON_CACHE_KEY_GENERAL_LINUX: 'testmondata-general-linux' - TESTMON_CACHE_KEY_VISUALIZATION_WIN: 'testmondata-visualization-win' - TESTMON_CACHE_KEY_VISUALIZATION_LINUX: 'testmondata-visualization-linux' - TESTMON_CACHE_KEY_ICEPAK_WIN: 'testmondata-icepak-win' - TESTMON_CACHE_KEY_ICEPAK_LINUX: 'testmondata-icepak-linux' - TESTMON_CACHE_KEY_LAYOUT_WIN: 'testmondata-layout-win' - TESTMON_CACHE_KEY_LAYOUT_LINUX: 'testmondata-layout-linux' - TESTMON_CACHE_KEY_FILTER_WIN: 'testmondata-filter-win' - TESTMON_CACHE_KEY_EMIT_WIN: 'testmondata-emit-win' - -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 - permissions: - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - steps: - - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Install Xvfb - shell: bash - run: sudo apt-get install -y xvfb - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Run unit tests - env: - PYTEST_ARGUMENTS_NON_TESTMON: ${{ env.PYTEST_ARGUMENTS_NON_TESTMON }} - run: | - source .venv/bin/activate - xvfb-run pytest ${PYTEST_ARGUMENTS_NON_TESTMON} tests/unit - - - integration-tests: - name: Integration tests - runs-on: ubuntu-latest - permissions: - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - steps: - - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - uv sync --frozen --group tests --extra all - - - name: Run integration tests - env: - PYTEST_ARGUMENTS_NON_TESTMON: ${{ env.PYTEST_ARGUMENTS_NON_TESTMON }} - run: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS_NON_TESTMON} tests/integration - - system-tests-solvers-windows: - name: Test solvers (windows) - runs-on: [ self-hosted, Windows, pyaedt ] - permissions: - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/solvers - - - name: Prepare testmon data for caching - run: | - .venv\Scripts\Activate.ps1 - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_SOLVERS_WIN }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_SOLVERS_WIN }}-main-${{ github.sha }} - - system-tests-solvers-linux: - name: Test solvers (linux) - runs-on: [ self-hosted, Linux, pyaedt ] - permissions: - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - ANSYSEM_ROOT261: '/usr/ansys_inc/v261/AnsysEM' - ANS_NODEPCHECK: '1' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/system/solvers - - - name: Prepare testmon data for caching - run: | - source .venv/bin/activate - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_SOLVERS_LINUX }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_SOLVERS_LINUX }}-main-${{ github.sha }} - - system-tests-general-windows: - name: Test general (windows) - runs-on: [ self-hosted, Windows, pyaedt ] - permissions: - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args -n 4 --dist loadfile --timeout=600 tests/system/general - - - name: Prepare testmon data for caching - run: | - .venv\Scripts\Activate.ps1 - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_GENERAL_WIN }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_GENERAL_WIN }}-main-${{ github.sha }} - - system-tests-general-linux: - name: Test general (linux) - runs-on: [ self-hosted, Linux, pyaedt ] - permissions: - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - ANSYSEM_ROOT261: '/usr/ansys_inc/v261/AnsysEM' - ANS_NODEPCHECK: '1' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} -n 4 --dist loadfile --timeout=600 tests/system/general - - - name: Prepare testmon data for caching - run: | - source .venv/bin/activate - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_GENERAL_LINUX }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_GENERAL_LINUX }}-main-${{ github.sha }} - - system-tests-visualization-windows: - name: Test visualization (windows) - runs-on: [ self-hosted, Windows, pyaedt ] - permissions: - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - MPLBACKEND: 'Agg' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args -n 4 --dist loadfile --timeout=600 tests/system/visualization -x - - - name: Prepare testmon data for caching - run: | - .venv\Scripts\Activate.ps1 - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_VISUALIZATION_WIN }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_VISUALIZATION_WIN }}-main-${{ github.sha }} - - system-tests-visualization-linux: - name: Test visualization (linux) - runs-on: [ self-hosted, Linux, pyaedt ] - permissions: - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - ANSYSEM_ROOT261: '/usr/ansys_inc/v261/AnsysEM' - ANS_NODEPCHECK: '1' - MPLBACKEND: 'Agg' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} -n 4 --dist loadfile --timeout=300 tests/system/visualization -x - - - name: Prepare testmon data for caching - run: | - source .venv/bin/activate - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_VISUALIZATION_LINUX }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_VISUALIZATION_LINUX }}-main-${{ github.sha }} - - system-tests-icepak-windows: - name: Test icepak (windows) - runs-on: [ self-hosted, Windows, pyaedt ] - permissions: - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/icepak - - - name: Prepare testmon data for caching - run: | - .venv\Scripts\Activate.ps1 - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_ICEPAK_WIN }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_ICEPAK_WIN }}-main-${{ github.sha }} - - system-tests-icepak-linux: - name: Test icepak (linux) - runs-on: [ self-hosted, Linux, pyaedt ] - permissions: - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - ANSYSEM_ROOT261: '/usr/ansys_inc/v261/AnsysEM' - ANS_NODEPCHECK: '1' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/system/icepak - - - name: Prepare testmon data for caching - run: | - source .venv/bin/activate - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_ICEPAK_LINUX }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_ICEPAK_LINUX }}-main-${{ github.sha }} - - system-tests-layout-windows: - name: Test layout (windows) - runs-on: [ self-hosted, Windows, pyaedt ] - permissions: - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/layout - - - name: Prepare testmon data for caching - run: | - .venv\Scripts\Activate.ps1 - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_LAYOUT_WIN }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_LAYOUT_WIN }}-main-${{ github.sha }} - - system-tests-layout-linux: - name: Test layout (linux) - runs-on: [ self-hosted, Linux, pyaedt ] - permissions: - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - ANSYSEM_ROOT261: '/usr/ansys_inc/v261/AnsysEM' - ANS_NODEPCHECK: '1' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS} --timeout=600 tests/system/layout - - - name: Prepare testmon data for caching - run: | - source .venv/bin/activate - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_LAYOUT_LINUX }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_LAYOUT_LINUX }}-main-${{ github.sha }} - - system-tests-extensions-windows: - name: Test extensions (windows) - runs-on: [ self-hosted, Windows, pyaedt ] - permissions: - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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 'extensions' - env: - PYTHONMALLOC: malloc - PYTEST_ARGUMENTS_NON_TESTMON: ${{ env.PYTEST_ARGUMENTS_NON_TESTMON }} - run: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS_NON_TESTMON -split ' ' - pytest @args --timeout=600 tests/system/extensions - - system-tests-extensions-linux: - name: Test extensions (linux) - runs-on: [ self-hosted, Linux, pyaedt ] - permissions: - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - ANSYSEM_ROOT261: '/usr/ansys_inc/v261/AnsysEM' - ANS_NODEPCHECK: '1' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Set up headless display - uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - source .venv/bin/activate - 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: | - source .venv/bin/activate - pytest ${PYTEST_ARGUMENTS_NON_TESTMON} --timeout=600 tests/system/extensions - - system-tests-filter-windows: - name: Test filter solutions (windows) - runs-on: [ self-hosted, Windows, pyaedt ] - permissions: - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 tests/system/filter_solutions - - - name: Prepare testmon data for caching - run: | - .venv\Scripts\Activate.ps1 - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_FILTER_WIN }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_FILTER_WIN }}-main-${{ github.sha }} - - system-tests-emit-windows: - name: Test EMIT (windows) - runs-on: [ self-hosted, Windows, pyaedt ] - permissions: - contents: write # Needed to save cache - env: - TESTS_VERSION: '3.10' - steps: - - name: Install Git and checkout project - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.TESTS_VERSION }} - - - name: Set up uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - with: - enable-cache: false - prune-cache: true - - - name: Create virtual environment - run: uv venv .venv - - - name: Install pyaedt and tests dependencies - env: - TESTS_VERSION: ${{ env.TESTS_VERSION }} - run: | - .venv\Scripts\Activate.ps1 - 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: | - .venv\Scripts\Activate.ps1 - $args = $env:PYTEST_ARGUMENTS -split ' ' - pytest @args --timeout=600 -v -rA --color=yes tests/system/emit - - - name: Prepare testmon data for caching - run: | - .venv\Scripts\Activate.ps1 - python -c "import sqlite3; conn = sqlite3.connect('.testmondata'); conn.execute('PRAGMA journal_mode = OFF'); conn.close()" - - - name: Delete old testmon caches - shell: bash - run: | - gh cache list --key ${CACHE_KEY}-main- --json key --jq '.[].key' | xargs -I {} gh cache delete {} || true - env: - CACHE_KEY: ${{ env.TESTMON_CACHE_KEY_EMIT_WIN }} - GH_TOKEN: ${{ github.token }} - - - name: Save updated testmon cache - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ${{ env.TESTMON_DATAFILE }} - key: ${{ env.TESTMON_CACHE_KEY_EMIT_WIN }}-main-${{ github.sha }}