Skip to content

Commit 16a155a

Browse files
authored
Kani Workflow Updates (#214)
Update the `kani list` part of our workflow to: - Be its own step of the workflow so it can run in parallel, which is nice because it finishes much faster than the other jobs in the Kani workflow - Use the new markdown format. This makes the list much more readable (compare [current format](https://github.com/model-checking/verify-rust-std/actions/runs/12199714877/attempts/2#summary-34034201022) to [markdown format](https://github.com/carolynzech/verify-rust-std/actions/runs/12203155221/attempts/1#summary-34045490103)). Also remove the Test Kani workflow step, because it's expensive and duplicates verification work.
1 parent 6928d22 commit 16a155a

File tree

2 files changed

+12
-27
lines changed

2 files changed

+12
-27
lines changed

.github/workflows/kani.yml

+11-26
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,10 @@ jobs:
3838
# Step 2: Run Kani on the std library (default configuration)
3939
- name: Run Kani Verification
4040
run: head/scripts/run-kani.sh --path ${{github.workspace}}/head
41-
42-
test-kani-script:
43-
name: Test Kani script
44-
runs-on: ${{ matrix.os }}
45-
strategy:
46-
matrix:
47-
os: [ubuntu-latest, macos-latest]
48-
include:
49-
- os: ubuntu-latest
50-
base: ubuntu
51-
- os: macos-latest
52-
base: macos
41+
42+
run-kani-list:
43+
name: Kani List
44+
runs-on: ubuntu-latest
5345
steps:
5446
# Step 1: Check out the repository
5547
- name: Checkout Repository
@@ -58,25 +50,18 @@ jobs:
5850
path: head
5951
submodules: true
6052

61-
# Step 2: Test Kani verification script with specific arguments
62-
- name: Test Kani script (Custom Args)
63-
run: head/scripts/run-kani.sh -p ${{github.workspace}}/head --kani-args --harness ptr --output-format=terse
64-
65-
# Step 3: Test Kani verification script in the repository directory
66-
- name: Test Kani script (In Repo Directory)
67-
working-directory: ${{github.workspace}}/head
68-
run: scripts/run-kani.sh --kani-args --harness ptr::verify::check_read_u128 --harness ptr --output-format=terse
69-
70-
# Step 4: Run list on the std library and add output to job summary
53+
# Step 2: Run list on the std library
7154
- name: Run Kani List
7255
run: head/scripts/run-kani.sh --run list --path ${{github.workspace}}/head
73-
56+
57+
# Step 3: Add output to job summary
7458
- name: Add Kani List output to job summary
7559
uses: actions/github-script@v6
7660
with:
7761
script: |
7862
const fs = require('fs');
79-
const kaniOutput = fs.readFileSync('${{github.workspace}}/head/kani_list.txt', 'utf8');
63+
const kaniOutput = fs.readFileSync('${{github.workspace}}/head/kani-list.md', 'utf8');
8064
await core.summary
81-
.addRaw(kaniOutput)
82-
.write();
65+
.addHeading('Kani List Output', 2)
66+
.addRaw(kaniOutput, false)
67+
.write();

scripts/run-kani.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ main() {
221221
--cbmc-args --object-bits 12
222222
elif [[ "$run_command" == "list" ]]; then
223223
echo "Running Kani list command..."
224-
"$kani_path" list -Z list -Z function-contracts -Z mem-predicates -Z float-lib ./library --std > $path/kani_list.txt
224+
"$kani_path" list -Z list -Z function-contracts -Z mem-predicates -Z float-lib ./library --std --format markdown
225225
fi
226226
}
227227

0 commit comments

Comments
 (0)