generated from okp4/template-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.toml
83 lines (69 loc) · 2.13 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
[tasks.format-rust]
args = ["fmt"]
command = "cargo"
description = "Format rust sources files."
install_crate = { rustup_component_name = "rustfmt" }
[tasks.lint-rust-format]
args = ["fmt", "--all", "--", "--check"]
command = "cargo"
description = "Check format of sources files."
install_crate = { rustup_component_name = "rustfmt" }
[tasks.lint-rust]
args = [
"clippy",
"--workspace",
"--locked",
"--all-targets",
"--all-features",
"--",
"-D",
"clippy::all",
"-D",
"warnings",
]
command = "cargo"
description = "Check lint of all sources files."
install_crate = { rustup_component_name = "clippy" }
[tasks.lint-toml]
args = ["lint"]
command = "taplo"
description = "Check lint of all toml files."
install_crate = { crate_name = "taplo-cli", binary = "taplo", test_arg = "--help" }
[tasks.format-toml]
args = ["fmt"]
command = "taplo"
description = "Format toml file"
install_crate = { crate_name = "taplo-cli", binary = "taplo", test_arg = "--help" }
[tasks.lint]
dependencies = ["lint-rust-format", "lint-rust", "lint-toml"]
[tasks.format]
dependencies = ["format-rust", "format-toml"]
[tasks.clean]
args = ["clean"]
command = "cargo"
[tasks.build]
args = ["build", "--release", "--locked"]
command = "cargo"
[tasks.build-coverage]
args = ["build"]
command = "cargo"
description = "Compile the source code and create testable artifacts."
env = { RUSTFLAGS = "-Cinstrument-coverage" }
[tasks.test]
args = ["test", "--tests", "--workspace", "--locked", "--all-features"]
command = "cargo"
dependencies = ["build-coverage", "install-llvm-tools-preview"]
description = "Run all unit tests."
env = { LLVM_PROFILE_FILE = "default_%p.profraw", RUST_BACKTRACE = 1, RUSTFLAGS = "-Cinstrument-coverage" }
[tasks.test-coverage]
dependencies = ["test", "install-grcov"]
script = '''
grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "*cargo*" -o coverage.lcov
'''
[tasks.install-grcov]
install_crate = { crate_name = "grcov" }
[tasks.install-llvm-tools-preview]
install_crate = { rustup_component_name = "llvm-tools-preview" }
[tasks.publish]
args = ["publish", "--token", "${CARGO_API_TOKEN}"]
command = "cargo"