Skip to content

Commit

Permalink
CompFuzzCI integration (no forks) (dafny-lang#5697)
Browse files Browse the repository at this point in the history
### Description
<!-- Is this a user-visible change? Remember to update RELEASE_NOTES.md
-->
<!-- Is this a bug fix for an issue visible in the latest release?
Mention this in the PR details and ensure a patch release is considered
-->

### How has this been tested?
<!-- Tests can be added to
`Source/IntegrationTests/TestFiles/LitTests/LitTest/` or to
`Source/*.Test/…` and run with `dotnet test` -->

<small>By submitting this pull request, I confirm that my contribution
is made under the terms of the [MIT
license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
  • Loading branch information
stefan-aws authored and dnezam committed Sep 21, 2024
1 parent eccadb1 commit c564a16
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/compfuzzci_close_pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow is triggered on PR being closed.
# It dispatches workflow on CompFuzzCI repository, where the bugs found in the PR head is discarded from the database.

name: Updating CompFuzzCI on PR Closed
on:
pull_request:
branches:
- master
types: [closed]

jobs:
UpdatePRClosed:
if: github.event.pull_request.base.ref == 'master' && github.event.pull_request.head.repo.owner.login == 'dafny-lang'
runs-on: ubuntu-latest
steps:
- name: Trigger CompFuzzCI
uses: actions/github-script@v7
with:
github-token: ${{ secrets.COMPFUZZCI_PAT }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'CompFuzzCI',
repo: 'DafnyCompilerFuzzer',
workflow_id: 'update_pr_close.yaml',
ref: 'main',
inputs: {
pr_head_ref: '${{github.event.pull_request.head.ref}}'
}
})
32 changes: 32 additions & 0 deletions .github/workflows/compfuzzci_fuzz_no_forks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow is triggered on PR being opened, synced, reopened, closed.
# It dispatches workflow on CompFuzzCI repository, where fuzzing of the PR is handled.

name: Fuzzing on PR (excluding forks)
on:
pull_request:
branches:
- master

jobs:
FuzzOnPR:
if: github.event.pull_request.base.ref == 'master' && github.event.pull_request.head.repo.owner.login == 'dafny-lang'
runs-on: ubuntu-latest
steps:
- name: Trigger CompFuzzCI
uses: actions/github-script@v7
with:
github-token: ${{ secrets.COMPFUZZCI_PAT }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'CompFuzzCI',
repo: 'DafnyCompilerFuzzer',
workflow_id: 'fuzz.yaml',
ref: 'main',
inputs: {
commit: '${{ github.event.pull_request.head.sha }}',
main_commit: '${{github.event.pull_request.base.sha}}',
branch: '${{github.event.pull_request.head.ref}}',
duration: '3600',
instance: '2'
}
})
51 changes: 51 additions & 0 deletions .github/workflows/compfuzzci_process_issues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This workflow is triggered on issue being opened, closed, reopened.
# The CompFuzzCI fuzzer needs to keep track of active issues in the repository to ensure that the fuzzer does not report the same issue multiple times.
# For open and reopen events: It dispatches workflow on CompFuzzCI repository, where the issue is added to the database.
# For close event: It dispatches workflow on CompFuzzCI repository, where the issue is removed from the database.

name: Issue Update for Fuzzer
on:
issues:
branches:
- master
types: [opened, closed, reopened]

jobs:
UpdateIssueOpened:
if: github.event.action == 'opened' || github.event.action == 'reopened'
runs-on: ubuntu-latest
steps:
- name: Trigger CompFuzzCI
uses: actions/github-script@v7
with:
github-token: ${{ secrets.COMPFUZZCI_PAT }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'CompFuzzCI',
repo: 'DafnyCompilerFuzzer',
workflow_id: 'update_issue_open.yaml',
ref: 'main',
inputs: {
issue_number: '${{github.event.issue.number}}',
issuer: '${{github.event.issue.user.login}}',
commit: '${{ github.sha }}'
}
})
UpdateIssueClosed:
if: github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- name: Trigger CompFuzzCI
uses: actions/github-script@v7
with:
github-token: ${{ secrets.COMPFUZZCI_PAT }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'CompFuzzCI',
repo: 'DafnyCompilerFuzzer',
workflow_id: 'update_issue_close.yaml',
ref: 'main',
inputs: {
issue_number: '${{github.event.issue.number}}'
}
})

0 comments on commit c564a16

Please sign in to comment.