-
Notifications
You must be signed in to change notification settings - Fork 11
/
justfile
101 lines (80 loc) · 1.89 KB
/
justfile
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
workspaces := "./packages"
# workspaces := "./packages ./core"
# Displays available recipes by running `just -l`.
setup:
#!/usr/bin/env bash
just -l
install:
# https://crates.io/crates/clippy
rustup component add clippy
# https://crates.io/crates/cargo-llvm-cov
cargo install cargo-llvm-cov
# https://crates.io/crates/cosmwasm-check
cargo install cosmwasm-check
wasm-all:
bash scripts/wasm-out.sh
# Move binding artifacts to teh local nibiru wasmbin
wasm-export:
bash scripts/wasm-export.sh
# Check if a Wasm smart contract binary is ready for the blockchain
wasm-check:
cosmwasm-check artifacts/*.wasm
# Compiles a single CW contract to wasm bytecode.
# wasm-single:
# bash scripts/wasm-out.sh --single
# Runs rustfmt
fmt:
cargo fmt --all
# Runs rustfmt without updating
fmt-check:
cargo fmt --all -- --check
# Compiles Rust code
build:
cargo build
build-update:
cargo update
cargo build
# Clean target files and temp files
clean:
cargo clean
# Run linter + fix
clippy:
cargo clippy --fix --allow-dirty --allow-staged
# Run linter + check only
clippy-check:
cargo clippy
# Test a specific package or contract
test *pkg:
#!/usr/bin/env bash
set -e;
if [ -z "{{pkg}}" ]; then
just test-all
else
RUST_BACKGTRACE="1" cargo test --package "{{pkg}}"
fi
# Test everything in the workspace.
test-all:
cargo test
# Test everything and output coverage report.
test-coverage:
cargo llvm-cov --lcov --output-path lcov.info \
--ignore-filename-regex .*buf\/[^\/]+\.rs$
alias t := tidy
# Format, lint, and test
tidy:
just fmt
just clippy
just wasm-check
just test
# Format, lint, update dependencies, and test
tidy-update: build-update
just tidy
gen-schema:
#!/usr/bin/env bash
for dir in contracts/*/; do
dir_name=$(basename $dir)
echo "Generating schema for $dir"
cd $dir
cargo schema
mv ./schema ../../schema/$dir_name
done