3636 MAIN_PYTHON_VERSION : ' 3.10'
3737 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'
3838
39+ permissions : {} # Disable default permissions
40+
3941jobs :
4042
4143 system-test-solvers-windows :
4547 steps :
4648 - name : Install Git and checkout project
4749 uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
50+ with :
51+ persist-credentials : false
4852
4953 - name : Setup Python
5054 uses : actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
@@ -70,14 +74,25 @@ jobs:
7074 .venv\Scripts\Activate.ps1
7175 # Uninstall conflicting dependencies
7276 pip uninstall --yes vtk
73- pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.3.1
77+ pip install --index-url https://wheels.vtk.org vtk-osmesa==9.3.1
78+
79+ - name : Remove Ansys processes (if any)
80+ shell : powershell
81+ run : |
82+ Get-Process | Where-Object {
83+ $_.Path -like "*ansys inc*" -or $_.Path -like "*ansysem*"
84+ } | ForEach-Object {
85+ Write-Output "Killing $($_.Name) (PID: $($_.Id))"
86+ Stop-Process -Id $_.Id -Force
87+ }
7488
7589 - name : Run tests marked with 'solvers'
7690 env :
7791 PYTHONMALLOC : malloc
92+ PYTEST_ARGUMENTS : ${{ env.PYTEST_ARGUMENTS }}
7893 run : |
7994 .venv\Scripts\Activate.ps1
80- pytest ${{ env. PYTEST_ARGUMENTS } } -m solvers
95+ pytest ${PYTEST_ARGUMENTS} -m solvers
8196
8297 - uses : codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
8398 with :
@@ -102,33 +117,50 @@ jobs:
102117 steps :
103118 - name : Install Git and checkout project
104119 uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
120+ with :
121+ persist-credentials : false
105122
106123 - name : Setup Python
107124 uses : actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
108125 with :
109126 python-version : ${{ env.MAIN_PYTHON_VERSION }}
110127
111128 - name : Create virtual environment
129+ env :
130+ ANSYSEM : ${{ env.ANSYSEM_ROOT252 }}
112131 run : |
113- export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT252 } }/common/mono/Linux64/lib64:$LD_LIBRARY_PATH
132+ export LD_LIBRARY_PATH=${ANSYSEM }/common/mono/Linux64/lib64:$LD_LIBRARY_PATH
114133 python -m venv .venv
115134 source .venv/bin/activate
116135 python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pip -U
117136 python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org wheel setuptools -U
118137 python -c "import sys; print(sys.executable)"
119138
120139 - name : Install pyaedt and tests dependencies
140+ env :
141+ ANSYSEM : ${{ env.ANSYSEM_ROOT252 }}
121142 run : |
122- export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT252 } }/common/mono/Linux64/lib64:$LD_LIBRARY_PATH
143+ export LD_LIBRARY_PATH=${ANSYSEM }/common/mono/Linux64/lib64:$LD_LIBRARY_PATH
123144 source .venv/bin/activate
124145 pip install .[tests]
125146 pip install pytest-azurepipelines
126147
148+ - name : Remove Ansys processes (if any)
149+ shell : bash
150+ run : |
151+ for pid in $(ps -eo pid,comm,args | grep -iE "ansys.inc|ansysem" | grep -v grep | awk '{print $1}'); do
152+ echo "Killing PID $pid"
153+ kill -9 "$pid"
154+ done
155+
127156 - name : Run tests marked with 'solvers'
157+ env :
158+ ANSYSEM : ${{ env.ANSYSEM_ROOT252 }}
159+ PYTEST_ARGUMENTS : ${{ env.PYTEST_ARGUMENTS }}
128160 run : |
129- export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT252 } }/common/mono/Linux64/lib64:$LD_LIBRARY_PATH
161+ export LD_LIBRARY_PATH=${ANSYSEM }/common/mono/Linux64/lib64:$LD_LIBRARY_PATH
130162 source .venv/bin/activate
131- pytest ${{ env. PYTEST_ARGUMENTS } } -m solvers
163+ pytest ${PYTEST_ARGUMENTS} -m solvers
132164
133165 - uses : codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
134166 with :
@@ -150,6 +182,8 @@ jobs:
150182 steps :
151183 - name : Install Git and checkout project
152184 uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
185+ with :
186+ persist-credentials : false
153187
154188 - name : Setup Python
155189 uses : actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
@@ -175,7 +209,17 @@ jobs:
175209 .venv\Scripts\Activate.ps1
176210 # Uninstall conflicting dependencies
177211 pip uninstall --yes vtk
178- pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.3.1
212+ pip install --index-url https://wheels.vtk.org vtk-osmesa==9.3.1
213+
214+ - name : Remove Ansys processes (if any)
215+ shell : powershell
216+ run : |
217+ Get-Process | Where-Object {
218+ $_.Path -like "*ansys inc*" -or $_.Path -like "*ansysem*"
219+ } | ForEach-Object {
220+ Write-Output "Killing $($_.Name) (PID: $($_.Id))"
221+ Stop-Process -Id $_.Id -Force
222+ }
179223
180224 - name : Run tests marked with 'general'
181225 uses : nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
@@ -212,24 +256,30 @@ jobs:
212256 steps :
213257 - name : Install Git and checkout project
214258 uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
259+ with :
260+ persist-credentials : false
215261
216262 - name : Setup Python
217263 uses : actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
218264 with :
219265 python-version : ${{ env.MAIN_PYTHON_VERSION }}
220266
221267 - name : Create virtual environment
268+ env :
269+ ANSYSEM : ${{ env.ANSYSEM_ROOT252 }}
222270 run : |
223- export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT252 } }/common/mono/Linux64/lib64:$LD_LIBRARY_PATH
271+ export LD_LIBRARY_PATH=${ANSYSEM }/common/mono/Linux64/lib64:$LD_LIBRARY_PATH
224272 python -m venv .venv
225273 source .venv/bin/activate
226274 python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pip -U
227275 python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org wheel setuptools -U
228276 python -c "import sys; print(sys.executable)"
229277
230278 - name : Install pyaedt and tests dependencies
279+ env :
280+ ANSYSEM : ${{ env.ANSYSEM_ROOT252 }}
231281 run : |
232- export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT252 } }/common/mono/Linux64/lib64:$LD_LIBRARY_PATH
282+ export LD_LIBRARY_PATH=${ANSYSEM }/common/mono/Linux64/lib64:$LD_LIBRARY_PATH
233283 source .venv/bin/activate
234284 pip install .[tests]
235285 pip install pytest-azurepipelines
@@ -239,7 +289,15 @@ jobs:
239289 source .venv/bin/activate
240290 # Uninstall conflicting dependencies
241291 pip uninstall --yes vtk
242- pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.3.1
292+ pip install --index-url https://wheels.vtk.org vtk-osmesa==9.3.1
293+
294+ - name : Remove Ansys processes (if any)
295+ shell : bash
296+ run : |
297+ for pid in $(ps -eo pid,comm,args | grep -iE "ansys.inc|ansysem" | grep -v grep | awk '{print $1}'); do
298+ echo "Killing PID $pid"
299+ kill -9 "$pid"
300+ done
243301
244302 - name : Run tests marked with 'general'
245303 uses : nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
0 commit comments