Skip to content

Commit 20b4310

Browse files
PProfizimoe-ad
andauthored
ci: use repository variable for default ANSYS version to test (#838)
Co-authored-by: Muhammed Adedigba <[email protected]>
1 parent 756c221 commit 20b4310

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ on:
1313
standalone_branch_suffix:
1414
description: 'Suffix of the branch on standalone'
1515
required: false
16-
default: ''
16+
default: ''
17+
ansys_version:
18+
description: "ANSYS version"
19+
required: false
20+
type: string
1721

1822

1923
concurrency:
@@ -25,7 +29,6 @@ env:
2529
MODULE: 'post'
2630
DOCUMENTATION_CNAME: 'post.docs.pyansys.com'
2731
MAIN_PYTHON_VERSION: '3.10'
28-
ANSYS_VERSION: '252'
2932

3033
jobs:
3134
debug:
@@ -87,7 +90,7 @@ jobs:
8790
- uses: actions/checkout@v4
8891

8992
- name: "Set licensing if necessary"
90-
if: env.ANSYS_VERSION > 231
93+
if: ${{ (github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT) > '231' }}
9194
shell: bash
9295
run: |
9396
echo "ANSYS_DPF_ACCEPT_LA=Y" >> $GITHUB_ENV
@@ -97,7 +100,7 @@ jobs:
97100
uses: ansys/pydpf-actions/[email protected]
98101
with:
99102
python-version: ${{ matrix.python-version }}
100-
ANSYS_VERSION: ${{env.ANSYS_VERSION}}
103+
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
101104
PACKAGE_NAME: ${{env.PACKAGE_NAME}}
102105
MODULE: ${{env.MODULE}}
103106
dpf-standalone-TOKEN: ${{secrets.DPF_PIPELINE}}
@@ -152,7 +155,7 @@ jobs:
152155
matrix:
153156
python-version: ["3.10"]
154157
os: ["windows-latest", "ubuntu-latest"]
155-
ANSYS_VERSION: ["251", "242", "241", "232", "231", "222"]
158+
ANSYS_VERSION: ["252", "251", "242", "241", "232", "231", "222"]
156159

157160
steps:
158161
- uses: actions/checkout@v4
@@ -209,7 +212,7 @@ jobs:
209212
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
210213
uses: ./.github/workflows/examples.yml
211214
with:
212-
ANSYS_VERSION: "252"
215+
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
213216
python_versions: '["3.10"]'
214217
standalone_suffix: ${{ inputs.standalone_suffix || ''}}
215218
secrets: inherit
@@ -218,7 +221,7 @@ jobs:
218221
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
219222
uses: ./.github/workflows/docs.yml
220223
with:
221-
ANSYS_VERSION: "252"
224+
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
222225
python_version: "3.10"
223226
standalone_suffix: ${{ inputs.standalone_suffix || ''}}
224227
event_name: ${{ github.event_name }}

.github/workflows/docs.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ on:
1111
ANSYS_VERSION:
1212
required: false
1313
type: string
14-
default: "252"
1514
standalone_suffix:
1615
description: "Suffix of the branch on standalone"
1716
required: false
@@ -40,9 +39,8 @@ on:
4039
default: "3.10"
4140
ANSYS_VERSION:
4241
description: "ANSYS version"
43-
required: true
42+
required: false
4443
type: string
45-
default: "252"
4644
standalone_suffix:
4745
description: "Suffix of the branch on standalone"
4846
required: false
@@ -74,7 +72,7 @@ jobs:
7472
- uses: actions/checkout@v4
7573

7674
- name: "Set licensing if necessary"
77-
if: inputs.ANSYS_VERSION > 231
75+
if: ${{ (github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT) > '231' }}
7876
shell: bash
7977
run: |
8078
echo "ANSYS_DPF_ACCEPT_LA=Y" >> $GITHUB_ENV
@@ -96,7 +94,7 @@ jobs:
9694
uses: ansys/pydpf-actions/[email protected]
9795
with:
9896
python-version: ${{ inputs.python_version }}
99-
ANSYS_VERSION: ${{inputs.ANSYS_VERSION}}
97+
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
10098
PACKAGE_NAME: ${{env.PACKAGE_NAME}}
10199
MODULE: ${{env.MODULE}}
102100
dpf-standalone-TOKEN: ${{secrets.DPF_PIPELINE}}

.github/workflows/examples.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ on:
1111
ANSYS_VERSION:
1212
required: false
1313
type: string
14-
default: "252"
1514
standalone_suffix:
1615
description: "Suffix of the branch on standalone"
1716
required: false
@@ -27,9 +26,8 @@ on:
2726
default: '["3.10"]'
2827
ANSYS_VERSION:
2928
description: "ANSYS version to run."
30-
required: true
29+
required: false
3130
type: string
32-
default: "252"
3331
standalone_suffix:
3432
description: "Suffix of the branch on standalone"
3533
required: false
@@ -65,7 +63,7 @@ jobs:
6563
- uses: actions/checkout@v4
6664

6765
- name: "Set licensing if necessary"
68-
if: inputs.ANSYS_VERSION > 231
66+
if: ${{ (github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT) > '231' }}
6967
shell: bash
7068
run: |
7169
echo "ANSYS_DPF_ACCEPT_LA=Y" >> $GITHUB_ENV
@@ -80,7 +78,7 @@ jobs:
8078
uses: ansys/pydpf-actions/[email protected]
8179
with:
8280
python-version: ${{ matrix.python-version }}
83-
ANSYS_VERSION: ${{inputs.ANSYS_VERSION}}
81+
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
8482
PACKAGE_NAME: ${{ env.PACKAGE_NAME }}
8583
MODULE: ${{ env.MODULE }}
8684
dpf-standalone-TOKEN: ${{secrets.DPF_PIPELINE}}

0 commit comments

Comments
 (0)