Skip to content

Commit 6f4dac3

Browse files
authored
ci: use repository variables for retro testing matrices (#2517)
1 parent c526d6e commit 6f4dac3

File tree

2 files changed

+25
-33
lines changed

2 files changed

+25
-33
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -225,28 +225,23 @@ jobs:
225225
secrets: inherit
226226

227227
tests-retro:
228-
name: "Test DPF ${{ matrix.dpf.version }} compatibility"
228+
name: "Test DPF ${{ matrix.version }} compatibility"
229229
if: |
230230
github.event.action != 'closed' &&
231231
(github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
232232
(startsWith(github.head_ref, 'main') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
233233
strategy:
234234
fail-fast: false
235235
matrix:
236-
dpf:
237-
- {"version": "252", "standalone-suffix": ""}
238-
- {"version": "251", "standalone-suffix": ""}
239-
- {"version": "242", "standalone-suffix": ""}
240-
- {"version": "241", "standalone-suffix": ".sp01"}
241-
- {"version": "232", "standalone-suffix": ""}
242-
- {"version": "231", "standalone-suffix": ""}
243-
- {"version": "222", "standalone-suffix": ""}
236+
version:
237+
- ${{ fromJson(vars.ANSYS_VERSIONS_RETRO) }}
238+
- ${{ fromJson(vars.ANSYS_VERSION_LAST_RELEASED) }}
244239
uses: ./.github/workflows/tests.yml
245240
with:
246-
ANSYS_VERSION: ${{ matrix.dpf.version }}
241+
ANSYS_VERSION: ${{ matrix.version }}
247242
python_versions: '["3.10"]'
248243
DOCSTRING: false
249-
standalone_suffix: ${{ matrix.dpf.standalone-suffix }}
244+
standalone_suffix: ${{ matrix.version == '241' && '.sp01' || '' }}
250245
secrets: inherit
251246

252247
sync-main-with-master:

.github/workflows/ci_release.yml

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -126,43 +126,40 @@ jobs:
126126
secrets: inherit
127127

128128
tests-retro:
129-
name: "Test DPF ${{ matrix.dpf.version }} compatibility"
129+
name: "Test DPF ${{ matrix.version }} compatibility"
130130
strategy:
131131
fail-fast: false
132132
matrix:
133-
dpf:
134-
- {"version": "251", "standalone-suffix": ""}
135-
- {"version": "242", "standalone-suffix": ""}
136-
- {"version": "241", "standalone-suffix": ".sp01"}
137-
- {"version": "232", "standalone-suffix": ""}
138-
- {"version": "231", "standalone-suffix": ""}
139-
- {"version": "222", "standalone-suffix": ""}
133+
version:
134+
- ${{ fromJson(vars.ANSYS_VERSIONS_RETRO) }}
140135
uses: ./.github/workflows/tests.yml
141136
with:
142-
ANSYS_VERSION: ${{ matrix.dpf.version }}
137+
ANSYS_VERSION: ${{ matrix.version }}
143138
python_versions: '["3.10"]'
144139
DOCSTRING: false
145-
standalone_suffix: ${{ matrix.dpf.standalone-suffix }}
140+
standalone_suffix: ${{ matrix.version == '241' && '.sp01' || '' }}
146141
secrets: inherit
147142

148143
tests-pydpf-post:
149-
name: "Test PyDPF-Post with ${{ matrix.dpf.version}}"
144+
name: "Test PyDPF-Post with ${{ matrix.version}}"
150145
strategy:
151146
fail-fast: false
152147
matrix:
153-
dpf:
154-
- {"version": "252", "standalone-suffix": "${{ github.event.inputs.standalone_branch_suffix || '' }}", "test_docstrings": "true"}
155-
- {"version": "251", "standalone-suffix": "", "test_docstrings": "false"}
156-
- {"version": "242", "standalone-suffix": "", "test_docstrings": "false"}
157-
- {"version": "241", "standalone-suffix": "", "test_docstrings": "false"}
158-
- {"version": "232", "standalone-suffix": "", "test_docstrings": "false"}
159-
- {"version": "231", "standalone-suffix": "", "test_docstrings": "false"}
160-
- {"version": "222", "standalone-suffix": "", "test_docstrings": "false"}
148+
version:
149+
- ${{ fromJson(vars.ANSYS_VERSIONS_RETRO) }}
150+
standalone_suffix:
151+
- ""
152+
test_docstrings:
153+
- "false"
154+
include:
155+
- version: ${{ vars.ANSYS_VERSION_LAST_RELEASED }}
156+
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }}
157+
test_docstrings": "true"
161158
uses: ./.github/workflows/pydpf-post.yml
162159
with:
163-
ANSYS_VERSION: ${{ matrix.dpf.version }}
164-
standalone_suffix: ${{ matrix.dpf.standalone-suffix }}
165-
test_docstrings: ${{ matrix.dpf.test_docstrings }}
160+
ANSYS_VERSION: ${{ matrix.version }}
161+
standalone_suffix: ${{ matrix.version == '241' && '.sp01' || matrix.standalone_suffix }}
162+
test_docstrings: ${{ matrix.test_docstrings }}
166163
secrets: inherit
167164

168165
docker_tests:

0 commit comments

Comments
 (0)