Skip to content

Commit

Permalink
add logs to slack message
Browse files Browse the repository at this point in the history
  • Loading branch information
BowTiedWoo committed Nov 13, 2024
1 parent dd1cef6 commit b651254
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/scheduled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,20 @@ jobs:

- name: Run Tests
run: |
set +e
cargo nextest run \
--features test-clarity-v${{ matrix.clarity_version }} \
--test wasm-generation \
--test standard
--test standard 2>&1| tee output.log
test_exit=${PIPESTATUS[0]}
cat output.log | sed 's/\x1b\[[0-9;]*[a-zA-Z]//g' | sed 's/\x0//g' > cleaned_output.log
sed -n '/Test failed: assertion/,/FAIL/p' cleaned_output.log >> failure_section.log
echo "failure_section<<EOF" >> $GITHUB_ENV
cat failure_section.log >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
if [ $test_exit -ne 0 ]; then
exit 101
fi
- name: Send message to Slack
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
Expand All @@ -45,7 +55,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "GitHub Actions workflow <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|Property Testing #${{ github.run_number }}> Clarity::V${{ matrix.clarity_version }} failed."
"text": "GitHub Actions workflow <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|Property Testing #${{ github.run_number }}> Clarity::V${{ matrix.clarity_version }} failed.\n\`\`\`${{ env.failure_section }}\`\`\`"
}
}
]
Expand Down

0 comments on commit b651254

Please sign in to comment.