Skip to content

Commit

Permalink
CI: Add pyaedt linux testing when releasing (#801)
Browse files Browse the repository at this point in the history
* CI: Add pyaedt testing on Linux for release

* CI: Add linux tests as release needs
  • Loading branch information
SMoraisAnsys authored Sep 23, 2024
1 parent 22192e5 commit 9939c37
Showing 1 changed file with 80 additions and 6 deletions.
86 changes: 80 additions & 6 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,17 @@ 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 ]
steps:
- 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 }}

Expand Down Expand Up @@ -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
Expand All @@ -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
# =================================================================================================
Expand Down Expand Up @@ -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, test-pyaedt-main-linux]
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
Expand Down

0 comments on commit 9939c37

Please sign in to comment.