Skip to content

Commit

Permalink
CI: fix example not running
Browse files Browse the repository at this point in the history
Notes
Wrong version of AEDT used in a test.
Disable legacy example 01 because it takes too long to run.
Disable pyaedt integration examples as they don't run atm.
  • Loading branch information
SMoraisAnsys committed Nov 2, 2023
1 parent d168a9c commit 2c6b11b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
24 changes: 11 additions & 13 deletions .github/workflows/legacy_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,22 @@ jobs:
- name: "Install Git and clone project"
uses: actions/checkout@v4

- name: "Set up Python"
uses: ansys/actions/_setup-python@main
- name: "Setup Python"
uses: actions/setup-python@v4
with:
cache: 'pip'
python-version: '3.10'
use-cache: false

- name: "Update pip"
run: python -m pip install -U pip

- name: "Install Python library"
run: python -m pip install .

- name: "Install examples extra dependency"
run: python -m pip install pyaedt
- name: Install pyedb with tests dependencies
run: |
pip install .
- name: Look for legacy examples and execute them
- name: Execute legacy examples (except pyaedt related and 01)
run: |
Get-ChildItem -Path examples/legacy -Filter *.py -Recurse -File | ForEach-Object {
# Exclude example 01_edb_example.py because it is too long
$excluded_example = "01_edb_example.py"
# TODO: once pyaedt examples are passing, use -Recurse to cover them
Get-ChildItem -Path examples/legacy -Filter *.py -File | ? { $_.Name -ne $excluded_example } | ForEach-Object {
Write-Host "Executing example $($_.FullName)"
python $_.FullName
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ concurrency:

env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
PYEDB_USE_LEGACY: '0'
PYEDB_USE_LEGACY: '1'
PYEDB_CI_NO_DISPLAY: '1'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down
2 changes: 1 addition & 1 deletion examples/legacy/01_edb_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# Launch EDB
# ~~~~~~~~~~
# Launch the :class:`pyaedt.Edb` class, using EDB 2023 R2 and SI units.
edb_version = "2023.1"
edb_version = "2023.2"
if os.path.exists(aedt_file):
os.remove(aedt_file)
edb = pyedb.Edb(edbpath=targetfile, edbversion=edb_version)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies = [
"cffi == 1.15.1;platform_system=='Linux' and python_version == '3.7'",
"cffi == 1.16.0;platform_system=='Linux' and python_version > '3.7'",
"pywin32 >= 303;platform_system=='Windows'",
"ansys-pythonnet >= 3.1.0rc2",
"ansys-pythonnet >= 3.1.0rc3",
"rpyc==5.3.1",
"psutil",
"dotnetcore2 ==3.1.23;platform_system=='Linux'",
Expand Down

0 comments on commit 2c6b11b

Please sign in to comment.