-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.toml
92 lines (78 loc) · 2.81 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
[env]
CFG_LOOM = "--cfg loom"
CLIPPY_FLAGS = "-D clippy::pedantic -D clippy::nursery"
CLIPPY_FLAGS_LOOM = "${CFG_LOOM} ${CLIPPY_FLAGS}"
# Don't run these tasks for all crates in the workspace.
[config]
default_to_workspace = false
# Build package for no_std environment.
[tasks.no-std]
command = "cargo"
args = ["hack", "build", "--target", "thumbv7m-none-eabi", "--feature-powerset",
"--no-dev-deps", "--skip", "yield,thread_local"]
# Build docs for docs.rs.
[tasks.docsrs]
toolchain = "nightly"
command = "cargo"
env = { "RUSTDOCFLAGS" = "--cfg docsrs" }
args = ["rustdoc", "--all-features", "--open", "--", "--default-theme", "ayu"]
# Check MSRV.
[tasks.msrv]
# NOTE: We are actually installing the first nightly 1.66.0. It should be
# equivalent to stable 1.65.0. We need the nightly version to use the sparse
# registry feature. This massively improves the index download.
# Link: https://blog.rust-lang.org/2022/06/22/sparse-registry-testing.html
toolchain = "nightly-2022-09-18"
command = "cargo"
env = { "CARGO_UNSTABLE_SPARSE_REGISTRY" = "true" }
args = ["check", "--all-features"]
# Check semver viloations.
[tasks.semver]
command = "cargo"
args = ["semver-checks", "${@}"]
# Run all documentation snippets.
[tasks.doc-test]
command = "cargo"
args = ["test", "--doc", "--all-features"]
# Lint all feature combinations with cargo-hack.
[tasks.lint]
command = "cargo"
env = { "RUSTFLAGS" = "${CLIPPY_FLAGS}" }
args = ["hack", "clippy", "--feature-powerset", "--no-dev-deps"]
# Run example.
[tasks.example]
command = "cargo"
env = { "RUSTFLAGS" = "${CLIPPY_FLAGS}" }
args = ["run", "--example", "${@}", "--all-features"]
# Lint all feature combinations with carg-hack on test profile.
[tasks.test-lint]
command = "cargo"
env = { "RUSTFLAGS" = "${CLIPPY_FLAGS}" }
args = ["hack", "clippy", "--profile", "test", "--feature-powerset",
"--no-dev-deps"]
# Run tests under miri.
# NOTE: must run as: `cargo +nightly make miri`.
[tasks.miri-test]
toolchain = "nightly"
install_crate = { rustup_component_name = "miri" }
command = "cargo"
args = ["miri", "nextest", "run", "--all-features", "${@}"]
# Check code coverage with tarpaulin (all features).
[tasks.tarpaulin]
command = "cargo"
args = ["tarpaulin", "--all-features", "--engine", "llvm", "--out", "xml"]
# Run Loom tests.
[tasks.loom-test]
command = "cargo"
env = { "RUSTFLAGS" = "${CFG_LOOM}" }
args = ["test", "--lib", "--release", "--all-features", "${@}"]
# Check Loom cfg (faster if using the same flags for rust-analyzer).
[tasks.loom-check]
command = "cargo"
env = { "RUSTFLAGS" = "${CFG_LOOM}" }
args = ["check", "--profile", "test", "--all-features"]
# Lint all feature combinations with cargo-hack on test profile and Loom cfg.
[tasks.loom-lint]
command = "cargo"
env = { "RUSTFLAGS" = "${CLIPPY_FLAGS_LOOM}" }
args = ["hack", "clippy", "--profile", "test", "--feature-powerset"]