@@ -142,7 +142,14 @@ jobs:
142142 - name : Run the test
143143 id : check
144144 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"
146153
147154 - name : Check the result of a successful test against expectation
148155 if : ${{ steps.check.outcome == 'success' && matrix.expect == 'fail' }}
@@ -152,6 +159,14 @@ jobs:
152159 if : ${{ steps.check.outcome != 'success' && matrix.expect == 'success' }}
153160 run : exit 1
154161
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+
155170 build-phars :
156171 needs : lint
157172
@@ -199,7 +214,14 @@ jobs:
199214 - name : Run the test
200215 id : check
201216 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"
203225
204226 - name : Check the result of a successful test against expectation
205227 if : ${{ steps.check.outcome == 'success' && matrix.expect == 'fail' }}
@@ -208,3 +230,11 @@ jobs:
208230 - name : Check the result of a failed test against expectation
209231 if : ${{ steps.check.outcome != 'success' && matrix.expect == 'success' }}
210232 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