Skip to content

Commit 8fef60f

Browse files
committed
Add autoharness to run-kani script and use in CI
1 parent d97b770 commit 8fef60f

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

.github/workflows/kani.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,33 @@ jobs:
5353
- name: Run Kani Verification
5454
run: head/scripts/run-kani.sh --path ${{github.workspace}}/head
5555

56+
kani-autoharness:
57+
name: Verify std library using autoharness
58+
runs-on: ${{ matrix.os }}
59+
strategy:
60+
matrix:
61+
os: [ubuntu-latest, macos-latest]
62+
include:
63+
- os: ubuntu-latest
64+
base: ubuntu
65+
- os: macos-latest
66+
base: macos
67+
fail-fast: false
68+
69+
steps:
70+
# Step 1: Check out the repository
71+
- name: Checkout Repository
72+
uses: actions/checkout@v4
73+
with:
74+
submodules: true
75+
76+
# Step 2: Run Kani on the std library for selected functions
77+
- name: Run Kani Verification
78+
run: |
79+
scripts/run-kani.sh --kani-args \
80+
--include-pattern alloc::__default_lib_allocator:: \
81+
--jobs=3 --output-format=terse
82+
5683
run-kani-list:
5784
name: Kani List
5885
runs-on: ubuntu-latest

scripts/run-kani.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,15 @@ main() {
297297
--enable-unstable \
298298
--cbmc-args --object-bits 12
299299
fi
300+
elif [[ "$run_command" == "autoharness" ]]; then
301+
# Run verification for all automatically generated harnesses (not in parallel)
302+
echo "Running Kani autoharness command..."
303+
"$kani_path" autoharness -Z autoharness -Z unstable-options --std ./library \
304+
$unstable_args \
305+
--no-assert-contracts \
306+
$command_args \
307+
--enable-unstable \
308+
--cbmc-args --object-bits 12
300309
elif [[ "$run_command" == "list" ]]; then
301310
echo "Running Kani list command..."
302311
"$kani_path" list -Z list $unstable_args ./library --std --format markdown

0 commit comments

Comments
 (0)