From a69c6b4e7d3ca699f1d4b8b5916cb6cf374a937f Mon Sep 17 00:00:00 2001 From: Feiyang Liu Date: Tue, 16 Dec 2025 10:13:16 +0100 Subject: [PATCH] integrate SageMaker smoke tests into build and release workflows --- .github/workflows/build-targets.yaml | 16 ++++++++++++++++ .github/workflows/release.yaml | 28 ++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/.github/workflows/build-targets.yaml b/.github/workflows/build-targets.yaml index 3c353f8..5256bbe 100644 --- a/.github/workflows/build-targets.yaml +++ b/.github/workflows/build-targets.yaml @@ -96,6 +96,22 @@ jobs: name: ${{ github.sha }}-${{ matrix.build-target }}-build path: ${{ matrix.build-target }}-build.tar.gz retention-days: 90 + smoke-tests: + name: Trigger Smoke Tests + runs-on: ubuntu-latest + needs: build + if: success() + permissions: + actions: write + steps: + - name: Trigger SageMaker smoke tests + env: + GH_TOKEN: ${{ github.token }} + run: | + gh workflow run smoke-tests-sagemaker.yaml \ + --repo ${{ github.repository }} \ + --ref ${{ github.ref }} + handle-failures: name: Handle Failures runs-on: ubuntu-latest diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8c5cea0..00ba10b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -37,6 +37,34 @@ jobs: fi echo "Tag is from a valid branch." + - name: Verify smoke tests passed + run: | + echo "Checking smoke test results for commit $COMMIT_SHA..." + + # Find smoke test runs for this commit + RUN_INFO=$(gh run list --workflow=smoke-tests-sagemaker.yaml --json headSha,conclusion,status --limit 50 | \ + jq -r --arg sha "$COMMIT_SHA" '.[] | select(.headSha == $sha) | "\(.status) \(.conclusion)"' | head -1) + + if [ -z "$RUN_INFO" ]; then + echo "Error: No smoke test run found for commit $COMMIT_SHA" + exit 1 + fi + + STATUS=$(echo "$RUN_INFO" | cut -d' ' -f1) + CONCLUSION=$(echo "$RUN_INFO" | cut -d' ' -f2) + + if [ "$STATUS" != "completed" ]; then + echo "Error: Smoke tests not completed (status: $STATUS)" + exit 1 + fi + + if [ "$CONCLUSION" != "success" ]; then + echo "Error: Smoke tests failed (conclusion: $CONCLUSION)" + exit 1 + fi + + echo "Smoke tests passed for commit $COMMIT_SHA" + - name: Download sagemaker artifacts by commit ID run: | gh run download --name "$COMMIT_SHA-code-editor-sagemaker-server-build" --name "$COMMIT_SHA-code-editor-sagemaker-server-src"