-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci.sh
More file actions
executable file
·39 lines (33 loc) · 754 Bytes
/
ci.sh
File metadata and controls
executable file
·39 lines (33 loc) · 754 Bytes
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
#!/bin/bash
function lint() {
cargo fmt --all -- --check && cargo clippy --all-targets --all-features -- -D warnings \
-D unsafe_code \
-D missing_copy_implementations \
-D trivial_casts \
-D trivial_numeric_casts \
-D unused_extern_crates \
-D unused_import_braces \
-D unused_qualifications \
-D unreachable_pub
}
function test() {
cargo test
}
function build() {
cargo build --release
}
function help() {
echo "Usage: $(basename "$0") [OPTIONS]
Commands:
lint Run lints
test Run all tests
build Build release binaries
help Show help
"
}
if [[ $1 =~ ^(test|build|lint|help)$ ]]; then
"$@"
else
echo "Invalid subcommand '$1'" >&2
exit 1
fi