diff --git a/.github/workflows/actions.yaml b/.github/workflows/actions.yaml index 5cff3ee..cfd16a0 100644 --- a/.github/workflows/actions.yaml +++ b/.github/workflows/actions.yaml @@ -19,4 +19,24 @@ jobs: rust-toolchain: stable enable-contracts-size-report: false secrets: - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + token: ${{ secrets.GITHUB_TOKEN }} + + summarize-test-results: + name: Summarize Test Results + runs-on: ubuntu-latest + needs: contracts + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Capture Test Output + run: | + mkdir -p test-results + cargo test -- --nocapture > test-results/output.txt + + - name: Generate Summary + run: | + echo "## Test Results" >> $GITHUB_STEP_SUMMARY + echo "| Test Name | Result |" >> $GITHUB_STEP_SUMMARY + echo "|-----------|--------|" >> $GITHUB_STEP_SUMMARY + grep "^test" test-results/output.txt | awk '{print "| " $2 " | " ($3=="ok" ? "passed" : "**FAILED**") " |"}' >> $GITHUB_STEP_SUMMARY