@@ -142,7 +142,14 @@ jobs:
142
142
- name : Run the test
143
143
id : check
144
144
continue-on-error : true
145
- run : php "bin/${{ matrix.cmd }}" --version
145
+ shell : bash
146
+ run : |
147
+ set +e
148
+ php "bin/${{ matrix.cmd }}" --version
149
+ exitcode="$?"
150
+ echo "EXITCODE=$exitcode" >> "$GITHUB_OUTPUT"
151
+ echo "Exitcode is: $exitcode"
152
+ exit "$exitcode"
146
153
147
154
- name : Check the result of a successful test against expectation
148
155
if : ${{ steps.check.outcome == 'success' && matrix.expect == 'fail' }}
@@ -152,6 +159,14 @@ jobs:
152
159
if : ${{ steps.check.outcome != 'success' && matrix.expect == 'success' }}
153
160
run : exit 1
154
161
162
+ - name : Verify the exit code is 0 when requirements are met
163
+ if : ${{ matrix.expect == 'success' && steps.check.outputs.EXITCODE != 0 }}
164
+ run : exit 1
165
+
166
+ - name : Verify the exit code is 64 when requirements are not met
167
+ if : ${{ matrix.expect == 'fail' && steps.check.outputs.EXITCODE != 64 }}
168
+ run : exit 1
169
+
155
170
build-phars :
156
171
needs : lint
157
172
@@ -199,7 +214,14 @@ jobs:
199
214
- name : Run the test
200
215
id : check
201
216
continue-on-error : true
202
- run : php ${{ matrix.cmd }}.phar --version
217
+ shell : bash
218
+ run : |
219
+ set +e
220
+ php ${{ matrix.cmd }}.phar --version
221
+ exitcode="$?"
222
+ echo "EXITCODE=$exitcode" >> "$GITHUB_OUTPUT"
223
+ echo "Exitcode is: $exitcode"
224
+ exit "$exitcode"
203
225
204
226
- name : Check the result of a successful test against expectation
205
227
if : ${{ steps.check.outcome == 'success' && matrix.expect == 'fail' }}
@@ -208,3 +230,11 @@ jobs:
208
230
- name : Check the result of a failed test against expectation
209
231
if : ${{ steps.check.outcome != 'success' && matrix.expect == 'success' }}
210
232
run : exit 1
233
+
234
+ - name : Verify the exit code is 0 when requirements are met
235
+ if : ${{ matrix.expect == 'success' && steps.check.outputs.EXITCODE != 0 }}
236
+ run : exit 1
237
+
238
+ - name : Verify the exit code is 64 when requirements are not met
239
+ if : ${{ matrix.expect == 'fail' && steps.check.outputs.EXITCODE != 64 }}
240
+ run : exit 1
0 commit comments