CI: Reorder tests to avoid numpy issue #2619
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: GitHub CI | |
on: | |
pull_request: | |
workflow_dispatch: | |
push: | |
tags: | |
- "*" | |
branches: | |
- main | |
env: | |
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} | |
PYEDB_USE_DOTNET: '1' | |
PYEDB_CI_NO_DISPLAY: '1' | |
MAIN_PYTHON_VERSION: '3.10' | |
PACKAGE_NAME: 'pyedb' | |
DOCUMENTATION_CNAME: 'edb.docs.pyansys.com' | |
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }} | |
MEILISEARCH_HOST_URL: ${{ vars.MEILISEARCH_HOST_URL }} | |
MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }} | |
ON_CI: True | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
# ================================================================================================= | |
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv | |
# ================================================================================================= | |
test-pyaedt-main-linux: | |
name: Testing PyAEDT main branch (Linux) | |
runs-on: [ self-hosted, Linux, pyaedt ] | |
env: | |
ANSYSEM_ROOT242: '/opt/AnsysEM/v242/Linux64' | |
ANS_NODEPCHECK: '1' | |
steps: | |
- name: Install Git and checkout project | |
uses: actions/checkout@v4 | |
- name: Install OS packages | |
run: | | |
sudo apt update | |
sudo apt-get install tk -y | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
- name: Create Python venv | |
run: | | |
python -m venv .venv | |
- name: Update pip | |
run: | | |
. .venv/bin/activate | |
python -m pip install -U pip | |
- name: Clone PyAEDT on main branch | |
uses: actions/checkout@v4 | |
with: | |
repository: ansys/pyaedt | |
path: "external/pyaedt" | |
ref: "main" | |
- name: Install PyAEDT main branch version with its test dependencies | |
run: | | |
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH | |
. .venv/bin/activate | |
pip install --no-cache-dir external/pyaedt[tests] | |
- name: Install PyEDB | |
run: | | |
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH | |
. .venv/bin/activate | |
python -m pip install . | |
- name: Install CI dependencies (e.g. vtk-osmesa) | |
run: | | |
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH | |
. .venv/bin/activate | |
# Uninstall conflicting dependencies | |
pip uninstall --yes vtk | |
pip install --extra-index-url https://wheels.vtk.org vtk-osmesa | |
- name: Run PyAEDT failing test alone | |
uses: nick-fields/retry@v3 | |
env: | |
PYTHONMALLOC: malloc | |
with: | |
max_attempts: 3 | |
retry_on: error | |
timeout_minutes: 50 | |
command: | | |
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH | |
. .venv/bin/activate | |
pytest --durations=50 -v external/pyaedt/tests/system/solvers/test_45_workflows.py | |
- name: Run PyAEDT solvers tests | |
uses: nick-fields/retry@v3 | |
env: | |
PYTHONMALLOC: malloc | |
with: | |
max_attempts: 3 | |
retry_on: error | |
timeout_minutes: 50 | |
command: | | |
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH | |
. .venv/bin/activate | |
pytest --durations=50 -v external/pyaedt/tests/system/solvers |