From 644a7d86b9ff542bbafc1309c8af3944589231f6 Mon Sep 17 00:00:00 2001
From: Stefan Zetzsche <120379523+stefan-aws@users.noreply.github.com>
Date: Tue, 13 Aug 2024 09:40:06 +0100
Subject: [PATCH] CompFuzzCI integration (#5682)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
### Description
### How has this been tested?
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).
Co-authored-by: Robin Salkeld
---
.github/workflows/compfuzzci.yaml | 90 +++++++++++++++++++++++++++++++
1 file changed, 90 insertions(+)
create mode 100644 .github/workflows/compfuzzci.yaml
diff --git a/.github/workflows/compfuzzci.yaml b/.github/workflows/compfuzzci.yaml
new file mode 100644
index 0000000000..5541e4ed44
--- /dev/null
+++ b/.github/workflows/compfuzzci.yaml
@@ -0,0 +1,90 @@
+name: CompFuzzCI
+on:
+ pull_request:
+ branches:
+ - master
+ types: [opened, closed, synchronize, reopened]
+ issues:
+ branches:
+ - master
+ types: [opened, closed, reopened]
+
+jobs:
+ FuzzOnPR:
+ if: github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'synchronize') && github.event.pull_request.base.ref == 'master'
+ 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: '5'
+ }
+ })
+ UpdatePRClosed:
+ if: github.event_name == 'pull_request' && 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_pr_close.yaml',
+ ref: 'main',
+ inputs: {
+ pr_number: '${{github.event.number}}'
+ }
+ })
+ UpdateIssueOpened:
+ if: github.event_name == 'issues' && (github.event.action == 'opened' || github.event.action == 'reopened') && github.event.pull_request.base.ref == 'master'
+ 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_name == 'issues' && 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}}'
+ }
+ })
\ No newline at end of file