-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
125 lines (95 loc) · 2.68 KB
/
justfile
File metadata and controls
125 lines (95 loc) · 2.68 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
# https://just.systems
# Show available recipes
default:
@just --list
# ---------- Build ----------
# Build all crates (debug)
build:
cargo build --workspace
# Build all crates (release)
build-release:
cargo build --workspace --release
# Build daemon only (release)
build-daemon:
cargo build -p charond --release
# Build client only (release)
build-client:
cargo build -p charon-tui --release
# ---------- Cross-compile (RP5) ----------
rp5_target := "aarch64-unknown-linux-gnu"
rp5_host := env("RP5_HOST", "charon.local")
# Build for RP5 (uses zigbuild on macOS, native cross on Linux)
build-rp5:
#!/usr/bin/env bash
if [[ "$OSTYPE" == "darwin"* ]]; then
cargo zigbuild --workspace --target {{rp5_target}} --release
else
cargo build --workspace --target {{rp5_target}} --release
fi
# Build daemon for RP5
build-rp5-daemon:
#!/usr/bin/env bash
if [[ "$OSTYPE" == "darwin"* ]]; then
cargo zigbuild -p charond --target {{rp5_target}} --release
else
cargo build -p charond --target {{rp5_target}} --release
fi
# Build client for RP5
build-rp5-client:
#!/usr/bin/env bash
if [[ "$OSTYPE" == "darwin"* ]]; then
cargo zigbuild -p charon-tui --target {{rp5_target}} --release
else
cargo build -p charon-tui --target {{rp5_target}} --release
fi
# Deploy binaries to RP5 (set RP5_HOST env var or defaults to charon.local)
deploy: build-rp5
scp target/{{rp5_target}}/release/charond {{rp5_host}}:~/.local/bin
scp target/{{rp5_target}}/release/charon-tui {{rp5_host}}:~/.local/bin
@echo "Deployed to {{rp5_host}}"
# ---------- Test ----------
# Run unit tests only (fast, no harness)
test:
cargo test --workspace
# Run all tests including integration tests
test-all:
cargo test -p charond --features testing
cargo test -p charon-tui
# Run daemon tests with harness
test-daemon:
cargo test -p charond --features testing
# Run a specific test by name
test-one NAME:
cargo test -p charond --features testing {{NAME}}
# ---------- Quality ----------
# Format code
fmt:
cargo fmt --all
# Check formatting without modifying
fmt-check:
cargo fmt --all -- --check
# Run clippy
clippy:
cargo clippy --workspace -- -D warnings
# Run all checks (fmt + clippy)
check: fmt-check clippy
# ---------- Development ----------
# Watch and run checks on change
watch:
bacon
# Watch and run tests on change
watch-test:
bacon test
# Clean build artifacts
clean:
cargo clean
# Update dependencies
update:
cargo update
# Show dependency tree
deps:
cargo tree
# ---------- CI ----------
# Run full CI pipeline locally
ci: fmt-check clippy test-all
@echo "CI passed!"