Skip to content
Merged
10 changes: 10 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,21 @@ jobs:
repository: ["ZestCommunity/ZestCode"]
ref: ["main"]
caller_token: ["${{ github.token }}"]
clone_repo: [true]
expect_error: [false]
include:
# Specific case of setup command failure
- write_job_summary: true
clone_repo: false
expect_error: true

with:
write_job_summary: ${{ matrix.write_job_summary }}
repository: ${{ matrix.repository }}
ref: ${{ matrix.ref }}
caller_token: ${{ matrix.caller_token }}
clone_repo: ${{ matrix.clone_repo }}
expect_error: ${{ matrix.expect_error }}

Upload_Image:
name: Upload Docker Image to ghcr.io Registry
Expand Down
34 changes: 31 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,37 @@ on:
description: Whether to write the artifact URL to the job summary
default: true
type: boolean
clone_repo:
description: Whether to clone the repo
default: true
type: boolean
expect_error:
description: Whether to expect an error
default: false
type: boolean

jobs:
test:
name: "Testing Container: Write Job Summary?${{ inputs.write_job_summary }}"
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Print Inputs
run: |
echo "Inputs(repository): ${{ inputs.repository }}"
echo "Inputs(ref): ${{ inputs.ref }}"
echo "Inputs(caller_token): ${{ inputs.caller_token }}"
echo "Inputs(write_job_summary): ${{ inputs.write_job_summary }}"
echo "Inputs(clone_repo): ${{ inputs.clone_repo }}"
echo "Inputs(expect_error): ${{ inputs.expect_error }}"

- name: Checkout Repository to Test
uses: actions/checkout@v4
if: ${{ inputs.clone_repo }}
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}

- name: Checkout
- name: Checkout Action
uses: actions/checkout@v4
with:
path: ./action/
Expand All @@ -55,6 +73,16 @@ jobs:
- name: Test Action
id: test-action
uses: ./action/
continue-on-error: False
continue-on-error: ${{ inputs.expect_error }}
with:
write_job_summary: ${{ inputs.write_job_summary }}

- name: Check for Failure If Expected
if: ${{ inputs.expect_error }}
run: |
if [ "${{ (steps.test-action.outcome == 'success') }}" == "true" ]; then
echo "Test Action step succeeded when it was expected to fail. Failing job.."
exit 1
else
echo "Test Action step failed as expected."
fi
1 change: 0 additions & 1 deletion build-tools/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ git config --global --add safe.directory /github/workspace
COMPILE_STD_OUTPUT=$(mktemp)
echo "::group::Build Project"
meson setup --cross-file scripts/v5.ini build | tee $COMPILE_STD_OUTPUT
echo "PIPESTATUS: ${PIPESTATUS[@]}"
meson_exit_code=${PIPESTATUS[0]}
echo "Meson setup exit code: $meson_exit_code"
if [ $meson_exit_code -ne 0 ]; then
Expand Down