Skip to content

Commit 154a460

Browse files
authored
ci: fix usage of repository variable as workflow input (#2305)
1 parent 2cb1c85 commit 154a460

File tree

9 files changed

+52
-66
lines changed

9 files changed

+52
-66
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ on:
1414
description: "ANSYS version"
1515
required: false
1616
type: string
17-
default: vars.ANSYS_VERSION_DEFAULT
1817
standalone_branch_suffix:
1918
description: 'Suffix of the branch on standalone'
2019
required: false
@@ -105,7 +104,7 @@ jobs:
105104
uses: ./.github/workflows/tests.yml
106105
needs: pick_server_suffix
107106
with:
108-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
107+
ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
109108
python_versions: '["3.10"]'
110109
wheel: true
111110
wheelhouse: false
@@ -116,7 +115,7 @@ jobs:
116115
uses: ./.github/workflows/tests.yml
117116
needs: pick_server_suffix
118117
with:
119-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
118+
ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
120119
python_versions: '["3.10"]'
121120
wheel: true
122121
wheelhouse: false
@@ -129,7 +128,7 @@ jobs:
129128
uses: ./.github/workflows/test_docker.yml
130129
needs: pick_server_suffix
131130
with:
132-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
131+
ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
133132
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
134133
secrets: inherit
135134

@@ -138,7 +137,7 @@ jobs:
138137
uses: ./.github/workflows/examples_docker.yml
139138
needs: pick_server_suffix
140139
with:
141-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
140+
ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
142141
python_versions: '["3.10"]'
143142
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
144143
secrets: inherit
@@ -148,7 +147,7 @@ jobs:
148147
uses: ./.github/workflows/docs.yml
149148
needs: pick_server_suffix
150149
with:
151-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
150+
ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
152151
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
153152
event_name: ${{ github.event_name }}
154153
python_version: "3.11"
@@ -174,7 +173,7 @@ jobs:
174173
uses: ./.github/workflows/examples.yml
175174
needs: pick_server_suffix
176175
with:
177-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
176+
ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
178177
python_versions: '["3.10"]'
179178
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
180179
secrets: inherit
@@ -185,7 +184,7 @@ jobs:
185184
uses: ./.github/workflows/pydpf-post.yml
186185
needs: pick_server_suffix
187186
with:
188-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
187+
ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
189188
post_branch: "master"
190189
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
191190
test_docstrings: "true"

.github/workflows/ci_release.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
tests_3_10:
7777
uses: ./.github/workflows/tests.yml
7878
with:
79-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
79+
ANSYS_VERSION: ${{ inputs.ansys_version || '251' }}
8080
python_versions: '["3.10"]'
8181
wheel: true
8282
wheelhouse: true
@@ -86,7 +86,7 @@ jobs:
8686
tests:
8787
uses: ./.github/workflows/tests.yml
8888
with:
89-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
89+
ANSYS_VERSION: ${{ inputs.ansys_version || '251' }}
9090
python_versions: '["3.11", "3.12"]'
9191
DOCSTRING: false
9292
wheel: false
@@ -97,7 +97,7 @@ jobs:
9797
tests_any_3_10:
9898
uses: ./.github/workflows/tests.yml
9999
with:
100-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
100+
ANSYS_VERSION: ${{ inputs.ansys_version || '251' }}
101101
python_versions: '["3.10"]'
102102
wheel: true
103103
wheelhouse: false
@@ -108,7 +108,7 @@ jobs:
108108
tests_any:
109109
uses: ./.github/workflows/tests.yml
110110
with:
111-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
111+
ANSYS_VERSION: ${{ inputs.ansys_version || '251' }}
112112
python_versions: '["3.11", "3.12"]'
113113
DOCSTRING: false
114114
wheel: false
@@ -120,15 +120,15 @@ jobs:
120120
docs:
121121
uses: ./.github/workflows/docs.yml
122122
with:
123-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
123+
ANSYS_VERSION: ${{ inputs.ansys_version || '251' }}
124124
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }}
125125
event_name: ${{ github.event_name }}
126126
secrets: inherit
127127

128128
examples:
129129
uses: ./.github/workflows/examples.yml
130130
with:
131-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
131+
ANSYS_VERSION: ${{ inputs.ansys_version || '251' }}
132132
python_versions: '["3.10", "3.11", "3.12"]'
133133
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }}
134134
secrets: inherit
@@ -183,7 +183,7 @@ jobs:
183183
name: "PyDPF-Post with 251"
184184
uses: ./.github/workflows/pydpf-post.yml
185185
with:
186-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
186+
ANSYS_VERSION: ${{ inputs.ansys_version || '251' }}
187187
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }}
188188
test_docstrings: "true"
189189
secrets: inherit
@@ -227,15 +227,15 @@ jobs:
227227
name: "Build and Test on Docker"
228228
uses: ./.github/workflows/test_docker.yml
229229
with:
230-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
230+
ANSYS_VERSION: ${{ inputs.ansys_version || '251' }}
231231
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }}
232232
secrets: inherit
233233

234234
docker_examples:
235235
name: "Run examples on Docker"
236236
uses: ./.github/workflows/examples_docker.yml
237237
with:
238-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
238+
ANSYS_VERSION: ${{ inputs.ansys_version || '251' }}
239239
python_versions: '["3.10", "3.11", "3.12"]'
240240
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }}
241241
secrets: inherit

.github/workflows/docs.yml

Lines changed: 2 additions & 4 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: vars.ANSYS_VERSION_DEFAULT
1514
standalone_suffix:
1615
description: "Suffix of the branch on standalone"
1716
required: false
@@ -32,9 +31,8 @@ on:
3231
default: "3.11"
3332
ANSYS_VERSION:
3433
description: "ANSYS version"
35-
required: true
34+
required: false
3635
type: string
37-
default: vars.ANSYS_VERSION_DEFAULT
3836
standalone_suffix:
3937
description: "Suffix of the branch on standalone"
4038
required: false
@@ -61,7 +59,7 @@ jobs:
6159
- uses: actions/checkout@v4
6260

6361
- name: "Set licensing if necessary"
64-
if: inputs.ANSYS_VERSION > 231
62+
if: ${{ (inputs.ANSYS_VERSION || vars.ANSYS_VERSION_DEFAULT) > '231' }}
6563
shell: bash
6664
run: |
6765
echo "ANSYS_DPF_ACCEPT_LA=Y" >> $GITHUB_ENV

.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: vars.ANSYS_VERSION_DEFAULT
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: vars.ANSYS_VERSION_DEFAULT
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: ${{ (inputs.ANSYS_VERSION || vars.ANSYS_VERSION_DEFAULT) > '231' }}
6967
shell: bash
7068
run: |
7169
echo "ANSYS_DPF_ACCEPT_LA=Y" >> $GITHUB_ENV
@@ -109,7 +107,7 @@ jobs:
109107
with:
110108
dpf-standalone-TOKEN: ${{secrets.DPF_PIPELINE}}
111109
standalone_suffix: ${{ inputs.standalone_suffix }}
112-
ANSYS_VERSION : ${{inputs.ANSYS_VERSION}}
110+
ANSYS_VERSION : ${{ inputs.ANSYS_VERSION || vars.ANSYS_VERSION_DEFAULT }}
113111

114112
- name: "Check licences of packages"
115113
uses: ansys/pydpf-actions/[email protected]

.github/workflows/examples_docker.yml

Lines changed: 2 additions & 4 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: vars.ANSYS_VERSION_DEFAULT
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: vars.ANSYS_VERSION_DEFAULT
3331
standalone_suffix:
3432
description: "Suffix of the branch on standalone"
3533
required: false
@@ -105,7 +103,7 @@ jobs:
105103
with:
106104
dpf-standalone-TOKEN: ${{secrets.DPF_PIPELINE}}
107105
standalone_suffix: ${{ inputs.standalone_suffix }}
108-
ANSYS_VERSION : ${{inputs.ANSYS_VERSION}}
106+
ANSYS_VERSION : ${{ inputs.ANSYS_VERSION || vars.ANSYS_VERSION_DEFAULT }}
109107

110108
- name: "Check licences of packages"
111109
uses: ansys/pydpf-actions/[email protected]

.github/workflows/pydpf-post.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ on:
1010
ANSYS_VERSION:
1111
required: false
1212
type: string
13-
default: vars.ANSYS_VERSION_DEFAULT
1413
standalone_suffix:
1514
description: "Suffix of the branch on standalone"
1615
required: false
@@ -30,9 +29,8 @@ on:
3029
type: string
3130
ANSYS_VERSION:
3231
description: "ANSYS version"
33-
required: true
32+
required: false
3433
type: string
35-
default: vars.ANSYS_VERSION_DEFAULT
3634
standalone_suffix:
3735
description: "Suffix of the branch on standalone"
3836
required: false
@@ -62,7 +60,7 @@ jobs:
6260
- uses: actions/checkout@v4
6361

6462
- name: "Set licensing if necessary"
65-
if: inputs.ANSYS_VERSION > 231
63+
if: ${{ (inputs.ANSYS_VERSION || vars.ANSYS_VERSION_DEFAULT) > '231' }}
6664
shell: bash
6765
run: |
6866
echo "ANSYS_DPF_ACCEPT_LA=Y" >> $GITHUB_ENV
@@ -106,7 +104,7 @@ jobs:
106104
with:
107105
dpf-standalone-TOKEN: ${{secrets.DPF_PIPELINE}}
108106
standalone_suffix: ${{ inputs.standalone_suffix }}
109-
ANSYS_VERSION : ${{inputs.ANSYS_VERSION}}
107+
ANSYS_VERSION : ${{ inputs.ANSYS_VERSION || vars.ANSYS_VERSION_DEFAULT }}
110108

111109
- name: "Check licences of packages"
112110
uses: ansys/pydpf-actions/[email protected]

.github/workflows/test_docker.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ on:
1212
ANSYS_VERSION:
1313
required: false
1414
type: string
15-
default: vars.ANSYS_VERSION_DEFAULT
1615
# Can be called manually
1716
workflow_dispatch:
1817
inputs:
@@ -23,9 +22,8 @@ on:
2322
default: ''
2423
ANSYS_VERSION:
2524
description: "ANSYS version to run."
26-
required: true
25+
required: false
2726
type: string
28-
default: vars.ANSYS_VERSION_DEFAULT
2927

3028
env:
3129
PACKAGE_NAME: ansys-dpf-core
@@ -87,7 +85,7 @@ jobs:
8785
with:
8886
dpf-standalone-TOKEN: ${{secrets.DPF_PIPELINE}}
8987
standalone_suffix: ${{ inputs.standalone_suffix }}
90-
ANSYS_VERSION : ${{inputs.ANSYS_VERSION}}
88+
ANSYS_VERSION : ${{ inputs.ANSYS_VERSION || vars.ANSYS_VERSION_DEFAULT }}
9189

9290
- name: "Check licences of packages"
9391
uses: ansys/pydpf-actions/[email protected]
@@ -219,21 +217,21 @@ jobs:
219217
- name: "Upload Test Results"
220218
uses: actions/upload-artifact@v4
221219
with:
222-
name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ inputs.ANSYS_VERSION }}_docker
220+
name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ inputs.ANSYS_VERSION || vars.ANSYS_VERSION_DEFAULT }}_docker
223221
path: tests/junit/test-results.xml
224222
timeout-minutes: 5
225223

226224
- name: "Upload coverage to Codecov"
227225
uses: codecov/codecov-action@v4
228226
with:
229227
token: ${{ secrets.CODECOV_TOKEN }} # required
230-
name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ inputs.ANSYS_VERSION }}_docker.xml
231-
flags: docker,${{ inputs.ANSYS_VERSION }},${{ matrix.os }},${{ matrix.python-version }}
228+
name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ inputs.ANSYS_VERSION || vars.ANSYS_VERSION_DEFAULT }}_docker.xml
229+
flags: docker,${{ inputs.ANSYS_VERSION || vars.ANSYS_VERSION_DEFAULT }},${{ matrix.os }},${{ matrix.python-version }}
232230

233231
- name: "Upload test analytics results to Codecov"
234232
if: ${{ !cancelled() }}
235233
uses: codecov/test-results-action@v1
236234
with:
237235
token: ${{ secrets.CODECOV_TOKEN }}
238-
name: test_results_${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_${{ inputs.ANSYS_VERSION }}${{ inputs.test_any == 'true' && '_any' || '' }}
239-
flags: ${{ inputs.ANSYS_VERSION }},${{ matrix.os }},${{ matrix.python-version }}${{ inputs.test_any == 'true' && ',any' || '' }}
236+
name: test_results_${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_${{ inputs.ANSYS_VERSION || vars.ANSYS_VERSION_DEFAULT }}${{ inputs.test_any == 'true' && '_any' || '' }}
237+
flags: ${{ inputs.ANSYS_VERSION || vars.ANSYS_VERSION_DEFAULT }},${{ matrix.os }},${{ matrix.python-version }}${{ inputs.test_any == 'true' && ',any' || '' }}

0 commit comments

Comments
 (0)