-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJustfile
65 lines (53 loc) · 2.02 KB
/
Justfile
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
set windows-shell := ["pwsh", "-NoProfile", "-NoLogo", "-Command"]
rustflags := "-C instrument-coverage"
rustdocflags := rustflags + " -Z unstable-options --persist-doctests target/coverage"
coverage := join(justfile_directory(), "target/coverage/outcome-%p-%m.profraw")
pwd := justfile_directory()
libdir := `rustc --print target-libdir`
bindir := join(parent_directory(libdir), "bin")
rmflags := if os() == "windows" {
"-Recurse -Force -ErrorAction SilentlyContinue"
} else {
"-rf"
}
default: fmt test
@build:
cargo build --no-default-features
cargo build --all-features
@bootstrap:
rustup component add llvm-tools-preview
cargo install cargo-hack cargo-llvm-cov
@clear-reports:
rm {{rmflags}} {{join(justfile_directory(), "target/coverage")}}
@collect type="lcov" $RUSTUP_TOOLCHAIN="nightly": clear-reports coverage
grcov ${PWD}/target/coverage/ \
--source-dir {{pwd}} \
--output-type {{type}} \
--output-path {{ if type == "lcov" { "coverage.info" } else { "target/collected" } }} \
--commit-sha $(git rev-parse HEAD) \
--binary-path {{pwd}}/target/coverage \
--prefix-dir {{pwd}} \
--filter covered \
--branch \
--llvm \
--ignore-not-existing \
--guess-directory-when-missing
coverage $RUSTFLAGS=rustflags $RUSTDOCFLAGS=rustdocflags $LLVM_PROFILE_FILE=coverage:
cargo +nightly test --no-default-features --doc --quiet --profile=coverage
cargo +nightly test --no-default-features --lib --quiet --profile=coverage
cargo +nightly test --all-features --doc --quiet --profile=coverage
cargo +nightly test --all-features --lib --quiet --profile=coverage
@test: coverage
cargo test --no-default-features --doc --quiet
cargo test --no-default-features --lib --quiet
cargo test --all-features --doc --quiet
cargo test --all-features --lib --quiet
@fmt:
@cargo fmt
docs *ARGS:
@cargo +nightly doc {{ARGS}} --all-features
@check:
cargo +nightly clippy --all-features -- -D warnings
@cargo clippy --all-features -- -D warnings
@commit: fmt check docs test
git commit -v --signoff