|
| 1 | +# SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | +# |
| 3 | +# Developer gate recipes mirroring CI (.github/workflows/ci.yml). Run `just ci` |
| 4 | +# before pushing; it runs the same checks the runner does. The toolchain is |
| 5 | +# pinned by rust-toolchain.toml (1.95.0), so these match CI exactly. |
| 6 | + |
| 7 | +# List the recipes. |
| 8 | +default: |
| 9 | + @just --list |
| 10 | + |
| 11 | +# rustfmt check (CI: rustfmt job). |
| 12 | +fmt: |
| 13 | + cargo fmt --all -- --check |
| 14 | + |
| 15 | +# Apply formatting. |
| 16 | +fmt-fix: |
| 17 | + cargo fmt --all |
| 18 | + |
| 19 | +# Clippy, CI-exact: a fresh isolated target dir + -D warnings (a warm cache false-greens). |
| 20 | +clippy: |
| 21 | + rm -rf target/clippy |
| 22 | + RUSTFLAGS="-D warnings" CARGO_TARGET_DIR=target/clippy cargo clippy --workspace --all-targets --all-features -- -D warnings |
| 23 | + |
| 24 | +# Tests (CI: test job; RUSTFLAGS=-D warnings, as the workflow sets globally). |
| 25 | +test: |
| 26 | + RUSTFLAGS="-D warnings" cargo test --workspace --all-targets |
| 27 | + |
| 28 | +# Live HTTP integration tests (#[ignore]d by default; needs network / Vaultwarden — docs/m2-vaultwarden.md). |
| 29 | +test-live: |
| 30 | + cargo test -- --ignored |
| 31 | + |
| 32 | +# Headless builds (CI: headless job): CLI without the TUI, agent without the clipboard tree. |
| 33 | +headless: |
| 34 | + cargo build -p vault-cli --no-default-features --features cli |
| 35 | + cargo build -p vault-agent --no-default-features |
| 36 | + |
| 37 | +# `vault --version` carries the Standard §13.2 attribution block (CI: version-gate job). |
| 38 | +version-gate: |
| 39 | + #!/usr/bin/env bash |
| 40 | + set -euo pipefail |
| 41 | + cargo build --bin vault --release |
| 42 | + out=$(./target/release/vault --version) |
| 43 | + grep -q "Mohamed Hammad <Mohamed.Hammad@SpacecraftSoftware.org>" <<<"$out" |
| 44 | + grep -q "GPL-3.0-or-later" <<<"$out" |
| 45 | + grep -q "https://Vault.SpacecraftSoftware.org/" <<<"$out" |
| 46 | + echo "version-gate: ok" |
| 47 | +
|
| 48 | +# Supply-chain: licenses/bans/advisories/sources (CI: cargo-deny job). |
| 49 | +deny: |
| 50 | + cargo deny check |
| 51 | + |
| 52 | +# Vulnerability advisories (CI: cargo-audit job). Needs `cargo install cargo-audit`. |
| 53 | +audit: |
| 54 | + cargo audit |
| 55 | + |
| 56 | +# EncString fuzz harness (nightly; docs/fuzzing.md). Smoke by default; the v0.1 gate is `just fuzz 86400`. |
| 57 | +fuzz seconds="30": |
| 58 | + cd fuzz && cargo +nightly fuzz run enc_string_parse -- -max_total_time={{seconds}} |
| 59 | + |
| 60 | +# Build the post-quantum transport feature (docs/pqc.md) and run its tests. |
| 61 | +pqc: |
| 62 | + cargo build -p vault-agent --features pqc |
| 63 | + cargo test -p vault-api --features pqc |
| 64 | + |
| 65 | +# Everything the CI runner checks, in order. Run before pushing. |
| 66 | +ci: fmt clippy test headless version-gate deny audit |
0 commit comments