-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathJustfile
More file actions
125 lines (124 loc) · 4.24 KB
/
Copy pathJustfile
File metadata and controls
125 lines (124 loc) · 4.24 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
# Ensure rustup-managed nightly cargo is used (system /usr/bin cargo is stable)
export PATH := home_directory() / ".cargo/bin" + ":" + env("PATH", "")
format:
rumdl fmt .
cargo sort -w -g
cargo fmt --all
fix:
rumdl check --fix .
lint:
rumdl check .
cargo sort -w -g -c
cargo fmt --all -- --check
cargo clippy --all -- -D warnings
cargo shear
cargo +nightly workspace-inheritance-check
just check-agents-md
test:
#!/usr/bin/env bash
set -euo pipefail
if [ "$(uname)" = "Darwin" ]; then
cargo nextest run --workspace --all-features
else
cargo nextest run --workspace --all-features
fi
test-full:
#!/usr/bin/env bash
set -euo pipefail
if [ "$(uname)" = "Darwin" ]; then
cargo nextest run --workspace --all-features
else
cargo nextest run --workspace --all-features
fi
test-all: test-full
build-docs:
#!/usr/bin/env bash
set -euo pipefail
if [ "$(uname)" = "Darwin" ]; then
RUSTDOCFLAGS="-D warnings -A rustdoc::private_intra_doc_links" cargo doc --workspace --no-deps --document-private-items
else
RUSTDOCFLAGS="-D warnings -A rustdoc::private_intra_doc_links" cargo doc --workspace --no-deps --document-private-items --all-features
fi
test-coverage:
#!/usr/bin/env bash
set -euo pipefail
if [ "$(uname)" = "Darwin" ]; then
cargo tarpaulin --workspace --timeout 300
else
cargo tarpaulin --all-features --workspace --timeout 300
fi
# Run mutation testing (cargo-mutants) to measure test-suite kill rate
mutate:
#!/usr/bin/env bash
set -euo pipefail
if [ "$(uname)" = "Darwin" ]; then
cargo mutants --workspace
else
cargo mutants --workspace --all-features
fi
# Check that AGENTS.md dependency versions match Cargo.toml
check-agents-md:
#!/usr/bin/env bash
errors=0
while IFS= read -r line; do
crate=$(echo "$line" | sed -n 's/.*`\([^ ]*\) = ".*/\1/p')
agents_ver=$(echo "$line" | sed -n 's/.*"\([^"]*\)".*/\1/p')
if [ -z "$crate" ] || [ -z "$agents_ver" ]; then
continue
fi
cargo_ver=$(grep -E "^${crate} = " Cargo.toml 2>/dev/null | sed -n 's/.*version = "\([^"]*\)".*/\1/p' | head -1)
if [ -z "$cargo_ver" ]; then
cargo_ver=$(grep -E "^${crate} = " Cargo.toml 2>/dev/null | sed -n 's/[^"]*"\([^"]*\)".*/\1/p' | head -1)
fi
if [ -z "$cargo_ver" ]; then
continue
fi
if [ "$agents_ver" != "$cargo_ver" ]; then
echo "MISMATCH: ${crate}: AGENTS.md=${agents_ver} Cargo.toml=${cargo_ver}"
errors=$((errors + 1))
fi
done < <(sed -n '/^## Preferred Dependencies/,/^##/p' AGENTS.md | grep '^\-.*\`.*=.*"')
if [ $errors -gt 0 ]; then
echo "FAIL: ${errors} version mismatch(es) between AGENTS.md and Cargo.toml"
exit 1
fi
echo "OK: AGENTS.md versions match Cargo.toml"
check-feature:
#!/usr/bin/env bash
set -euo pipefail
if [ "$(uname)" = "Darwin" ]; then
cargo check --workspace
else
cargo check --workspace --all-features
fi
check-cn:
rg --line-number --column "\p{Han}"
# Full CI check
ci: lint test-all build-docs
publish:
#!/usr/bin/env bash
set -euo pipefail
VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
echo "Publishing workspace crates v$VERSION..."
echo ""
# Dependency order: hpx-yawc, hpx-h3 → hpx → {hpx-browser, hpx-dl, hpx-emulation, hpx-streams} → {hpxless, hpx-cli}
CRATES="hpx-yawc hpx-h3 hpx hpx-browser hpx-dl hpx-emulation hpx-streams hpxless hpx-cli"
for crate in $CRATES; do
# Check if already published at this version
if cargo search "$crate" --limit 1 2>/dev/null | grep -q "^$crate = \"$VERSION\""; then
echo " ✓ $crate@$VERSION already published, skipping"
continue
fi
echo " Publishing $crate..."
OUTPUT=$(cargo publish -p "$crate" --allow-dirty 2>&1) && RC=0 || RC=$?
if [ $RC -eq 0 ] || echo "$OUTPUT" | grep -qi "already exists"; then
echo " ✓ $crate published (or already exists)"
sleep 30
else
echo " ✗ $crate failed:"
echo "$OUTPUT"
exit 1
fi
done
echo ""
echo "All crates published."