Skip to content

Commit a2de17b

Browse files
authored
fix: speos workflow (#113)
1 parent 5cfeae5 commit a2de17b

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

.github/workflows/speos-optislang.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424

2525
env:
2626
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER )}}
27-
ANSYS_RELEASE_FOR_DOCS: 25.2.0
27+
ANSYS_RELEASE_FOR_DOCS: 25.2
2828
AWP_ROOT252: 'C:\Program Files\ANSYS Inc\v252'
2929
MAIN_PYTHON_VERSION: '3.12'
3030
ON_CI: true
@@ -43,7 +43,7 @@ jobs:
4343
strategy:
4444
fail-fast: false
4545
matrix:
46-
ansys-release: ${{ needs.is-only-docs-required.outputs.only-docs == 'true' && fromJSON('[25.2.0]') || fromJSON('[25.2.0]') }}
46+
ansys-release: ${{ needs.is-only-docs-required.outputs.only-docs == 'true' && fromJSON('[25.2]') || fromJSON('[25.2]') }}
4747
steps:
4848
- name: Checkout code
4949
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.2.2
@@ -60,8 +60,7 @@ jobs:
6060
- name: Set up environment variables
6161
shell: bash
6262
run: |
63-
VERSION="${{ matrix.ansys-release }}"
64-
ANSYS_RELEASE_SHORT="${VERSION%.*}"
63+
ANSYS_RELEASE_SHORT="${{ matrix.ansys-release }}"
6564
echo "ANSYS_RELEASE_SHORT=$ANSYS_RELEASE_SHORT" >> $GITHUB_ENV
6665
ANSYS_RELEASE_COMPACT="${ANSYS_RELEASE_SHORT//./}"
6766
echo "ANSYS_RELEASE_COMPACT=$ANSYS_RELEASE_COMPACT" >> $GITHUB_ENV
@@ -72,15 +71,15 @@ jobs:
7271
python -m pip install --upgrade pip
7372
python -m venv .venv
7473
source .venv/Scripts/activate
75-
pip install -r speos-optislang/requirements_${{ env.ANSYS_RELEASE_SHORT }}.txt
74+
pip install -r speos-optislang/requirements_${{ matrix.ansys-release }}.txt
7675
7776
- name: Run the workflow script
7877
shell: bash
7978
run: |
8079
source .venv/Scripts/activate
8180
python speos-optislang/wf_so_01_light_guide_robustness_study.py
8281
83-
- name: (DOCS) Build the documentation (only on ${{ env.ANSYS_RELEASE_FOR_DOCS}})
82+
- name: (DOCS) Build the documentation (only on ${{ env.ANSYS_RELEASE_FOR_DOCS }})
8483
if: needs.is-only-docs-required.outputs.only-docs == 'true' && matrix.ansys-release == env.ANSYS_RELEASE_FOR_DOCS
8584
env:
8685
BUILD_DOCS_SCRIPT: 'speos-optislang/wf_so_01_light_guide_robustness_study.py'

speos-optislang/wf_so_01_light_guide_robustness_study.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@
165165
GRAPHICS_BOOL = True
166166
# sphinx_gallery_end_ignore
167167

168+
ANSYS_RELEASE = os.getenv("ANSYS_RELEASE_COMPACT", "252")
169+
"""ANSYS release version."""
170+
168171
###############################################################################
169172
# Define functions
170173
# ----------------
@@ -532,7 +535,7 @@ def get_executable(version) -> Path:
532535
return osl_com
533536

534537

535-
osl_executable = get_executable(252)
538+
osl_executable = get_executable(ANSYS_RELEASE)
536539
my_osl = Optislang(
537540
executable=osl_executable,
538541
ini_timeout=60,
@@ -691,7 +694,7 @@ def calculate(designs) -> list:
691694
# create speos instance
692695
from ansys.speos.core import launcher
693696

694-
speos = launcher.launch_local_speos_rpc_server(version="252")
697+
speos = launcher.launch_local_speos_rpc_server(version=ANSYS_RELEASE)
695698

696699
# run speos simulation
697700
result_design_list = []

0 commit comments

Comments
 (0)