1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# This file is a template, and might need editing before it works on your project.
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/rust/tags/
image: "rust:1.88.0" # MSRV
stages:
- build
- test
variables:
CARGO_HOME: "$CI_PROJECT_DIR/.cargo"
KANI_HOME: "$CI_PROJECT_DIR/.kani"
cache:
paths:
- .cargo/bin
- .cargo/registry/index
- .cargo/registry/cache
- .cargo/git/db
# Install cargo dependencies
# build:cargo:
# stage: build
# variables:
# CARGO_TARPAULIN_VERSION: "0.12.0"
# script:
# Install tools for code coverage report
# cargo-tarpaulin 0.12.0 requires rustc 1.65, but our MSRV is 1.63, so we disable it for now
# - PATH=.cargo/bin:$PATH
# - 'which cargo-tarpaulin || cargo install cargo-tarpaulin --version "$CARGO_TARPAULIN_VERSION"'
# Use cargo to test the project
test:cargo:
script:
- rustc --version && cargo --version #&& cargo tarpaulin --version # Print version info for debugging
#- cargo tarpaulin -v tarpaulin has a bug, where it segfaults in ci; for now we disable it
- cargo test -v # testing default features
- cargo test --features crossbeam-threads --no-default-features -v # testing optional features
test:kani:
# kani requires rust-nightly
image: rustlang/rust:nightly
script:
- curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
# force install, otherwise ci fails if it is already installed
- cargo install --force --locked kani-verifier --version ~0.64
- cargo kani setup
- cargo kani