diff --git a/.github/actions/gke-xpk/action.yml b/.github/actions/gke-xpk/action.yml index c4d03c2dc..574e1be33 100644 --- a/.github/actions/gke-xpk/action.yml +++ b/.github/actions/gke-xpk/action.yml @@ -232,10 +232,12 @@ runs: if [ $? -ne 0 ]; then echo "The JobSet ${WORKLOAD_NAME} on ${{ inputs.GKE_CLUSTER }} did not complete as expected " + echo "XPK_EXIT_CODE=1" >> ${GITHUB_ENV} exit 1 fi eval "export ${MAYBE_XPK_EXIT_CODE}" + echo "XPK_EXIT_CODE=${EXIT_CODE}" >> ${GITHUB_ENV} exit ${EXIT_CODE} - name: Clean up JobSet from cluster @@ -268,3 +270,39 @@ runs: if: ${{ always() }} run: | sudo rm -rf ${WORKLOAD_NAME} + + - name: Generate sitrep + id: sitrep + shell: bash -x -e {0} + if: ${{ always() }} + run: | + source .github/workflows/scripts/to_json.sh + badge_label="${{ matrix.test }}" + + summary="${{ inputs.WORKLOAD_NAME_PREFIX }}" + outcome=success + badge_label="${{ inputs.WORKLOAD_NAME_PREFIX }}" + badge_color=brightgreen + + if [ "${XPK_EXIT_CODE}" -gt 0 ]; then + badge_color=red + outcome=failed + summary+=": fail" + else + summary+=": pass" + fi + + to_json summary \ + badge_label \ + badge_color \ + outcome | \ + tee sitrep.json + + - name: Upload sitrep to GitHub Actions from runner + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.WORKLOAD_NAME_PREFIX }}-sitrep + path: | + sitrep.json +