From 6382a70a18c81f21127c8d19ae47fa4eda3debce Mon Sep 17 00:00:00 2001 From: Scott Todd Date: Fri, 13 Dec 2024 11:57:08 -0800 Subject: [PATCH] Add unit test summary jobs to sharktank and shortfin workflows. --- .github/workflows/ci-libshortfin.yml | 26 ++++++++++++++++++++------ .github/workflows/ci-sharktank.yml | 21 +++++++++++++++++++++ 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-libshortfin.yml b/.github/workflows/ci-libshortfin.yml index 1bc1c913f..24a8eb8dc 100644 --- a/.github/workflows/ci-libshortfin.yml +++ b/.github/workflows/ci-libshortfin.yml @@ -9,15 +9,9 @@ name: CI - shortfin on: workflow_dispatch: pull_request: - paths: - - '.github/workflows/ci-libshortfin.yml' - - 'shortfin/**' push: branches: - main - paths: - - '.github/workflows/ci-libshortfin.yml' - - 'shortfin/**' permissions: contents: read @@ -152,3 +146,23 @@ jobs: run: | ctest --timeout 30 --output-on-failure --test-dir build pytest -s --durations=10 + + # Depends on all other jobs to provide an aggregate job status. + ci_libshortfin_summary: + if: always() + runs-on: ubuntu-24.04 + needs: + - build-and-test + steps: + - name: Getting failed jobs + run: | + echo '${{ toJson(needs) }}' + FAILED_JOBS="$(echo '${{ toJson(needs) }}' \ + | jq --raw-output \ + 'map_values(select(.result!="success" and .result!="skipped")) | keys | join(",")' \ + )" + echo "failed-jobs=${FAILED_JOBS}" >> $GITHUB_OUTPUT + if [[ "${FAILED_JOBS}" != "" ]]; then + echo "The following jobs failed: ${FAILED_JOBS}" + exit 1 + fi diff --git a/.github/workflows/ci-sharktank.yml b/.github/workflows/ci-sharktank.yml index 5ee2fbcae..e79cd37b1 100644 --- a/.github/workflows/ci-sharktank.yml +++ b/.github/workflows/ci-sharktank.yml @@ -178,3 +178,24 @@ jobs: run: | pytest -v sharktank/ -m punet_quick \ --durations=0 + + # Depends on other jobs to provide an aggregate job status. + # TODO(#584): move test_with_data and test_integration to a pkgci integration test workflow? + ci_sharktank_summary: + if: always() + runs-on: ubuntu-24.04 + needs: + - test + steps: + - name: Getting failed jobs + run: | + echo '${{ toJson(needs) }}' + FAILED_JOBS="$(echo '${{ toJson(needs) }}' \ + | jq --raw-output \ + 'map_values(select(.result!="success" and .result!="skipped")) | keys | join(",")' \ + )" + echo "failed-jobs=${FAILED_JOBS}" >> $GITHUB_OUTPUT + if [[ "${FAILED_JOBS}" != "" ]]; then + echo "The following jobs failed: ${FAILED_JOBS}" + exit 1 + fi