Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add pyaedt linux testing when releasing #801

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading