Skip to content

Commit 4fee1e7

Browse files
committed
ci: Use Justfile as single source of truth for CI commands
Replace inline cargo commands in GHA workflows with `just ci`, `just fuzz-all`, and `just generate-corpus`. This eliminates duplication between the Justfile and the workflow definitions. Also add `cargo test --no-default-features` to the `unit` target and remove `fuzz-all` from the `ci` target (fuzzing runs as a separate GHA job since it requires a nightly toolchain). Assisted-by: OpenCode (Claude Opus)
1 parent ed97396 commit 4fee1e7

3 files changed

Lines changed: 15 additions & 35 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,12 @@ jobs:
4242
uses: dtolnay/rust-toolchain@stable
4343
with:
4444
components: rustfmt, clippy
45+
- name: Install just
46+
uses: extractions/setup-just@v3
4547
- name: Cache Dependencies
4648
uses: Swatinem/rust-cache@v2
47-
- name: cargo fmt (check)
48-
run: cargo fmt -- --check -l
49-
- name: Build
50-
run: cargo build
51-
- name: Test
52-
run: cargo test -- --nocapture --quiet
53-
- name: cargo clippy
54-
run: cargo clippy -- -D warnings
49+
- name: CI (check + test)
50+
run: just ci
5551

5652
msrv:
5753
name: MSRV
@@ -92,22 +88,13 @@ jobs:
9288
uses: dtolnay/rust-toolchain@nightly
9389
- name: Install cargo-fuzz
9490
run: cargo install cargo-fuzz --locked
91+
- name: Install just
92+
uses: extractions/setup-just@v3
9593
- name: Cache Dependencies
9694
uses: Swatinem/rust-cache@v2
9795
with:
9896
workspaces: fuzz
9997
- name: Generate seed corpus
100-
run: cargo run --manifest-path fuzz/Cargo.toml --bin generate-corpus
98+
run: just generate-corpus
10199
- name: Fuzz all targets (2 minutes each)
102-
run: |
103-
mkdir -p fuzz-logs
104-
for target in $(cargo +nightly fuzz list); do
105-
echo "--- Fuzzing $target (2 min) ---"
106-
cargo +nightly fuzz run "$target" -- -max_total_time=120 \
107-
> "fuzz-logs/$target.log" 2>&1 \
108-
&& echo " $target: OK" \
109-
|| { echo "::error::Fuzzer $target failed"; cat "fuzz-logs/$target.log"; exit 1; }
110-
# Print final stats line
111-
tail -1 "fuzz-logs/$target.log"
112-
done
113-
working-directory: fuzz
100+
run: just fuzz-all

.github/workflows/fuzz-extended.yaml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,13 @@ jobs:
2424
uses: dtolnay/rust-toolchain@nightly
2525
- name: Install cargo-fuzz
2626
run: cargo install cargo-fuzz --locked
27+
- name: Install just
28+
uses: extractions/setup-just@v3
2729
- name: Cache Dependencies
2830
uses: Swatinem/rust-cache@v2
2931
with:
3032
workspaces: fuzz
3133
- name: Generate seed corpus
32-
run: cargo run --manifest-path fuzz/Cargo.toml --bin generate-corpus
34+
run: just generate-corpus
3335
- name: Fuzz all targets (15 minutes each)
34-
run: |
35-
mkdir -p fuzz-logs
36-
for target in $(cargo +nightly fuzz list); do
37-
echo "--- Fuzzing $target (15 min) ---"
38-
cargo +nightly fuzz run "$target" -- -max_total_time=900 \
39-
> "fuzz-logs/$target.log" 2>&1 \
40-
&& echo " $target: OK" \
41-
|| { echo "::error::Fuzzer $target failed"; cat "fuzz-logs/$target.log"; exit 1; }
42-
tail -1 "fuzz-logs/$target.log"
43-
done
44-
working-directory: fuzz
36+
run: just fuzz-all 900

Justfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ unit:
1717
else \
1818
cargo test; \
1919
fi
20+
cargo test --no-default-features
2021

2122
# Run cross-language interop tests (requires python3, go)
2223
interop:
@@ -27,8 +28,8 @@ interop:
2728
# Run all tests
2829
test-all: unit interop
2930

30-
# Full CI check (format, lint, test, fuzz)
31-
ci: check unit fuzz-all
31+
# CI check (format, lint, test); see also fuzz-all
32+
ci: check unit
3233

3334
# Run Kani formal verification proofs (install: cargo install --locked kani-verifier && cargo kani setup)
3435
kani:

0 commit comments

Comments
 (0)