-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile.toml
100 lines (79 loc) · 2.99 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
# Uses https://github.com/sagiegurari/cargo-make
[config]
# Skip core tasks; they overlap with some of the tasks below
skip_core_tasks = true
[env]
RUSTFLAGS = "--deny warnings"
RUSTDOCFLAGS = "--deny warnings"
# The following differentiates between default features and Serde interoperability feature
# to detect build issues when Serde feature is not enabled
# Default features
[tasks.build-default]
command = "cargo"
args = ["build", "--all-targets"]
[tasks.test-default]
command = "cargo"
# Important: Don't use `--all-targets` here; that would exclude doc tests (see https://github.com/rust-lang/cargo/issues/6669)
# Benchmark tests are performed further below; could include them here for this execution in the future though
args = ["test"]
dependencies = ["build-default"]
# Serde interoperability feature
[tasks.build-serde-interop]
command = "cargo"
args = ["build", "--all-targets", "--features", "serde"]
[tasks.test-serde-interop]
command = "cargo"
# Important: Don't use `--all-targets` here; that would exclude doc tests (see https://github.com/rust-lang/cargo/issues/6669)
# Benchmark tests are performed further below; could include them here for this execution in the future though
args = ["test", "--features", "serde"]
dependencies = ["build-serde-interop"]
# All features
[tasks.build-all-features]
command = "cargo"
args = ["build", "--all-targets", "--all-features"]
[tasks.test-all-features]
command = "cargo"
# Important: Don't use `--all-targets` here; that would exclude doc tests (see https://github.com/rust-lang/cargo/issues/6669)
# Benchmark tests are performed further below; could include them here for this execution in the future though
args = ["test", "--all-features"]
dependencies = ["build-all-features"]
[tasks.test-benches]
command = "cargo"
# Run all benchmarks as tests to make sure they don't encounter any errors, e.g. due to malformed JSON
# Unfortunately this seems to rerun library tests, see https://github.com/rust-lang/cargo/issues/6454
args = ["test", "--benches", "--all-features"]
dependencies = ["test-default", "test-serde-interop", "test-all-features"]
[tasks.build]
dependencies = [
"build-default",
"build-serde-interop",
"build-all-features",
]
[tasks.test]
dependencies = [
"test-default",
"test-serde-interop",
"test-all-features",
"test-benches",
]
# Note: Running Clippy should hopefully suffice, no need to run `cargo check`, see https://stackoverflow.com/q/57449356
[tasks.clippy]
command = "cargo"
args = ["clippy", "--all-targets", "--all-features", "--", "--deny", "warnings"]
[tasks.doc]
command = "cargo"
args = ["doc", "--all-features", "--no-deps"]
[tasks.format-check]
command = "cargo"
args = ["fmt", "--all", "--check"]
# Note: 'default' task is called when `cargo make` is used without explicit task name
[tasks.default]
# Dependencies here are ordered by 'severity'; first fail for build errors and eventually
# fail in case of format check errors
dependencies = [
"build",
"test",
"clippy",
"doc",
"format-check",
]