-
Notifications
You must be signed in to change notification settings - Fork 187
Expand file tree
/
Copy pathmise.toml
More file actions
266 lines (235 loc) · 7.24 KB
/
mise.toml
File metadata and controls
266 lines (235 loc) · 7.24 KB
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
[tasks.install]
description = "Installs all Forest binaries with a specified profile."
usage = '''
arg "<profile>" help="Installation profile (quick, release, etc.)" default="release" {
choices "quick" "quick-test" "release" "release-lto-fat" "dev" "debugging" "profiling"
}
flag "--slim" help="Install a slim version"
flag "-v --verbose" help="Enable verbose output"
'''
shell = "bash -c"
run = '''
echo "Installing Forest binaries with profile: ${usage_profile?}"
[[ -n "${usage_verbose}" ]] && set -x
if [ "${usage_slim}" = true ]; then
SLIM_FLAGS="--no-default-features --features slim"
fi
cargo install --profile ${usage_profile} ${SLIM_FLAGS} --locked --path . --force
'''
alias = 'i'
[tasks.install-lint-tools]
description = "Installs linting tools for CI"
tools.cargo-binstall = "latest"
run = "cargo binstall --no-confirm taplo-cli cargo-spellcheck@0.15.7 cargo-deny"
[tasks."lint:deny"]
description = "Run cargo-deny to check for license and security issues."
run = '''
cargo deny check bans licenses sources || (echo "See deny.toml"; false)
'''
[tasks."lint:spellcheck"]
description = "Run cargo-spellcheck to check for spelling errors in Rust code."
run = '''
cargo spellcheck --code 1 || (echo "See .config/spellcheck.md for tips"; false)
'''
[tasks."lint:toml"]
description = "Run taplo-cli to check TOML files."
run = '''
taplo fmt --check
taplo lint
'''
[tasks."lint:rust-fmt"]
description = "Run cargo-fmt to check Rust code formatting."
run = '''
cargo fmt --all -- --check
'''
[tasks."lint:clippy"]
description = "Run cargo-clippy to check Rust code for common mistakes."
run = '''
cargo clippy --all-targets --quiet --no-deps -- --deny=warnings
cargo clippy --all-targets --no-default-features --features slim --quiet --no-deps -- --deny=warnings
cargo clippy --all-targets --no-default-features --quiet --no-deps -- --deny=warnings
cargo clippy --benches --features benchmark-private --quiet --no-deps -- --deny=warnings
# check docs.rs build
DOCS_RS=1 cargo clippy --all-targets --quiet --no-deps -- --deny=warnings
'''
[tasks."lint:unused-deps"]
description = "Check for unused dependencies in Rust code."
tools.ruby = "latest"
run = '''
gem install --no-document toml-rb
ruby scripts/linters/find_unused_deps.rb
'''
[tasks."lint:dockerfile"]
description = "Lint Dockerfiles using hadolint."
tools.hadolint = "latest"
run = '''
hadolint Dockerfile*
'''
[tasks."lint:shellcheck"]
description = "Lint shell scripts using shellcheck."
tools.shellcheck = "latest"
run = '''
shellcheck --external-sources --source-path=SCRIPTDIR **/*.sh
'''
[tasks."lint:golang"]
description = "Lint Go code using golangci-lint."
tools.golangci-lint = "latest"
run = '''
golangci-lint run ./f3-sidecar ./interop-tests/src/tests/go_app
'''
[tasks."lint:ruby"]
description = "Lint Ruby code using rubocop."
tools.ruby = "latest"
tools."gem:rubocop" = "1.58"
run = '''
rubocop scripts/
'''
[tasks.lint]
description = "Run all linting tasks."
depends = ["lint:*"]
[tasks."lint:all-rust"]
description = "Run all Rust linting tasks."
depends = ["lint:deny", "lint:spellcheck", "lint:rust-fmt", "lint:clippy", "lint:unused-deps"]
[tasks."lint:yaml"]
description = "Lint YAML files."
run = '''
pnpm i --frozen-lockfile
pnpm yaml-check
'''
[tasks.format]
description = "Format all supported code."
depends = ["docs:format"]
run = '''
cargo fmt --all
taplo fmt
pnpm i --frozen-lockfile
pnpm md-fmt
pnpm yaml-fmt
'''
alias = "fmt"
[tasks."docs:format"]
description = "Format documentation files."
dir = "docs"
run = '''
pnpm i --frozen-lockfile
pnpm format
'''
[tasks."docs:lint"]
description = "Lint documentation files."
dir = "docs"
run = '''
pnpm i --frozen-lockfile
pnpm generate:rpc-reference
pnpm typecheck
pnpm format-check
'''
[tasks."docs:build"]
description = "Build documentation site."
dir = "docs"
run = '''
pnpm i --frozen-lockfile
pnpm build
'''
[tasks.clean]
description = "Cleanup all build artifacts and dependencies."
run = '''
cargo clean
rm -rf node_modules
'''
[tasks."test:docs"]
# nextest doesn't run doctests https://github.com/nextest-rs/nextest/issues/16
# We need to run them separately.
description = "Run doctests."
run = '''
cargo test --doc --no-default-features --features "test doctest-private cargo-test" --no-fail-fast
'''
[tasks."test:nextest"]
description = "Run Rust unit and integration tests except `cargo-test` group with nextest."
usage = '''
arg "<profile>" help="Build profile (quick-test, dev, etc.)" default="quick-test" {
choices "quick" "quick-test" "release" "dev"
}
'''
run = '''
echo "Running tests with profile: ${usage_profile?}"
cargo nextest run --cargo-profile ${usage_profile?} --workspace --no-default-features --features "test" --no-fail-fast
'''
[tasks."test:cargo"]
description = "Run Rust unit, integration and doc tests of `cargo-test` group with cargo test."
usage = '''
arg "<profile>" help="Build profile (quick-test, dev, etc.)" default="quick-test" {
choices "quick" "quick-test" "release" "dev"
}
'''
run = '''
echo "Running tests with profile: ${usage_profile?}"
cargo test --lib --profile ${usage_profile?} --no-default-features --features "test doctest-private cargo-test" --no-fail-fast -- --test "cargo_test_"
'''
[tasks.test]
description = "Run nextest and cargo-test groups (doctests run via `test:docs`)."
usage = '''
arg "<profile>" help="Build profile (quick-test, dev, etc.)" default="quick-test" {
choices "quick" "quick-test" "release" "dev"
}
'''
run = '''
mise task run test:nextest ${usage_profile?}
mise task run test:cargo ${usage_profile?}
'''
[tasks."codecov:nextest"]
description = "Run codecov with nextest"
run = '''
cargo llvm-cov --no-report nextest --cargo-profile codecov --workspace --no-default-features --features "test" --no-fail-fast
'''
[tasks."codecov:cargo"]
description = "Run codecov with cargo-test"
run = '''
cargo llvm-cov --no-report test -p forest-filecoin --profile codecov --lib --no-default-features --features "test cargo-test" --no-fail-fast -- "cargo_test_"
'''
[tasks."codecov:report"]
description = "Generate merged codecov report"
run = '''
cargo llvm-cov report --profile codecov --codecov --output-path lcov.info
'''
[tasks.codecov]
description = "Generate codecov report"
run = '''
mise task run codecov:nextest
mise task run codecov:cargo
mise task run codecov:report
'''
[tasks."format-spellcheck-dictionary"]
description = "Format and deduplicate the spellcheck dictionary."
run = '''
TMPFILE=$(mktemp)
# Skip first line (word count), sort, deduplicate, then re-add count
tail -n +2 .config/forest.dic | sort --ignore-case | uniq > "$TMPFILE"
COUNT=$(wc -l < "$TMPFILE")
{ echo "$COUNT"; cat "$TMPFILE"; } > .config/forest.dic
rm "$TMPFILE"
'''
[tasks."format-spellcheck-dictionary-check"]
description = "Check if spellcheck dictionary is properly formatted."
run = '''
TMPFILE=$(mktemp)
trap "rm -f $TMPFILE" EXIT
tail -n +2 .config/forest.dic | sort --ignore-case | uniq > "$TMPFILE"
COUNT=$(wc -l < "$TMPFILE")
EXPECTED=$(head -1 .config/forest.dic)
if [ "$COUNT" != "$EXPECTED" ]; then
echo "Word count mismatch: expected $EXPECTED, got $COUNT"
exit 1
fi
tail -n +2 .config/forest.dic | diff - "$TMPFILE"
'''
[tasks.insta]
description = "Update insta snapshots."
run = '''
cargo test --lib -- rpc::tests::openrpc || cargo insta accept
'''
tools.cargo-insta = "1.46"
[tools]
cargo-binstall = "1.17"
go = "1.26"
node = "24"
pnpm = "10"