ci: add Kani Rust Verifier #38
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push, pull_request] | |
name: CI | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Run cargo check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
lints: | |
name: Lints | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- name: Run cargo fmt | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
- name: Run cargo clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: -- -D warnings | |
test: | |
name: Test Suite | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Run cargo test | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
kani: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: 'Checkout your code.' | |
uses: actions/checkout@v3 | |
- name: 'Run Kani on your code.' | |
uses: model-checking/kani-github-action@v1.1 | |
grcov: | |
name: Coverage analysis | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Setup cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
key: ${{ runner.os }}-grcov }} | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: llvm-tools-preview | |
- name: Test | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --all-features --no-fail-fast | |
env: | |
CARGO_INCREMENTAL: "0" | |
RUSTFLAGS: "-Cinstrument-coverage" | |
RUSTDOCFLAGS: "-Cinstrument-coverage" | |
- name: Install grcov | |
env: | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: "sparse" | |
run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi | |
- name: Run grcov | |
run: grcov . --binary-path target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o coverage.lcov | |
- name: Upload results to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./coverage.lcov | |
flags: rust | |
fail_ci_if_error: true |