-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.58 KB
/
list.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Kani List
on:
workflow_dispatch:
pull_request:
branches: [ main ]
types: [ closed ]
permissions:
pull-requests: write
defaults:
run:
shell: bash
jobs:
run-kani-list-on-std:
name: List Kani harnesses and contracts on std library
runs-on: ${{ matrix.os }}
# Only run this job if the pull request was merged
if: github.event.pull_request.merged == true
strategy:
matrix:
os: [ubuntu-latest]
include:
- os: ubuntu-latest
base: ubuntu
steps:
# Step 1: Check out the repository
- name: Checkout Repository
uses: actions/checkout@v4
with:
path: head
submodules: true
# Step 2: Run list on the std library (assumes it creates kani-list.txt)
- name: Run Kani List
run: head/scripts/run-kani.sh --run list --path ${{github.workspace}}/head
# Step 3: Read kani-list.txt and post comment on PR
- name: Comment PR
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const fs = require('fs');
const kaniOutput = fs.readFileSync('kani_list.txt', 'utf8');
await github.rest.issues.createComment({
issue_number: ${{ github.event.pull_request.number }},
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Kani List Results:\n```\n' + kaniOutput + '\n```'
});
# Step 4: Cleanup
- name: Cleanup
if: always()
run: rm -f kani_list.txt