diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 1d9bcb1ca..0174b3ff8 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -69,7 +69,7 @@ jobs: - name: Run smoke tests id: tests - run: yarn test:smoke ${{ inputs.jest_pattern && format('--testNamePattern=''{0}''', inputs.jest_pattern) }} + run: yarn test:smoke ${{ inputs.jest_pattern && format('--testNamePattern=''{0}''', inputs.jest_pattern) }} --json --outputFile=jest-report.json - name: Comment results on PR if: failure() && github.event_name == 'pull_request' @@ -106,3 +106,52 @@ jobs: repo: context.repo.repo, body: comment }); + + - name: Write smoke test summary + if: always() && steps.tests.outcome != 'skipped' + uses: runloopai/github-script@main + with: + script: | + const fs = require('fs'); + const env = '${{ inputs.environment }}'; + const outcome = '${{ steps.tests.outcome }}'; + const icon = outcome === 'success' ? '✅' : outcome === 'failure' ? '❌' : '⚠️'; + + let body = '
| Environment | ${env} |
|---|---|
| Status | ${icon} ${outcome} |
| Results | ✅ ${passed} passed ❌ ${failed} failed ⏭️ ${skipped} skipped (${total} total) |
| Duration | ${duration} |
${t.suite} > ${t.name}${t.msg ? ` — ${t.msg.replace(//g,'>')}` : ''}jest-report.json not found — Jest may have failed before generating it.
'; + } + + await core.summary + .addHeading(`${icon} SDK Smoke Tests on \`${env}\``, 2) + .addRaw(body) + .write();