-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.toml
112 lines (95 loc) · 3.76 KB
/
Makefile.toml
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
[tasks.clean-all]
script = """
cargo clean
rm -rf profraw
"""
[tasks.create-profraw-dir]
command = "mkdir"
args = ["-p", "./profraw"]
[tasks.install-stable]
ignore_errors = true
command = "rustup"
args = ["toolchain", "install", "stable", "--component", "llvm-tools-preview"]
[tasks.build-stable]
install_crate = false
dependencies = ["install-stable"]
command = "cargo"
args = ["+stable", "build", "--target", "x86_64-unknown-linux-musl"]
[tasks.build-stable.env]
RUSTFLAGS="-Cinstrument-coverage"
LLVM_PROFILE_FILE="profraw/hoard-python-test-%p-%m.profraw"
[tasks.deny]
command = "cargo"
args = ["deny", "check"]
[tasks.test-nextest]
dependencies = ["clean-all", "install-stable", "create-profraw-dir"]
command = "cargo"
args = ["nextest", "run"]
[tasks.test-nextest.env]
RUSTFLAGS="-Cinstrument-coverage -Copt-level=0 -Ccodegen-units=1"
LLVM_PROFILE_FILE="profraw/hoard-cargo-test-%p-%m.profraw"
[tasks.test-single-thread]
install_crate = false
dependencies = ["clean-all", "install-stable", "create-profraw-dir"]
command = "cargo"
args = ["+stable", "test", "--", "--test-threads=1"]
[tasks.test-single-thread.env]
RUSTFLAGS="-Cinstrument-coverage -Copt-level=0 -Ccodegen-units=1"
LLVM_PROFILE_FILE="profraw/hoard-cargo-test-%p-%m.profraw"
[tasks.docker-tests]
dependencies = ["clean-all", "create-profraw-dir"]
script = """
sudo docker image build . -t hoard-tests --no-cache
echo "Running tests"
sudo docker container run --rm -v $(pwd)/profraw:/hoard-tests/profraw:Z hoard-tests
echo "Ran tests"
"""
[tasks.test-all]
# Do docker tests first so ./target is not sent to Docker
dependencies = ["docker-tests", "test-nextest"]
[tasks.grcov]
install_crate = { crate_name = "grcov" }
dependencies = ["clean-all", "test-all"]
# Using `script` is necessary to get the glob expansion
script = """
grcov profraw/*.profraw --binary-path ./target/debug \
-s . -t html --branch --ignore-not-existing -o ./target/debug/coverage --ignore src/main.rs \
--excl-br-line "($EXCLUDE_DERIVE|$EXCLUDE_PANICS|$EXCLUDE_TRACING|$EXCLUDE_PROPAGATE_ERROR|$EXCLUDE_MANUAL|$EXCLUDE_LONE_CLOSING_BRACE)" \
--excl-line "($EXCLUDE_DERIVE|$EXCLUDE_PANICS|$EXCLUDE_TRACING|$EXCLUDE_PROPAGATE_ERROR|$EXCLUDE_MANUAL|$EXCLUDE_LONE_CLOSING_BRACE)" \
--excl-br-start "(grcov: ignore-start|mod tests)" --excl-start "(grcov: ignore-start|mod tests)" \
--excl-br-stop "grcov: ignore-end" --excl-stop "grcov: ignore-end"
"""
[tasks.grcov.env]
RUSTFLAGS="-Cinstrument-coverage"
RUSTUP_TOOLCHAIN="stable"
HOARD_LOG="trace"
EXCLUDE_DERIVE="#\\[derive\\("
EXCLUDE_PANICS="panic!|todo!|unimplemented!|unreachable!"
EXCLUDE_TRACING="kjhgfdsadgjkl" #tracing::(error|warn|info|debug|trace)(_span)?!"
EXCLUDE_PROPAGATE_ERROR="(return|(Err\\(err(or)?\\)|err(or)?) =>) (Some\\()?Err\\(err(or)?(\\.into\\(\\))?\\)"
EXCLUDE_MANUAL="grcov: ignore"
EXCLUDE_LONE_CLOSING_BRACE="^\\s*\\}\\s*$"
[tasks.view-grcov]
dependencies = ["clean-all", "grcov"]
command = "xdg-open"
args = ["./target/debug/coverage/index.html"]
[tasks.book]
command = "mdbook"
args = ["serve", "./book"]
[tasks.outdated]
command = "cargo"
args = ["outdated", "-R"]
[tasks.deadlinks]
command = "cargo"
args = ["deadlinks"]
[tasks.check-all]
dependencies = ["clippy", "check-format", "docs", "test-nextest", "deadlinks", "deny", "msrv-verify"]
[tasks.changelog]
command = "git-cliff"
args = ["-o", "CHANGELOG.md"]
[tasks.msrv]
command = "cargo"
args = ["msrv"]
[tasks.msrv-verify]
command = "cargo"
args = ["msrv", "verify"]