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

[ci][kani] Use kani-github-action #472

Merged
merged 7 commits into from
Oct 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 14 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,27 +241,20 @@ jobs:
if: matrix.crate == 'zerocopy' && matrix.features == '--all-features' && matrix.toolchain == 'nightly'

kani:
runs-on: ubuntu-latest
name: Run tests under Kani
needs: generate_cache
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Configure ZC_TOOLCHAIN environment variable
run: |
set -eo pipefail
echo "ZC_TOOLCHAIN=$(./cargo.sh --version nightly)" >> $GITHUB_ENV
- name: Install nigtly Rust toolchain (${{ env.ZC_TOOLCHAIN }})
uses: dtolnay/rust-toolchain@00b49be78f40fba4e87296b2ead62868750bdd83 # stable
with:
toolchain: ${{ env.ZC_TOOLCHAIN }}
- run: |
set -eo pipefail
cargo install --locked kani-verifier
cargo kani setup
RUSTFLAGS="$ZC_NIGHTLY_RUSTFLAGS" ./cargo.sh +nightly kani \
--package zerocopy --all-features --output-format terse --randomize-layout \
--memory-safety-checks --overflow-checks --undefined-function-checks \
--unwinding-checks
on:
pull_request:
push:
jobs:
run-kani:
runs-on: ubuntu-latest
steps:
- name: 'Checkout your code.'
uses: actions/checkout@v3

- name: 'Run Kani on your code.'
uses: model-checking/[email protected]
with:
args: "--package zerocopy --all-features --output-format=terse --randomize-layout --memory-safety-checks --overflow-checks --undefined-function-checks --unwinding-checks"

check_fmt:
runs-on: ubuntu-latest
Expand Down