Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 41 additions & 12 deletions .github/workflows/formal-aggregate.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,41 @@
name: Formal Reports Aggregate

on:
pull_request:
types: [opened, synchronize, reopened, labeled]
paths-ignore:
- 'docs/**'
- '**/*.md'
workflow_call:
inputs:
source_run_id:
description: "Workflow run id to download artifacts from"
required: false
type: string
pr_number:
description: "Pull request number to comment on"
required: false
type: string
secrets:
GITHUB_TOKEN:
required: false
workflow_dispatch:
inputs:
source_run_id:
description: "Workflow run id to download artifacts from"
required: false
type: string
pr_number:
description: "Pull request number to comment on"
required: false
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ inputs.pr_number || github.ref }}
cancel-in-progress: true

permissions: read-all
permissions:
contents: read
actions: read
issues: write

jobs:
aggregate:
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork && contains(github.event.pull_request.labels.*.name, 'run-formal'))
if: github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call'
runs-on: ubuntu-latest
continue-on-error: true
steps:
Expand All @@ -28,6 +48,8 @@ jobs:
uses: actions/download-artifact@v4
with:
path: artifacts_dl
run-id: ${{ inputs.source_run_id != '' && inputs.source_run_id || github.run_id }}
github-token: ${{ secrets.GITHUB_TOKEN || github.token }}
- name: Aggregate formal reports
id: agg
run: |
Expand Down Expand Up @@ -269,20 +291,27 @@ jobs:
run: |
node scripts/formal/validate-conformance-summary.mjs || true
- name: Comment on PR (upsert)
if: github.event_name == 'pull_request'
if: (github.event_name == 'workflow_call' || github.event_name == 'workflow_dispatch') && inputs.pr_number != ''
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const header = '<!-- AE-FORMAL-AGGREGATE -->\n';
const body = header + fs.readFileSync('artifacts/formal/formal-aggregate.md','utf-8');
const { owner, repo, number } = context.issue;
const comments = await github.rest.issues.listComments({ owner, repo, issue_number: number, per_page: 100 });
const { owner, repo } = context.repo;
const issue_number = Number(process.env.PR_NUMBER || 0);
if (!issue_number) {
core.info('PR number not provided; skipping comment.');
return;
}
const comments = await github.rest.issues.listComments({ owner, repo, issue_number, per_page: 100 });
const mine = comments.data.find(c => c.body && c.body.startsWith('<!-- AE-FORMAL-AGGREGATE -->'));
if (mine && mine.body === body) {
core.info('Aggregate unchanged; skipping update');
} else if (mine) {
await github.rest.issues.updateComment({ owner, repo, comment_id: mine.id, body });
} else {
await github.rest.issues.createComment({ owner, repo, issue_number: number, body });
await github.rest.issues.createComment({ owner, repo, issue_number, body });
}
env:
PR_NUMBER: ${{ inputs.pr_number }}
19 changes: 19 additions & 0 deletions .github/workflows/formal-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,22 @@ jobs:
with:
name: formal-reports-kani
path: hermetic-reports/formal/kani-summary.json

formal-aggregate:
name: Formal Reports Aggregate
needs:
- verify-conformance
- verify-alloy
- verify-tla
- verify-smt
Comment thread
ootakazuhiko marked this conversation as resolved.
- verify-apalache
- verify-kani
if: always() && ((github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork && contains(github.event.pull_request.labels.*.name, 'run-formal')) || github.event_name == 'workflow_dispatch')
uses: ./.github/workflows/formal-aggregate.yml
permissions:
contents: read
actions: read
issues: write
with:
source_run_id: ${{ github.run_id }}
pr_number: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || '' }}
Loading