-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathjustfile
More file actions
85 lines (69 loc) · 2.33 KB
/
justfile
File metadata and controls
85 lines (69 loc) · 2.33 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
# A2A Rust SDK — build toolchain
# See https://just.systems for installation
# Default recipe: build + test
default: build test
# Build all workspace crates
build:
cargo build --workspace
# Build in release mode
build-release:
cargo build --workspace --release
# Run all tests
test:
cargo test --workspace
# Run tests with output shown
test-verbose:
cargo test --workspace -- --nocapture
# Run clippy lints
lint:
cargo clippy --workspace --all-targets -- -D warnings
# Check formatting
fmt-check:
cargo fmt --all -- --check
# Apply formatting
fmt:
cargo fmt --all
# Run all checks (format, lint, test)
check: fmt-check lint test
# Generate code coverage report (requires cargo-llvm-cov)
coverage:
rustup component add llvm-tools-preview --toolchain stable
rustup run stable cargo llvm-cov --workspace --html --ignore-filename-regex 'gen/'
@echo "Coverage report: target/llvm-cov/html/index.html"
# Generate LCOV coverage output for CI uploads
coverage-lcov:
mkdir -p coverage
rustup component add llvm-tools-preview --toolchain stable
rustup run stable cargo llvm-cov --workspace --no-report --ignore-filename-regex 'gen/'
rustup run stable cargo llvm-cov report --lcov --output-path coverage/lcov.info --ignore-filename-regex 'gen/'
rm -rf target/llvm-cov/html
rustup run stable cargo llvm-cov report --html --output-dir target/llvm-cov --ignore-filename-regex 'gen/'
@echo "LCOV report: coverage/lcov.info"
@echo "Coverage report: target/llvm-cov/html/index.html"
# Run the helloworld example
example:
cargo run -p helloworld
# Clean build artifacts
clean:
cargo clean
# Check that the project compiles without producing binaries
check-compile:
cargo check --workspace
# Verify copyright headers on all Rust source files
check-headers:
#!/usr/bin/env bash
set -euo pipefail
missing=0
for f in $(find . -name '*.rs' -not -path '*/gen/*' -not -path '*/target/*'); do
if ! head -1 "$f" | grep -q '^// Copyright AGNTCY'; then
echo "Missing header: $f"
missing=$((missing + 1))
fi
done
if [ "$missing" -gt 0 ]; then
echo "ERROR: $missing file(s) missing copyright header"
exit 1
fi
echo "All source files have copyright headers"
# Run all CI checks
ci: check-compile check-headers fmt-check lint test