From a87b51f8a6a2eb4beb987a0838e51181124d99a7 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Thu, 19 Sep 2024 09:09:15 +0200 Subject: [PATCH 1/2] CI: Add pyaedt testing on Linux for release --- .github/workflows/ci_cd.yml | 86 ++++++++++++++++++++++++++++++++++--- 1 file changed, 80 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index b02d99fd19..e21819ed8d 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -137,8 +137,8 @@ jobs: # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv # ================================================================================================= - test-pyaedt-main: - name: Testing PyAEDT main branch + test-pyaedt-main-windows: + name: Testing PyAEDT main branch (Windows) if: github.event_name == 'push' && contains(github.ref, 'refs/tags') needs: [smoke-tests] runs-on: [ self-hosted, Windows, pyaedt ] @@ -146,9 +146,8 @@ jobs: - name: Install Git and checkout project uses: actions/checkout@v4 - # Revert to previous verison due too setup-python#819 - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ env.MAIN_PYTHON_VERSION }} @@ -184,7 +183,7 @@ jobs: .venv\Scripts\Activate.ps1 # Uninstall conflicting dependencies pip uninstall --yes vtk - pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0 + pip install --extra-index-url https://wheels.vtk.org vtk-osmesa - name: Run PyAEDT tests uses: nick-fields/retry@v3 @@ -210,6 +209,81 @@ jobs: .venv\Scripts\Activate.ps1 pytest --durations=50 -v external/pyaedt/_unittest_solvers +# ================================================================================================= +# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv +# ================================================================================================= + + test-pyaedt-main-linux: + name: Testing PyAEDT main branch (Linux) + if: github.event_name == 'push' && contains(github.ref, 'refs/tags') + needs: [smoke-tests] + runs-on: [ self-hosted, Linux, pyaedt ] + steps: + - name: Install Git and checkout project + uses: actions/checkout@v4 + + - 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: | + . .venv/bin/activate + pip install --no-cache-dir external/pyaedt[tests] + + - name: Install PyEDB + run: | + . .venv/bin/activate + python -m pip install . + + - name: Install CI dependencies (e.g. vtk-osmesa) + run: | + . .venv/bin/activate + # Uninstall conflicting dependencies + pip uninstall --yes vtk + pip install --extra-index-url https://wheels.vtk.org vtk-osmesa + + - name: Run PyAEDT tests + uses: nick-fields/retry@v3 + env: + PYTHONMALLOC: malloc + with: + max_attempts: 3 + retry_on: error + timeout_minutes: 40 + command: | + . .venv/bin/activate + pytest -n auto --dist loadfile --durations=50 -v external/pyaedt/_unittest + + - name: Run PyAEDT solvers tests + uses: nick-fields/retry@v3 + env: + PYTHONMALLOC: malloc + with: + max_attempts: 3 + retry_on: error + timeout_minutes: 40 + command: | + . .venv/bin/activate + pytest --durations=50 -v external/pyaedt/_unittest_solvers + # ================================================================================================= # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv # ================================================================================================= @@ -316,7 +390,7 @@ jobs: release: name: Release project if: github.event_name == 'push' && contains(github.ref, 'refs/tags') - needs: [package] + needs: [package, test-pyaedt-main-windows] runs-on: ubuntu-latest # Specifying a GitHub environment is optional, but strongly encouraged environment: release From 4dbc377f1b462e229bc20635e32ec22f100c19d2 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Thu, 19 Sep 2024 09:11:13 +0200 Subject: [PATCH 2/2] CI: Add linux tests as release needs --- .github/workflows/ci_cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index e21819ed8d..1ab2da9725 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -390,7 +390,7 @@ jobs: release: name: Release project if: github.event_name == 'push' && contains(github.ref, 'refs/tags') - needs: [package, test-pyaedt-main-windows] + needs: [package, test-pyaedt-main-windows, test-pyaedt-main-linux] runs-on: ubuntu-latest # Specifying a GitHub environment is optional, but strongly encouraged environment: release