test report formating #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
- potlock-sc | |
pull_request: | |
permissions: | |
checks: write | |
pull-requests: write | |
jobs: | |
contracts: | |
name: Contracts | |
uses: multiversx/mx-sc-actions/.github/workflows/[email protected] | |
with: | |
rust-toolchain: stable | |
enable-contracts-size-report: false | |
secrets: | |
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: Run Tests and Capture Output | |
run: | | |
mkdir -p test-results | |
cargo test -- --format=json > test-results/output.json | |
- name: Generate Summary | |
run: | | |
echo "| Test Name | Result |" >> $GITHUB_STEP_SUMMARY | |
echo "|-----------|--------|" >> $GITHUB_STEP_SUMMARY | |
cat test-results/output.json | jq -r '.test_results[] | "| \(.name) | \(.status) |"' >> $GITHUB_STEP_SUMMARY |