Skip to content

Property Testings

Property Testings #133

Workflow file for this run

name: Property Testings
on:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
property-testing:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
clarity_version: [1, 2, 3]
name: Clarity::V${{ matrix.clarity_version }} Property Tests
env:
PROPTEST_CASES: 2
steps:
- name: Checkout PR
uses: actions/checkout@v4
- name: Use Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Run Tests
run: |
set +e
cargo nextest run \
--features test-clarity-v${{ matrix.clarity_version }} \
--test wasm-generation \
--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: Create GitHub Issue on Failure
if: ${{ failure() }}
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
gh issue create \
--title "Failure [${GITHUB_WORKFLOW} #${GITHUB_RUN_NUMBER}] Clarity::V${{ matrix.clarity_version }}" \
--label "property-testing-failure" \
--body "GitHub Actions workflow [${GITHUB_WORKFLOW} #${GITHUB_RUN_NUMBER}](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}) Clarity::V${{ matrix.clarity_version }} failed.
\`\`\`log
${{ env.failure_section }}
\`\`\`"
- name: Send message to Slack
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
if: ${{ failure() }}
with:
channel-id: ${{ secrets.CHANNEL_ID }}
payload: |
{
"blocks": [
{
"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."
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}