Skip to content

Property Testings

Property Testings #53

Workflow file for this run

name: Property Testings
on:
schedule:
- cron: "0 */4 * * *"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
property-testing:
name: Property Testing
runs-on: ubuntu-latest
env:
PROPTEST_CASES: 2
steps:
- name: Checkout PR
uses: actions/checkout@v4
- name: Use Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Run
run: |
cargo test --test wasm-generation --test standard | tee test-output.log
if grep -q "FAILED" test-output.log; then
echo "Property test failed. Exiting with code 101."
exit 101
else
echo "Tests passed."
fi
- name: Upload Logs
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: property-testing-logs
path: .clar2wasm/tests/proptest-regressions/test-output.log
# - name: Create GitHub Issue on Failure
# uses: jayqi/failed-build-issue-action@v1
# if: ${{ failure() }}
# with:
# github-token: ${{ secrets.GH_TOKEN }}
# label-name: "property-testing-failure"
# title-template: "Property testing failure"
# body-template: |
# GitHub Actions workflow [{{workflow}} #{{runNumber}}](https://github.com/{{repo.owner}}/{{repo.repo}}/actions/runs/{{runId}}) failed.
- 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 }}> failed."
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
post-failure-details:
name: Post Failure Details
runs-on: ubuntu-latest
needs: property-testing
if: ${{ failure() }}
steps:
- name: Download Logs
uses: actions/download-artifact@v3
with:
name: property-testing-logs
path: ./logs
- name: Read Log Content
id: log-content
run: |
LOG_CONTENT=$(cat ./logs/test-output.log)
echo "log_content=$LOG_CONTENT" >> $GITHUB_ENV
- name: Create GitHub Issue on Failure
uses: jayqi/failed-build-issue-action@v1
with:
github-token: ${{ secrets.GH_TOKEN }}
label-name: "property-testing-failure"
title-template: "Property testing failure"
body-template: |
GitHub Actions workflow [{{workflow}} #{{runNumber}}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) failed.
**Logs**:
```
${{ env.log_content }}
```