Skip to content

Commit

Permalink
Add unit test summary jobs to sharktank and shortfin workflows. (#695)
Browse files Browse the repository at this point in the history
Progress on #357.

This gives us a single job in each unit test workflow to set as a
"required check" that will block merging, replacing the current single
`Unit Tests (3.11, 2.3.0, ubuntu-24.04)` check:

![image](https://github.com/user-attachments/assets/f8cc1101-606a-44ac-b467-f2d80fc45357)

I'm also switching ci-libshortfin.yml to run on all changes, which is a
requirement for making a check required. We could still conditionally
skip jobs based on paths modified... just not using GitHub's built in
path filtering.
  • Loading branch information
ScottTodd authored Dec 16, 2024
1 parent cfadf2a commit 0660b07
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/ci-libshortfin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -152,3 +146,22 @@ 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(",")' \
)"
if [[ "${FAILED_JOBS}" != "" ]]; then
echo "The following jobs failed: ${FAILED_JOBS}"
exit 1
fi
20 changes: 20 additions & 0 deletions .github/workflows/ci-sharktank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,23 @@ 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(",")' \
)"
if [[ "${FAILED_JOBS}" != "" ]]; then
echo "The following jobs failed: ${FAILED_JOBS}"
exit 1
fi

0 comments on commit 0660b07

Please sign in to comment.