-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathJustfile
More file actions
130 lines (107 loc) · 2.9 KB
/
Copy pathJustfile
File metadata and controls
130 lines (107 loc) · 2.9 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
# Default to display help menu
default:
@just --list
alias b := build
alias t := test
alias c := clean
alias l := lint
alias book := docs
# Build all
build:
cargo build --workspace
# Build for CI (release mode)
build-ci:
cargo build --workspace --release
# Run tests
test:
cargo test --workspace
# Run tests for CI (using nextest)
test-ci:
cargo nextest run --workspace --exclude edge-e2e
# Fix formatting
format-fix:
cargo +nightly fmt --all
# Check formatting
check-format:
cargo +nightly fmt --all -- --check
# Check clippy
check-clippy:
cargo clippy --workspace -- -D warnings
# Check clippy for CI
check-clippy-ci:
cargo clippy --workspace --all-targets --all-features -- -D warnings
# Check docs
check-docs:
RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps
# Check deny
check-deny:
cargo deny check
# Lint everything
lint: check-format check-clippy check-deny check-docs
# Clean
clean:
cargo clean
# Parse all example contracts with edgec
check-examples:
#!/usr/bin/env bash
set -euo pipefail
failed=0
while IFS= read -r -d '' f; do
echo "parsing $f"
if ! cargo run --bin edgec --quiet -- parse "$f" 2>&1; then
echo "FAILED: $f"
failed=1
fi
done < <(find examples -name '*.edge' -print0 | sort -z)
exit $failed
# Parse all stdlib contracts with edgec
check-stdlib:
#!/usr/bin/env bash
set -euo pipefail
failed=0
while IFS= read -r -d '' f; do
echo "parsing $f"
if ! cargo run --bin edgec --quiet -- parse "$f" 2>&1; then
echo "FAILED: $f"
failed=1
fi
done < <(find std -name '*.edge' -print0 | sort -z)
exit $failed
# Run acceptance tests and update gas snapshot
e2e:
#!/usr/bin/env bash
set -euo pipefail
rm -rf /tmp/edge-gas
cargo test --lib --tests -p edge-e2e
if [ -f /tmp/edge-gas/e2e.csv ]; then
sort /tmp/edge-gas/e2e.csv > crates/e2e/.gas-snapshot
echo "Gas snapshot written to crates/e2e/.gas-snapshot ($(wc -l < crates/e2e/.gas-snapshot) entries)"
fi
# Run acceptance tests for CI and update gas snapshot
e2e-ci:
#!/usr/bin/env bash
set -euo pipefail
rm -rf /tmp/edge-gas
cargo nextest run -p edge-e2e
if [ -f /tmp/edge-gas/e2e.csv ]; then
sort /tmp/edge-gas/e2e.csv > crates/e2e/.gas-snapshot
echo "Gas snapshot written to crates/e2e/.gas-snapshot ($(wc -l < crates/e2e/.gas-snapshot) entries)"
fi
# Run benchmarks
bench:
cargo bench -p edge-bench
# Run benchmarks with a specific filter (e.g., just bench-filter parse)
bench-filter filter:
cargo bench -p edge-bench -- {{filter}}
# Install docs dependencies
docs-install:
npm install
# Serve the Vocs docs site
docs:
npm run docs:dev
# Build the Vocs docs site
docs-build:
npm run docs:build
# Validate docs source and rendered output
docs-validate:
npm run docs:validate