forked from privacy-scaling-explorations/chiquito
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (26 loc) · 1.31 KB
/
Makefile
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
precommit:
cargo check --all-features
cargo clippy --all-targets --all-features -- -D warnings
cargo fmt --all -- --check
build:
cargo build
maturin develop
test:
# clean test coverage directory
rm -rf ./target/test_coverage
mkdir -p ./target/test_coverage
# install dependencies
rustup component add llvm-tools-preview
curl -sL https://github.com/mozilla/grcov/releases/download/v0.8.10/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - -C "./target/test_coverage"
chmod +x ./target/test_coverage/grcov
# run tests
CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' LLVM_PROFILE_FILE='target/test_coverage/profraw/cargo-test-%p-%m.profraw' cargo test --verbose
# generate html coverage report
./target/test_coverage/grcov . --binary-path ./target/debug/deps/ -s . -t html --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o target/test_coverage/html
# generate lcov coverage report
./target/test_coverage/grcov . --binary-path ./target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o target/test_coverage/tests.lcov
book:
python3 -m venv .env
. .env/bin/activate; pip install -r requirements.txt; maturin develop; pip install jupyter; python -m ipykernel install --user --name=chiquito_kernel
jupyter-book build book
.PHONY: precommit build test book