Add workflow to test pyedb as pyaedt dependency #26
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test pyedb as pyaedt dependency | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
tags: | |
- 'v*' | |
branches: | |
- main | |
pull_request: | |
branches: [ main ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} | |
PYEDB_USE_LEGACY: '1' | |
PYEDB_CI_NO_DISPLAY: '1' | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
pyaedt-test: | |
name: "Check pyaedt tests when pyedb is used as a dependency" | |
runs-on: [ windows, pyedb, self-hosted ] | |
steps: | |
- name: "Install Git and clone project" | |
uses: actions/checkout@v4 | |
- name: "Set up Python" | |
uses: ansys/actions/_setup-python@main | |
with: | |
python-version: '3.10' | |
use-cache: false | |
- name: Create Python venv | |
run: | | |
Remove-Item D:\Temp\* -Recurse -Force -ErrorAction SilentlyContinue | |
python -m venv .venv | |
.\.venv\Scripts\Activate.ps1 | |
- name: "Update pip" | |
run: | | |
.\.venv\Scripts\Activate.ps1 | |
python -m pip install -U pip | |
- name: "Install Pyedb" | |
run: | | |
.\.venv\Scripts\Activate.ps1 | |
python -m pip install . | |
- name: "Clone pyaedt on specific branch" | |
uses: actions/checkout@v4 | |
with: | |
repository: ansys/pyaedt | |
path: "external/pyaedt" | |
ref: "maint/use_pyedb" | |
- name: "Install vtk" | |
run: | | |
.\.venv\Scripts\Activate.ps1 | |
python -m pip install vtk | |
python -c "import vtk; print(vtk.VTK_VERSION)" | |
- name: "Install Pyaedt" | |
run: | | |
.\.venv\Scripts\Activate.ps1 | |
python -m pip install external/pyaedt[full] | |
- name: "Install Pyaedt test dependencies" | |
run: | | |
.\.venv\Scripts\Activate.ps1 | |
python -m pip install external/pyaedt[tests] | |
# - name: "Move some tests" | |
# run: | | |
# New-Item -ItemType Directory -Name external/pyaedt/excluded_tests | |
# Move-Item -Path "external\pyaedt\_unittest\test_00_EDB.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_00_Advanced_EDB.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_01_3dlayout_edb.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_01_configuration_files.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_01_Design.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_01_downloads.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_01_general_methods.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_01_GeometryOperators.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_01_pdf.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_01_report_file_parser.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_01_toolkit_icons.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_02_2D_modeler.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_02_3D_modeler.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_03_Materials.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_04_SBR.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_05_Mesh.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_06_MessageManager.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_07_Object3D.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_08_Primitives3D.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_09_Primitives2D.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_09_VariableManager.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_11_Setup.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_12_1_PostProcessing.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_12_PostProcessing.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_13_LoadAEDTFile.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_14_AedtLogger.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_15_ibs_reader.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_16_3d_stackup.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_20_HFSS.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_21_Circuit.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_22_Circuit_DynamicLink.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_27_Maxwell2D.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_28_Maxwell3D.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_29_Mechanical.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_30_Q2D.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_32_RMxprt.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_34_TwinBuilder.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_35_MaxwellCircuit.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_36_Q2D_PostProcessing.py" -Destination external\pyaedt\excluded_tests\ | |
# Move-Item -Path "external\pyaedt\_unittest\test_37_Genetic_Algorithm.py" -Destination external\pyaedt\excluded_tests\ | |
# Get-ChildItem -Path "external\pyaedt\_unittest" | |
# - name: 'Pyaedt tests' | |
# uses: nick-fields/retry@v2 | |
# with: | |
# max_attempts: 1 | |
# retry_on: error | |
# timeout_minutes: 80 | |
# command: | | |
# .\.venv\Scripts\Activate.ps1 | |
# Set-Item -Path env:PYTHONMALLOC -Value "malloc" | |
# pytest --durations=50 -v --cov=external/pyaedt --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml -k "not test_create_pdf and not test_16_read_hdm and not test_09c_import_into_report and not (plt or plot or Plot) and not test_42_post_processing_3d_layout" external/pyaedt/_unittest | |
- name: 'Pyaedt tests with plot' | |
uses: nick-fields/retry@v2 | |
with: | |
max_attempts: 1 | |
retry_on: error | |
timeout_minutes: 80 | |
command: | | |
.\.venv\Scripts\Activate.ps1 | |
Set-Item -Path env:PYTHONMALLOC -Value "malloc" | |
pytest --durations=50 -v --cov=external/pyaedt --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml external/pyaedt/_unittest/test_12_1_PostProcessing.py |