You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.7 KiB

  1. # Runs fuzzing nightly.
  2. name: fuzz-nightly
  3. on:
  4. workflow_dispatch: # allow running workflow manually
  5. schedule:
  6. - cron: '0 3 * * *'
  7. pull_request:
  8. branches: [master]
  9. paths:
  10. - "test/fuzz/**/*.go"
  11. jobs:
  12. fuzz-nightly-test:
  13. runs-on: ubuntu-latest
  14. steps:
  15. - uses: actions/setup-go@v2
  16. with:
  17. go-version: '1.16'
  18. - uses: actions/checkout@v2.3.4
  19. - name: Install go-fuzz
  20. working-directory: test/fuzz
  21. run: go get -u github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-build
  22. - name: Fuzz mempool
  23. working-directory: test/fuzz
  24. run: timeout -s SIGINT --preserve-status 10m make fuzz-mempool
  25. continue-on-error: true
  26. - name: Fuzz p2p-addrbook
  27. working-directory: test/fuzz
  28. run: timeout -s SIGINT --preserve-status 10m make fuzz-p2p-addrbook
  29. continue-on-error: true
  30. - name: Fuzz p2p-pex
  31. working-directory: test/fuzz
  32. run: timeout -s SIGINT --preserve-status 10m make fuzz-p2p-pex
  33. continue-on-error: true
  34. - name: Fuzz p2p-sc
  35. working-directory: test/fuzz
  36. run: timeout -s SIGINT --preserve-status 10m make fuzz-p2p-sc
  37. continue-on-error: true
  38. - name: Fuzz p2p-rpc-server
  39. working-directory: test/fuzz
  40. run: timeout -s SIGINT --preserve-status 10m make fuzz-rpc-server
  41. continue-on-error: true
  42. - name: Archive crashers
  43. uses: actions/upload-artifact@v2
  44. with:
  45. name: crashers
  46. path: test/fuzz/**/crashers
  47. retention-days: 3
  48. - name: Archive suppressions
  49. uses: actions/upload-artifact@v2
  50. with:
  51. name: suppressions
  52. path: test/fuzz/**/suppressions
  53. retention-days: 3
  54. - name: Set crashers count
  55. working-directory: test/fuzz
  56. run: echo "::set-output name=count::$(find . -type d -name 'crashers' | xargs -I % sh -c 'ls % | wc -l' | awk '{total += $1} END {print total}')"
  57. id: set-crashers-count
  58. outputs:
  59. crashers-count: ${{ steps.set-crashers-count.outputs.count }}
  60. fuzz-nightly-fail:
  61. needs: fuzz-nightly-test
  62. if: ${{ needs.fuzz-nightly-test.outputs.crashers-count != 0 }}
  63. runs-on: ubuntu-latest
  64. steps:
  65. - name: Notify Slack if any crashers
  66. uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7
  67. env:
  68. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
  69. SLACK_CHANNEL: tendermint-internal
  70. SLACK_USERNAME: Nightly Fuzz Tests
  71. SLACK_ICON_EMOJI: ':firecracker:'
  72. SLACK_COLOR: danger
  73. SLACK_MESSAGE: Crashers found in Nightly Fuzz tests
  74. SLACK_FOOTER: ''