Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
SMoraisAnsys committed Dec 21, 2023
1 parent 2edfea8 commit 6a33cd7
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 73 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,68 @@ jobs:
vale-config: "doc/.vale.ini"
vale-version: "2.29.6"

legacy-examples:
name: "Check legacy examples"
runs-on: [ windows, pyedb, self-hosted ]
steps:
- name: "Install Git and clone project"
uses: actions/checkout@v4

- name: "Set up Python"
uses: ansys/actions/_setup-python@main
with:
python-version: ${{ env.MAIN_PYTHON_VERSION_WINDOWS_SELFHOSTED }}
use-cache: false

- name: Create Python venv
run: |
python -m venv .venv
. .venv\Scripts\Activate.ps1
- name: "Update pip"
run: |
. .venv\Scripts\Activate.ps1
python -m pip install -U pip
- name: Install pyedb
run: |
. .venv\Scripts\Activate.ps1
pip install .[full]
- name: "Clone pyaedt on specific branch"
uses: actions/checkout@v4
with:
repository: ansys/pyaedt
path: "external/pyaedt"
ref: "maint/use_pyedb"

- name: "Install Pyaedt"
run: |
.\.venv\Scripts\Activate.ps1
pip install --no-cache-dir external/pyaedt[full]
- name: "Install specific vtk version with OSMesa bundled"
run: |
.\.venv\Scripts\Activate.ps1
pip uninstall vtk -y
# Note: the vtk-osmesa used is 9.2.X as 9.3.0 is not working
# well with the use of pyvista in our tests atm.
# TODO: update once a stable versio is working
pip install --extra-index-url https://wheels.vtk.org ${{ env.VTK_OSMESA }}
- name: Execute legacy pyaedt integration examples
run: |
. .venv\Scripts\Activate.ps1
python examples/legacy/pyaedt_integration/03_5G_antenna_example.py
# Write-Host "Executing pyaedt integration example 03_5G_antenna_example.py"
# $time = Measure-Command {python examples/legacy/pyaedt_integration/03_5G_antenna_example.py}
# Write-Host "Time taken for example 03_5G_antenna_example.py: $($time.TotalSeconds) seconds"
# # Get-ChildItem -Path examples/legacy/pyaedt_integration -Filter *.py -File | ? { $_.Name -ne $excluded_example } | ForEach-Object {
# # Write-Host "Executing pyaedt integration example $($_.FullName)"
# # $time = Measure-Command {python $_.FullName}
# # Write-Host "Time taken for example $($_.FullName): $($time.TotalSeconds) seconds"
# # }
# # TODO: uncomment once this repo is public
# # smoke-tests:
# # name: Build and Smoke tests
Expand Down
146 changes: 73 additions & 73 deletions .github/workflows/legacy_examples.yml
Original file line number Diff line number Diff line change
@@ -1,85 +1,85 @@
name: Legacy examples
on:
pull_request:
workflow_dispatch:
push:
tags:
- "*"
branches:
- main
# name: Legacy examples
# on:
# pull_request:
# workflow_dispatch:
# push:
# tags:
# - "*"
# branches:
# - main

env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
PYEDB_USE_LEGACY: '1'
PYEDB_CI_NO_DISPLAY: '1'
MAIN_PYTHON_VERSION_WINDOWS_SELFHOSTED: '3.9'
VTK_OSMESA: 'vtk-osmesa==9.2.20230527.dev0'
# env:
# ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
# PYEDB_USE_LEGACY: '1'
# PYEDB_CI_NO_DISPLAY: '1'
# MAIN_PYTHON_VERSION_WINDOWS_SELFHOSTED: '3.9'
# VTK_OSMESA: 'vtk-osmesa==9.2.20230527.dev0'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# concurrency:
# group: ${{ github.workflow }}-${{ github.ref }}
# cancel-in-progress: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# # A workflow run is made up of one or more jobs that can run sequentially or in parallel
# jobs:

legacy-examples:
name: "Check legacy examples"
runs-on: [ windows, pyedb, self-hosted ]
steps:
- name: "Install Git and clone project"
uses: actions/checkout@v4
# legacy-examples:
# name: "Check legacy examples"
# runs-on: [ windows, pyedb, self-hosted ]
# steps:
# - name: "Install Git and clone project"
# uses: actions/checkout@v4

- name: "Set up Python"
uses: ansys/actions/_setup-python@main
with:
python-version: ${{ env.MAIN_PYTHON_VERSION_WINDOWS_SELFHOSTED }}
use-cache: false
# - name: "Set up Python"
# uses: ansys/actions/_setup-python@main
# with:
# python-version: ${{ env.MAIN_PYTHON_VERSION_WINDOWS_SELFHOSTED }}
# use-cache: false

- name: Create Python venv
run: |
python -m venv .venv
. .venv\Scripts\Activate.ps1
# - name: Create Python venv
# run: |
# python -m venv .venv
# . .venv\Scripts\Activate.ps1

- name: "Update pip"
run: |
. .venv\Scripts\Activate.ps1
python -m pip install -U pip
# - name: "Update pip"
# run: |
# . .venv\Scripts\Activate.ps1
# python -m pip install -U pip

- name: Install pyedb
run: |
. .venv\Scripts\Activate.ps1
pip install .[full]
# - name: Install pyedb
# run: |
# . .venv\Scripts\Activate.ps1
# pip install .[full]

- name: "Clone pyaedt on specific branch"
uses: actions/checkout@v4
with:
repository: ansys/pyaedt
path: "external/pyaedt"
ref: "maint/use_pyedb"
# - name: "Clone pyaedt on specific branch"
# uses: actions/checkout@v4
# with:
# repository: ansys/pyaedt
# path: "external/pyaedt"
# ref: "maint/use_pyedb"

- name: "Install Pyaedt"
run: |
.\.venv\Scripts\Activate.ps1
pip install --no-cache-dir external/pyaedt[full]
# - name: "Install Pyaedt"
# run: |
# .\.venv\Scripts\Activate.ps1
# pip install --no-cache-dir external/pyaedt[full]

- name: "Install specific vtk version with OSMesa bundled"
run: |
.\.venv\Scripts\Activate.ps1
pip uninstall vtk -y
# Note: the vtk-osmesa used is 9.2.X as 9.3.0 is not working
# well with the use of pyvista in our tests atm.
# TODO: update once a stable versio is working
pip install --extra-index-url https://wheels.vtk.org ${{ env.VTK_OSMESA }}
# - name: "Install specific vtk version with OSMesa bundled"
# run: |
# .\.venv\Scripts\Activate.ps1
# pip uninstall vtk -y
# # Note: the vtk-osmesa used is 9.2.X as 9.3.0 is not working
# # well with the use of pyvista in our tests atm.
# # TODO: update once a stable versio is working
# pip install --extra-index-url https://wheels.vtk.org ${{ env.VTK_OSMESA }}

- name: Execute legacy pyaedt integration examples
run: |
. .venv\Scripts\Activate.ps1
python examples/legacy/pyaedt_integration/03_5G_antenna_example.py
# Write-Host "Executing pyaedt integration example 03_5G_antenna_example.py"
# $time = Measure-Command {python examples/legacy/pyaedt_integration/03_5G_antenna_example.py}
# Write-Host "Time taken for example 03_5G_antenna_example.py: $($time.TotalSeconds) seconds"
# # Get-ChildItem -Path examples/legacy/pyaedt_integration -Filter *.py -File | ? { $_.Name -ne $excluded_example } | ForEach-Object {
# # Write-Host "Executing pyaedt integration example $($_.FullName)"
# # $time = Measure-Command {python $_.FullName}
# # Write-Host "Time taken for example $($_.FullName): $($time.TotalSeconds) seconds"
# # }
# - name: Execute legacy pyaedt integration examples
# run: |
# . .venv\Scripts\Activate.ps1
# python examples/legacy/pyaedt_integration/03_5G_antenna_example.py
# # Write-Host "Executing pyaedt integration example 03_5G_antenna_example.py"
# # $time = Measure-Command {python examples/legacy/pyaedt_integration/03_5G_antenna_example.py}
# # Write-Host "Time taken for example 03_5G_antenna_example.py: $($time.TotalSeconds) seconds"
# # # Get-ChildItem -Path examples/legacy/pyaedt_integration -Filter *.py -File | ? { $_.Name -ne $excluded_example } | ForEach-Object {
# # # Write-Host "Executing pyaedt integration example $($_.FullName)"
# # # $time = Measure-Command {python $_.FullName}
# # # Write-Host "Time taken for example $($_.FullName): $($time.TotalSeconds) seconds"
# # # }

0 comments on commit 6a33cd7

Please sign in to comment.