1 parent
27a53c3c6a
commit
47c3cd7f65
2 files changed
+5645
-10
No files matched your search
Generated
+5623
File diff suppressed because it is too large.
Load diff
+22
-10
@@ -4,13 +4,8 @@ set -euo pipefail
|
|||||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
cd "$ROOT"
|
cd "$ROOT"
|
||||||
|
|
||||||
# Cargo.lock is generated only for the locked build/test phase. Keep source releases
|
# Keep Cargo.lock for reproducible application/package builds.
|
||||||
# and the working tree clean so the offline/static gate is repeatable.
|
# Generate it only when missing.
|
||||||
cleanup_lockfile() {
|
|
||||||
rm -f "$ROOT/Cargo.lock"
|
|
||||||
}
|
|
||||||
trap cleanup_lockfile EXIT
|
|
||||||
rm -f "$ROOT/Cargo.lock"
|
|
||||||
|
|
||||||
if ! command -v cargo >/dev/null 2>&1; then
|
if ! command -v cargo >/dev/null 2>&1; then
|
||||||
echo "error: Rust/Cargo is required" >&2
|
echo "error: Rust/Cargo is required" >&2
|
||||||
@@ -35,16 +30,33 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -f Cargo.lock ]]; then
|
if [[ ! -f Cargo.lock ]]; then
|
||||||
|
echo "Cargo.lock not found - generating it..."
|
||||||
cargo generate-lockfile
|
cargo generate-lockfile
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cargo fmt --all
|
cargo fmt --all
|
||||||
cargo fmt --all -- --check
|
cargo fmt --all -- --check
|
||||||
|
|
||||||
cargo test --locked
|
cargo test --locked
|
||||||
cargo clippy --locked --all-targets -- -D warnings
|
|
||||||
cargo build --release --locked
|
cargo clippy \
|
||||||
|
--locked \
|
||||||
|
--all-targets \
|
||||||
|
-- \
|
||||||
|
-D warnings
|
||||||
|
|
||||||
|
cargo build \
|
||||||
|
--release \
|
||||||
|
--locked
|
||||||
|
|
||||||
BIN="$ROOT/target/release/rustbox"
|
BIN="$ROOT/target/release/rustbox"
|
||||||
test -x "$BIN"
|
|
||||||
|
if [[ ! -x "$BIN" ]]; then
|
||||||
|
echo "error: RustBox binary was not produced: $BIN" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
"$BIN" --version
|
"$BIN" --version
|
||||||
|
|
||||||
printf 'Built RustBox: %s\n' "$BIN"
|
printf 'Built RustBox: %s\n' "$BIN"
|
||||||
|
printf 'Cargo.lock retained: %s\n' "$ROOT/Cargo.lock"
|
||||||
Reference in new issue
Block a user