File tree Expand file tree Collapse file tree 3 files changed +41
-4
lines changed Expand file tree Collapse file tree 3 files changed +41
-4
lines changed Original file line number Diff line number Diff line change @@ -113,11 +113,21 @@ jobs:
113113 repository : ["ZestCommunity/ZestCode"]
114114 ref : ["main"]
115115 caller_token : ["${{ github.token }}"]
116+ clone_repo : [true]
117+ expect_error : [false]
118+ include :
119+ # Specific case of setup command failure
120+ - write_job_summary : true
121+ clone_repo : false
122+ expect_error : true
123+
116124 with :
117125 write_job_summary : ${{ matrix.write_job_summary }}
118126 repository : ${{ matrix.repository }}
119127 ref : ${{ matrix.ref }}
120128 caller_token : ${{ matrix.caller_token }}
129+ clone_repo : ${{ matrix.clone_repo }}
130+ expect_error : ${{ matrix.expect_error }}
121131
122132 Upload_Image :
123133 name : Upload Docker Image to ghcr.io Registry
Original file line number Diff line number Diff line change 1818 description : Whether to write the artifact URL to the job summary
1919 default : true
2020 type : boolean
21+ clone_repo :
22+ description : Whether to clone the repo
23+ default : true
24+ type : boolean
25+ expect_error :
26+ description : Whether to expect an error
27+ default : false
28+ type : boolean
2129
2230jobs :
2331 test :
2432 name : " Testing Container: Write Job Summary?${{ inputs.write_job_summary }}"
2533 runs-on : ubuntu-latest
2634 steps :
27- - name : Checkout
35+ - name : Print Inputs
36+ run : |
37+ echo "Inputs(repository): ${{ inputs.repository }}"
38+ echo "Inputs(ref): ${{ inputs.ref }}"
39+ echo "Inputs(caller_token): ${{ inputs.caller_token }}"
40+ echo "Inputs(write_job_summary): ${{ inputs.write_job_summary }}"
41+ echo "Inputs(clone_repo): ${{ inputs.clone_repo }}"
42+ echo "Inputs(expect_error): ${{ inputs.expect_error }}"
43+
44+ - name : Checkout Repository to Test
2845 uses : actions/checkout@v4
46+ if : ${{ inputs.clone_repo }}
2947 with :
3048 repository : ${{ inputs.repository }}
3149 ref : ${{ inputs.ref }}
3250
33- - name : Checkout
51+ - name : Checkout Action
3452 uses : actions/checkout@v4
3553 with :
3654 path : ./action/
5573 - name : Test Action
5674 id : test-action
5775 uses : ./action/
58- continue-on-error : False
76+ continue-on-error : ${{ inputs.expect_error }}
5977 with :
6078 write_job_summary : ${{ inputs.write_job_summary }}
79+
80+ - name : Check for Failure If Expected
81+ if : ${{ inputs.expect_error }}
82+ run : |
83+ if [ "${{ (steps.test-action.outcome == 'success') }}" == "true" ]; then
84+ echo "Test Action step succeeded when it was expected to fail. Failing job.."
85+ exit 1
86+ else
87+ echo "Test Action step failed as expected."
88+ fi
Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ git config --global --add safe.directory /github/workspace
3030COMPILE_STD_OUTPUT=$( mktemp)
3131echo " ::group::Build Project"
3232meson setup --cross-file scripts/v5.ini build | tee $COMPILE_STD_OUTPUT
33- echo " PIPESTATUS: ${PIPESTATUS[@]} "
3433meson_exit_code=${PIPESTATUS[0]}
3534echo " Meson setup exit code: $meson_exit_code "
3635if [ $meson_exit_code -ne 0 ]; then
You can’t perform that action at this time.
0 commit comments