-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
131 lines (115 loc) · 4.12 KB
/
justfile
File metadata and controls
131 lines (115 loc) · 4.12 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
131
# SPDX-License-Identifier: PMPL-1.0-or-later
# panic-attack justfile
# Default recipe: build and test
default: build test
# Build release binary
build:
cargo build --release
# Run all tests
test:
cargo test
# Run only the readiness tests (machine-verifiable CRG grades)
readiness:
@echo "Running Component Readiness Grade verification..."
cargo test --test readiness -- --nocapture 2>&1 | tee /tmp/panic-attack-readiness.log
@echo ""
@echo "Results saved to /tmp/panic-attack-readiness.log"
@echo "Grade D tests = component runs without crashing"
@echo "Grade C tests = component produces correct output"
@echo "Grade B tests = edge cases and multi-input support"
# Run readiness tests and summarise pass/fail per grade
readiness-summary:
#!/usr/bin/env bash
set -euo pipefail
echo "=== Component Readiness Grade Verification ==="
echo ""
output=$(cargo test --test readiness 2>&1)
d_pass=$(echo "$output" | grep -c "readiness_d.*ok" || true)
d_fail=$(echo "$output" | grep -c "readiness_d.*FAILED" || true)
c_pass=$(echo "$output" | grep -c "readiness_c.*ok" || true)
c_fail=$(echo "$output" | grep -c "readiness_c.*FAILED" || true)
b_pass=$(echo "$output" | grep -c "readiness_b.*ok" || true)
b_fail=$(echo "$output" | grep -c "readiness_b.*FAILED" || true)
total_pass=$((d_pass + c_pass + b_pass))
total_fail=$((d_fail + c_fail + b_fail))
echo "Grade D (Alpha): $d_pass passed, $d_fail failed"
echo "Grade C (Beta): $c_pass passed, $c_fail failed"
echo "Grade B (RC): $b_pass passed, $b_fail failed"
echo "---"
echo "Total: $total_pass passed, $total_fail failed"
if [ "$total_fail" -eq 0 ]; then
echo ""
echo "All readiness tests pass."
else
echo ""
echo "Some readiness tests failed. Review output above."
exit 1
fi
# Clean build artifacts
clean:
cargo clean
# Install to system
install: build
cp target/release/panic-attack ~/.local/bin/
# Scan self (dogfood)
dogfood:
cargo run --release -- assail .
# Run assemblyline on all repos
assemblyline:
cargo run --release -- assemblyline ~/Documents/hyperpolymath-repos/
# Lint (clippy)
lint:
cargo clippy --all-targets
# Format check
fmt:
cargo fmt -- --check
# Full CI check (fmt + lint + test)
ci: fmt lint test
# Tag and push a release (usage: just release 2.1.0)
release version:
#!/usr/bin/env bash
set -euo pipefail
echo "Preparing release v{{version}}..."
cargo test --verbose
cargo build --release --verbose
echo "Tagging v{{version}}..."
git tag -a "v{{version}}" -m "Release v{{version}}"
echo "Push with: git push origin v{{version}}"
# E2E integration test against VeriSimDB V-lang REST gateway
e2e-verisimdb:
#!/usr/bin/env bash
set -euo pipefail
echo "Running VeriSimDB E2E integration test..."
echo "Gateway: ${VERISIM_API_URL:-http://localhost:9090}"
exec bash tests/verisimdb_e2e.sh
# Generate shell completions for bash, zsh, fish, and nushell
completions: build
#!/usr/bin/env bash
set -euo pipefail
mkdir -p completions
SPDX_AUTHOR="# Author: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>"
SPDX_LIC="# SPDX-License-Identifier: PMPL-1.0-or-later"
echo "Generating shell completions..."
for shell in bash zsh fish nushell; do
case "$shell" in
nushell) out="completions/_panic-attack" ;;
*) out="completions/panic-attack.$shell" ;;
esac
{
echo "$SPDX_LIC"
echo "# panic-attack shell completions for $shell"
echo "# Generated by: panic-attack completions $shell"
echo "$SPDX_AUTHOR"
echo ""
target/release/panic-attack completions "$shell"
} > "$out"
done
echo "Completions written to completions/"
echo " completions/panic-attack.bash"
echo " completions/panic-attack.zsh"
echo " completions/panic-attack.fish"
echo " completions/_panic-attack (nushell)"
# [AUTO-GENERATED] Multi-arch / RISC-V target
build-riscv:
@echo "Building for RISC-V..."
cross build --target riscv64gc-unknown-linux-gnu