Skip to content

Commit 771f72b

Browse files
authored
ci(retro): use maps to manage DPF version and patch to test for retro (#923)
1 parent 83ee36a commit 771f72b

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ jobs:
147147
uses: codecov/codecov-action@v5
148148

149149
retro:
150-
name: "Retro-compatibility"
150+
name: "Test DPF ${{ matrix.ANSYS_VERSION.version }}${{ matrix.ANSYS_VERSION.patch }} compatibility"
151151
if: startsWith(github.head_ref, 'main') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
152152
runs-on: ${{ matrix.os }}
153153
strategy:
@@ -156,14 +156,14 @@ jobs:
156156
python-version: ["3.10"]
157157
os: ["windows-latest", "ubuntu-22.04"]
158158
ANSYS_VERSION:
159-
- ${{ fromJson(vars.ANSYS_VERSIONS_RETRO) }}
160-
- ${{ fromJson(vars.ANSYS_VERSION_LAST_RELEASED) }}
159+
- ${{ fromJson(vars.ANSYS_VERSIONS_RETRO_WITH_PATCH) }}
160+
- ${{ fromJson(vars.ANSYS_VERSION_LAST_RELEASED_WITH_PATCH) }}
161161

162162
steps:
163163
- uses: actions/checkout@v4
164164

165165
- name: "Set licensing if necessary"
166-
if: matrix.ANSYS_VERSION > 231
166+
if: matrix.ANSYS_VERSION.version > 231
167167
shell: bash
168168
run: |
169169
echo "ANSYS_DPF_ACCEPT_LA=Y" >> $GITHUB_ENV
@@ -173,13 +173,13 @@ jobs:
173173
uses: ansys/pydpf-actions/[email protected]
174174
with:
175175
python-version: ${{ matrix.python-version }}
176-
ANSYS_VERSION: ${{matrix.ANSYS_VERSION}}
176+
ANSYS_VERSION: ${{matrix.ANSYS_VERSION.version}}
177177
PACKAGE_NAME: ${{env.PACKAGE_NAME}}
178178
MODULE: ${{env.MODULE}}
179179
dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}}
180180
install_extras: graphics
181181
wheel: false
182-
standalone_suffix: ${{ matrix.ANSYS_VERSION == '241' && '.sp01' || '' }}
182+
standalone_suffix: ${{ matrix.ANSYS_VERSION.patch }}
183183

184184
- name: "Prepare Testing Environment"
185185
uses: ansys/pydpf-actions/prepare_tests@dependencies/bump_pyvista_setup-headless-display-action_to_v4
@@ -203,7 +203,7 @@ jobs:
203203
- name: "Upload Test Results"
204204
uses: actions/upload-artifact@v4
205205
with:
206-
name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ matrix.ANSYS_VERSION }}
206+
name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ matrix.ANSYS_VERSION.version }}${{ matrix.ANSYS_VERSION.patch }}
207207
path: tests/junit/test-results.xml
208208
if: always()
209209

.github/workflows/ci_release.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
- uses: actions/checkout@v4
7373

7474
- name: "Set licensing if necessary"
75-
if: ${{ (github.event.inputs.ansys_version || vars.ANSYS_VERSION_LAST_RELEASED) > '231' }}
75+
if: ${{ (github.event.inputs.ansys_version || fromJson(vars.ANSYS_VERSION_LAST_RELEASED_WITH_PATCH).version) > '231' }}
7676
shell: bash
7777
run: |
7878
echo "ANSYS_DPF_ACCEPT_LA=Y" >> $GITHUB_ENV
@@ -82,15 +82,15 @@ jobs:
8282
uses: ansys/pydpf-actions/[email protected]
8383
with:
8484
python-version: ${{ matrix.python-version }}
85-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_LAST_RELEASED }}
85+
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || fromJson(vars.ANSYS_VERSION_LAST_RELEASED_WITH_PATCH).version }}
8686
PACKAGE_NAME: ${{env.PACKAGE_NAME}}
8787
MODULE: ${{env.MODULE}}
8888
dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}}
8989
install_extras: graphics
9090
# Upload the wheel artifact for only one of the OS as it is OS-agnostic
9191
wheel: ${{ (matrix.python-version == env.MAIN_PYTHON_VERSION) && (matrix.os == 'windows-latest') }}
9292
wheelhouse: true
93-
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }}
93+
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || fromJson(vars.ANSYS_VERSION_LAST_RELEASED_WITH_PATCH).patch }}
9494

9595
- name: "Prepare Testing Environment"
9696
uses: ansys/pydpf-actions/prepare_tests@dependencies/bump_pyvista_setup-headless-display-action_to_v4
@@ -121,27 +121,27 @@ jobs:
121121
- name: "Upload Test Results"
122122
uses: actions/upload-artifact@v4
123123
with:
124-
name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ env.ANSYS_VERSION }}
124+
name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ github.event.inputs.ansys_version || fromJson(vars.ANSYS_VERSION_LAST_RELEASED_WITH_PATCH).version }}${{ github.event.inputs.standalone_branch_suffix || fromJson(vars.ANSYS_VERSION_LAST_RELEASED_WITH_PATCH).patch }}
125125
path: tests/junit/test-results.xml
126126

127127
- name: "Upload coverage to Codecov"
128128
uses: codecov/codecov-action@v5
129129

130130
retro:
131-
name: "Retro-compatibility"
131+
name: "Test DPF ${{ matrix.ANSYS_VERSION.version }}${{ matrix.ANSYS_VERSION.patch }} compatibility"
132132
runs-on: ${{ matrix.os }}
133133
strategy:
134134
fail-fast: false
135135
matrix:
136136
python-version: ["3.10"]
137137
os: ["windows-latest", "ubuntu-22.04"]
138-
ANSYS_VERSION: ${{ fromJson(vars.ANSYS_VERSIONS_RETRO) }}
138+
ANSYS_VERSION: ${{ fromJson(vars.ANSYS_VERSIONS_RETRO_WITH_PATCH) }}
139139

140140
steps:
141141
- uses: actions/checkout@v4
142142

143143
- name: "Set licensing if necessary"
144-
if: matrix.ANSYS_VERSION > 231
144+
if: matrix.ANSYS_VERSION.version > 231
145145
shell: bash
146146
run: |
147147
echo "ANSYS_DPF_ACCEPT_LA=Y" >> $GITHUB_ENV
@@ -151,7 +151,8 @@ jobs:
151151
uses: ansys/pydpf-actions/[email protected]
152152
with:
153153
python-version: ${{ matrix.python-version }}
154-
ANSYS_VERSION: ${{matrix.ANSYS_VERSION}}
154+
ANSYS_VERSION: ${{ matrix.ANSYS_VERSION.version }}
155+
standalone_suffix: ${{ matrix.ANSYS_VERSION.patch }}
155156
PACKAGE_NAME: ${{env.PACKAGE_NAME}}
156157
MODULE: ${{env.MODULE}}
157158
dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}}
@@ -181,7 +182,7 @@ jobs:
181182
- name: "Upload Test Results"
182183
uses: actions/upload-artifact@v4
183184
with:
184-
name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ matrix.ANSYS_VERSION }}
185+
name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ matrix.ANSYS_VERSION.version }}${{ matrix.ANSYS_VERSION.patch }}
185186
path: tests/junit/test-results.xml
186187
if: always()
187188

@@ -191,17 +192,17 @@ jobs:
191192
examples:
192193
uses: ./.github/workflows/examples.yml
193194
with:
194-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_LAST_RELEASED }}
195+
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_LAST_RELEASED_WITH_PATCH.version }}
195196
python_versions: '["3.10"]'
196-
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }}
197+
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || vars.ANSYS_VERSION_LAST_RELEASED_WITH_PATCH.patch }}
197198
secrets: inherit
198199

199200
docs:
200201
uses: ./.github/workflows/docs.yml
201202
with:
202-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_LAST_RELEASED }}
203+
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_LAST_RELEASED_WITH_PATCH.version }}
203204
python_version: "3.10"
204-
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }}
205+
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || vars.ANSYS_VERSION_LAST_RELEASED_WITH_PATCH.patch }}
205206
event_name: ${{ github.event_name }}
206207
secrets: inherit
207208

0 commit comments

Comments
 (0)