Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kani-version parameter to kani-github-action #44

Closed
wants to merge 14 commits into from
10 changes: 7 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ branding:
color: 'orange'

inputs:
kani-version:
description: 'Kani Version number'
required: false
default: 'latest'
command:
description: 'Command to run.'
required: false
Expand All @@ -36,9 +40,9 @@ runs:
- name: Install Kani
shell: bash
run: |
export KANI_VERSION="0.35.0";
cargo install --version $KANI_VERSION --locked kani-verifier;
cargo-kani setup;
cd "$GITHUB_WORKSPACE"
pwd
./install-kani.sh {{ inputs.kani-version }}

- name: Install PropProof
if: ${{ inputs.enable-propproof == 'true' }}
Expand Down
20 changes: 20 additions & 0 deletions install-kani.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
# Copyright Kani Contributors
# SPDX-License-Identifier: Apache-2.0 OR MIT

# If version is latest, install directly from cargo
if [ "$1" == "latest" ]; then
cargo install --locked kani-verifier;
else
VERSION=$1
cargo install --version $VERSION --locked kani-verifier;
fi

# Check exit status for error handling
if [ $? -ne O ]; then
echo "Error installing Kani. Please check if the provided version is correct"
exit 1
fi

# Setup kani in ci
cargo-kani setup;
Loading