Skip to content

Commit a69c6b4

Browse files
author
Feiyang Liu
committed
integrate SageMaker smoke tests into build and release workflows
1 parent 45f4055 commit a69c6b4

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

.github/workflows/build-targets.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,22 @@ jobs:
9696
name: ${{ github.sha }}-${{ matrix.build-target }}-build
9797
path: ${{ matrix.build-target }}-build.tar.gz
9898
retention-days: 90
99+
smoke-tests:
100+
name: Trigger Smoke Tests
101+
runs-on: ubuntu-latest
102+
needs: build
103+
if: success()
104+
permissions:
105+
actions: write
106+
steps:
107+
- name: Trigger SageMaker smoke tests
108+
env:
109+
GH_TOKEN: ${{ github.token }}
110+
run: |
111+
gh workflow run smoke-tests-sagemaker.yaml \
112+
--repo ${{ github.repository }} \
113+
--ref ${{ github.ref }}
114+
99115
handle-failures:
100116
name: Handle Failures
101117
runs-on: ubuntu-latest

.github/workflows/release.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,34 @@ jobs:
3737
fi
3838
echo "Tag is from a valid branch."
3939
40+
- name: Verify smoke tests passed
41+
run: |
42+
echo "Checking smoke test results for commit $COMMIT_SHA..."
43+
44+
# Find smoke test runs for this commit
45+
RUN_INFO=$(gh run list --workflow=smoke-tests-sagemaker.yaml --json headSha,conclusion,status --limit 50 | \
46+
jq -r --arg sha "$COMMIT_SHA" '.[] | select(.headSha == $sha) | "\(.status) \(.conclusion)"' | head -1)
47+
48+
if [ -z "$RUN_INFO" ]; then
49+
echo "Error: No smoke test run found for commit $COMMIT_SHA"
50+
exit 1
51+
fi
52+
53+
STATUS=$(echo "$RUN_INFO" | cut -d' ' -f1)
54+
CONCLUSION=$(echo "$RUN_INFO" | cut -d' ' -f2)
55+
56+
if [ "$STATUS" != "completed" ]; then
57+
echo "Error: Smoke tests not completed (status: $STATUS)"
58+
exit 1
59+
fi
60+
61+
if [ "$CONCLUSION" != "success" ]; then
62+
echo "Error: Smoke tests failed (conclusion: $CONCLUSION)"
63+
exit 1
64+
fi
65+
66+
echo "Smoke tests passed for commit $COMMIT_SHA"
67+
4068
- name: Download sagemaker artifacts by commit ID
4169
run: |
4270
gh run download --name "$COMMIT_SHA-code-editor-sagemaker-server-build" --name "$COMMIT_SHA-code-editor-sagemaker-server-src"

0 commit comments

Comments
 (0)