mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-08 14:21:14 +00:00
The primary aim of this PR is to improve the failure messages we get a little. Seeing the latest commit is often useless, and it's probably better to just get a direct link to a list of commits for that specific branch so we can see what's been committed since the previous nightly run. This PR also makes one minor improvement in the use of the now-deprecated `set-output` syntax for workflows, upgrading it to use the new approach as per https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ --- #### PR checklist - [x] Tests written/updated, or no tests needed - [x] `CHANGELOG_PENDING.md` updated, or no changelog entry needed - [x] Updated relevant documentation (`docs/`) and code comments, or no documentation updates needed
99 lines
3.1 KiB
YAML
99 lines
3.1 KiB
YAML
# Runs fuzzing nightly.
|
|
name: Fuzz Tests
|
|
on:
|
|
workflow_dispatch: # allow running workflow manually
|
|
schedule:
|
|
- cron: '0 3 * * *'
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- "test/fuzz/**/*.go"
|
|
|
|
jobs:
|
|
fuzz-nightly-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version: '1.18'
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install go-fuzz
|
|
working-directory: test/fuzz
|
|
run: go install github.com/dvyukov/go-fuzz/go-fuzz@latest github.com/dvyukov/go-fuzz/go-fuzz-build@latest
|
|
|
|
- name: Fuzz mempool
|
|
working-directory: test/fuzz
|
|
run: timeout -s SIGINT --preserve-status 10m make fuzz-mempool
|
|
continue-on-error: true
|
|
|
|
- name: Fuzz p2p-addrbook
|
|
working-directory: test/fuzz
|
|
run: timeout -s SIGINT --preserve-status 10m make fuzz-p2p-addrbook
|
|
continue-on-error: true
|
|
|
|
- name: Fuzz p2p-pex
|
|
working-directory: test/fuzz
|
|
run: timeout -s SIGINT --preserve-status 10m make fuzz-p2p-pex
|
|
continue-on-error: true
|
|
|
|
- name: Fuzz p2p-sc
|
|
working-directory: test/fuzz
|
|
run: timeout -s SIGINT --preserve-status 10m make fuzz-p2p-sc
|
|
continue-on-error: true
|
|
|
|
- name: Fuzz p2p-rpc-server
|
|
working-directory: test/fuzz
|
|
run: timeout -s SIGINT --preserve-status 10m make fuzz-rpc-server
|
|
continue-on-error: true
|
|
|
|
- name: Archive crashers
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: crashers
|
|
path: test/fuzz/**/crashers
|
|
retention-days: 3
|
|
|
|
- name: Archive suppressions
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: suppressions
|
|
path: test/fuzz/**/suppressions
|
|
retention-days: 3
|
|
|
|
- name: Set crashers count
|
|
working-directory: test/fuzz
|
|
run: echo "count=$(find . -type d -name 'crashers' | xargs -I % sh -c 'ls % | wc -l' | awk '{total += $1} END {print total}')" >> $GITHUB_OUTPUT
|
|
id: set-crashers-count
|
|
|
|
outputs:
|
|
crashers-count: ${{ steps.set-crashers-count.outputs.count }}
|
|
|
|
fuzz-nightly-fail:
|
|
needs: fuzz-nightly-test
|
|
if: ${{ needs.fuzz-nightly-test.outputs.crashers-count != 0 }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Notify Slack on failure
|
|
uses: slackapi/slack-github-action@v1.23.0
|
|
env:
|
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
|
|
BRANCH: ${{ github.ref_name }}
|
|
CRASHERS: ${{ needs.fuzz-nightly-test.outputs.crashers-count }}
|
|
RUN_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
with:
|
|
payload: |
|
|
{
|
|
"blocks": [
|
|
{
|
|
"type": "section",
|
|
"text": {
|
|
"type": "mrkdwn",
|
|
"text": ":skull: Nightly fuzz tests for `${{ env.BRANCH }}` failed with ${{ env.CRASHERS }} crasher(s). See the <${{ env.RUN_URL }}|run details>."
|
|
}
|
|
}
|
|
]
|
|
}
|