Skip to content

Commit 0660b07

Browse files
authored
Add unit test summary jobs to sharktank and shortfin workflows. (#695)
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.
1 parent cfadf2a commit 0660b07

File tree

2 files changed

+39
-6
lines changed

2 files changed

+39
-6
lines changed

.github/workflows/ci-libshortfin.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,9 @@ name: CI - shortfin
99
on:
1010
workflow_dispatch:
1111
pull_request:
12-
paths:
13-
- '.github/workflows/ci-libshortfin.yml'
14-
- 'shortfin/**'
1512
push:
1613
branches:
1714
- main
18-
paths:
19-
- '.github/workflows/ci-libshortfin.yml'
20-
- 'shortfin/**'
2115

2216
permissions:
2317
contents: read
@@ -152,3 +146,22 @@ jobs:
152146
run: |
153147
ctest --timeout 30 --output-on-failure --test-dir build
154148
pytest -s --durations=10
149+
150+
# Depends on all other jobs to provide an aggregate job status.
151+
ci_libshortfin_summary:
152+
if: always()
153+
runs-on: ubuntu-24.04
154+
needs:
155+
- build-and-test
156+
steps:
157+
- name: Getting failed jobs
158+
run: |
159+
echo '${{ toJson(needs) }}'
160+
FAILED_JOBS="$(echo '${{ toJson(needs) }}' \
161+
| jq --raw-output \
162+
'map_values(select(.result!="success" and .result!="skipped")) | keys | join(",")' \
163+
)"
164+
if [[ "${FAILED_JOBS}" != "" ]]; then
165+
echo "The following jobs failed: ${FAILED_JOBS}"
166+
exit 1
167+
fi

.github/workflows/ci-sharktank.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,3 +191,23 @@ jobs:
191191
run: |
192192
pytest -v sharktank/ -m punet_quick \
193193
--durations=0
194+
195+
# Depends on other jobs to provide an aggregate job status.
196+
# TODO(#584): move test_with_data and test_integration to a pkgci integration test workflow?
197+
ci_sharktank_summary:
198+
if: always()
199+
runs-on: ubuntu-24.04
200+
needs:
201+
- test
202+
steps:
203+
- name: Getting failed jobs
204+
run: |
205+
echo '${{ toJson(needs) }}'
206+
FAILED_JOBS="$(echo '${{ toJson(needs) }}' \
207+
| jq --raw-output \
208+
'map_values(select(.result!="success" and .result!="skipped")) | keys | join(",")' \
209+
)"
210+
if [[ "${FAILED_JOBS}" != "" ]]; then
211+
echo "The following jobs failed: ${FAILED_JOBS}"
212+
exit 1
213+
fi

0 commit comments

Comments
 (0)