Skip to content

Commit 1f46bc6

Browse files
UnbreakableMJclaude
andcommitted
build: add a justfile mirroring the CI gates
Encodes the exact commands from .github/workflows/ci.yml as `just` recipes so local runs match CI and can't drift: `just fmt`, `clippy` (fresh-isolated target/clippy + -D warnings — the only form that matches the runner), `test`, `headless`, `version-gate`, `deny`, `audit`, with `just ci` running the full set; plus `just fuzz [secs]` (nightly) and `just pqc`. `just --list` shows them all. - README + CHANGELOG note the recipes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 3ed391b commit 1f46bc6

3 files changed

Lines changed: 76 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ range may break in any release.
1010

1111
### Added
1212

13+
- **`justfile` dev gates.** Recipes mirroring CI exactly — `just fmt` / `clippy`
14+
(fresh-isolated `-D warnings`, the only form that matches the runner) / `test`
15+
/ `headless` / `version-gate` / `deny` / `audit`, with `just ci` running the
16+
full set, plus `just fuzz [secs]` and `just pqc`. Encodes the commands from
17+
`.github/workflows/ci.yml` so they can't drift and are one keystroke.
18+
1319
- **`RELEASING.md` + v0.1 status reconcile.** A maintainer checklist for cutting
1420
the `v0.1.0` tag (operational gates → mechanical version bump / CHANGELOG date
1521
/ signed tag), and PRD §11–§12 annotated with each criterion's status. Docs

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ cargo build --release
3434
./target/release/vault --version
3535
```
3636

37+
The CI gates are mirrored in a `justfile`: `just ci` runs fmt / clippy
38+
(CI-exact, fresh-isolated) / test / headless / version-gate / deny / audit
39+
before pushing; `just --list` shows the rest (`just fuzz`, `just pqc`, …).
40+
3741
Headless install (no TUI dependencies; the agent additionally drops the
3842
clipboard's X11/Wayland tree):
3943

justfile

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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

Comments
 (0)