Skip to content

Commit eff5200

Browse files
committed
Add autoharness-analyzer CI job
Run https://github.com/carolynzech/autoharness_analyzer and push its results to the job summary.
1 parent c28334f commit eff5200

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

.github/workflows/kani.yml

+18
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,21 @@ jobs:
7979
.addHeading('Kani List Output', 2)
8080
.addRaw(kaniOutput, false)
8181
.write();
82+
83+
run-autoharness-analyzer:
84+
name: Kani Autoharness Analyzer
85+
runs-on: ubuntu-latest
86+
steps:
87+
# Step 1: Check out the repository
88+
- name: Checkout Repository
89+
uses: actions/checkout@v4
90+
with:
91+
submodules: true
92+
93+
# Step 2: Run autoharness analyzer on the std library
94+
- name: Run Autoharness Analyzer
95+
run: scripts/run-kani.sh --run autoharness-analyzer
96+
97+
# Step 3: Add output to job summary
98+
- name: Add Autoharness Analyzer output to job summary
99+
run: cat autoharness_analyzer/autoharness_data.md >> "$GITHUB_STEP_SUMMARY"

scripts/run-kani.sh

+20-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ usage() {
77
echo "Options:"
88
echo " -h, --help Show this help message"
99
echo " -p, --path <path> Optional: Specify a path to a copy of the std library. For example, if you want to run the script from an outside directory."
10-
echo " --run <verify-std|list|metrics> Optional: Specify whether to run the 'kani verify-std' command, 'kani list' command, or collect Kani-specific metrics. Defaults to 'verify-std' if not specified."
10+
echo " --run <verify-std|list|metrics|autoharness-analyzer> Optional: Specify whether to run the 'kani verify-std' command, 'kani list' command, collect Kani-specific metrics, or summarize autoharness failure reasons. Defaults to 'verify-std' if not specified."
1111
echo " --kani-args <command arguments to kani> Optional: Arguments to pass to the command. Simply pass them in the same way you would to the Kani binary. This should be the last argument."
1212
exit 1
1313
}
@@ -34,7 +34,7 @@ while [[ $# -gt 0 ]]; do
3434
fi
3535
;;
3636
--run)
37-
if [[ -n $2 && ($2 == "verify-std" || $2 == "list" || $2 == "metrics") ]]; then
37+
if [[ -n $2 && ($2 == "verify-std" || $2 == "list" || $2 == "metrics" || $2 == "autoharness-analyzer") ]]; then
3838
run_command=$2
3939
shift 2
4040
else
@@ -317,6 +317,24 @@ main() {
317317
--metrics-file metrics-data-std.json
318318
popd
319319
rm kani-list.json
320+
elif [[ "$run_command" == "autoharness-analyzer" ]]; then
321+
local current_dir=$(pwd)
322+
echo "Running Kani's std-analysis command..."
323+
pushd scripts/kani-std-analysis
324+
./std-analysis.sh $build_dir
325+
popd
326+
echo "Running Kani autoharness codegen command..."
327+
"$kani_path" autoharness -Z autoharness -Z unstable-options --std ./library \
328+
--only-codegen -j --output-format=terse
329+
$unstable_args \
330+
--no-assert-contracts \
331+
$command_args \
332+
--enable-unstable \
333+
--cbmc-args --object-bits 12
334+
echo "Running autoharness-analyzer command..."
335+
git clone https://github.com/carolynzech/autoharness_analyzer
336+
cd autoharness_analyzer
337+
cargo run ../metadata /tmp/std_lib_analysis/results/
320338
fi
321339
}
322340

0 commit comments

Comments
 (0)