diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 4993d52..bfc86a5 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 331feef..d63c274 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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/ @@ -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 diff --git a/build-tools/build.sh b/build-tools/build.sh index 32be56f..2378126 100644 --- a/build-tools/build.sh +++ b/build-tools/build.sh @@ -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