This repository has been archived by the owner on Dec 4, 2024. It is now read-only.
generated from stacks-network/.github
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile.toml
185 lines (151 loc) · 4.14 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
[config]
# Remove the cargo-make defaults.
skip_core_tasks = true
[env]
# Cargo Make specific env variables
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true # Remove defaults
# Custom env variables
COVERAGE_DIRECTORY = "coverage"
COVERAGE_LCOV = "${COVERAGE_DIRECTORY}/lcov.info"
COVERAGE_HTML_DIR = "${COVERAGE_DIRECTORY}/html"
# Default to using nextest
TEST_FRAMEWORK = "nextest"
[env.github-actions]
# TODO: use nexttest when testing becomes too much to do in series.
# Installing nexttest takes > 5 minutes on github workflow machines.
TEST_FRAMEWORK = "test"
# Installations
# --------------
# NOTE: Performing installations in task dependencies is not the way `cargo-make`
# was intended to be used, but this approach prevents version inconsistencies
# and keeps the individual installation tasks private.
[tasks._install-test-framework]
private = true
condition = { env = { "TEST_FRAMEWORK" = "nextest" } }
install_crate = { crate_name = "cargo-nextest", version = "0.9.57", binary = "cargo", "test_arg" = ["nextest" , "--help"]}
[tasks._install-llvm-cov]
private = true
install_crate = { crate_name = "cargo-llvm-cov", version = "0.5.25", binary = "cargo", "test_arg" = ["llvm-cov" , "--help"]}
[tasks._install-audit]
private = true
install_crate = { crate_name = "cargo-audit", version = "0.18.1", binary = "cargo", "test_arg" = ["audit" , "--help"]}
[tasks.install]
dependencies = [
"_install-test-framework",
"_install-audit",
"_install-llvm-cov",
]
# Formatting
# -----------
[tasks.format-fmt]
install_crate = "rustfmt" # uses the stable version.
command = "cargo"
args = ["fmt", "--check", "--verbose"]
[tasks.format-clippy]
install_crate = "clippy" # uses the stable version.
command = "cargo"
args = ["clippy","--all-features", "--all-targets", "--", "-D", "warnings", "-W", "clippy::all"]
[tasks.format]
dependencies = ["format-clippy", "format-fmt"]
# Code coverage
# ------------------------------------------------------------------------------
# Private tasks ----------------------------------------------------------------
[tasks._coverage-output-clean]
private = true
command = "rm"
args = ["-rf", "${COVERAGE_DIRECTORY}"]
[tasks._make-coverage-output-directory]
private = true
command = "mkdir"
args = ["-p", "${COVERAGE_DIRECTORY}"]
[tasks._calculate-coverage]
private = true
dependencies = [
"_install-llvm-cov",
"_install-test-framework",
]
command = "cargo"
args = [
"llvm-cov",
"${TEST_FRAMEWORK}",
"--all-features",
"--no-report"
]
[tasks._calculated-coverage-clean]
private = true
dependencies = ["_install-llvm-cov"]
args = ["llvm-cov", "clean"]
# Public tasks ----------------------------------------------------------------
[tasks.coverage-clean]
workspace = false
dependencies = [ "_calculated-coverage-clean", "_coverage-output-clean" ]
[tasks.coverage-lcov]
workspace = false
dependencies = [
"_install-llvm-cov",
"_calculate-coverage",
"_make-coverage-output-directory"
]
command = "cargo"
args = [
"llvm-cov",
"report",
"--output-path=${COVERAGE_LCOV}",
"--lcov",
]
[tasks.coverage-html]
workspace = false
dependencies = [
"_install-llvm-cov",
"_calculate-coverage",
"_make-coverage-output-directory"
]
command = "cargo"
args = [
"llvm-cov",
"report",
"--output-dir=${COVERAGE_HTML_DIR}",
"--html",
]
[tasks.coverage-all]
workspace = false
dependencies = ["coverage-lcov", "coverage-html"]
[tasks.coverage]
workspace = false
run_task = "coverage-all"
# Build
# ------
[tasks.cargo-clean]
command = "cargo"
args = ["clean"]
[tasks.release]
command = "cargo"
args = ["build", "--release"]
[tasks.test]
workspace = false
dependencies = ["_install-test-framework"]
command = "cargo"
args = ["${TEST_FRAMEWORK}", "run", "--release"]
[tasks.doc]
command = "cargo"
args = ["doc"]
# Audit
# ------
[tasks.audit]
workspace = false # Audit must run in workspace root.
dependencies = ["_install-audit"]
command = "cargo"
args = ["audit", "-D", "warnings"]
# Workflows
# ----------
[tasks.clean]
dependencies = ["coverage-clean", "cargo-clean"]
[tasks.pr-validation]
dependencies = [
"clean",
"format",
"coverage",
"release",
]
[tasks.default]
run_task = "pr-validation"