Skip to content

Commit d4bb2cb

Browse files
committed
just: Check feature matrix in check
1 parent f627ccb commit d4bb2cb

File tree

1 file changed

+60
-17
lines changed

1 file changed

+60
-17
lines changed

justfile

Lines changed: 60 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,75 @@
1+
# Default recipe
2+
_default:
3+
@just --list
4+
5+
# ======================== #
6+
# Aliases #
7+
# ======================== #
8+
19
alias b := build
210
alias c := check
11+
alias d := doc
312
alias f := fmt
4-
alias t := test
13+
alias m := msrv
514
alias p := pre-push
15+
alias t := test
616

7-
_default:
8-
@just --list
17+
# ======================== #
18+
# Toolchains #
19+
# ======================== #
20+
21+
# Nightly toolchain
22+
nightly := 'nightly'
23+
24+
# Stable toolchain
25+
stable := 'stable'
26+
27+
# MSRV toolchain
28+
msrv := '1.75.0'
29+
30+
# ======================== #
31+
# Recipes #
32+
# ======================== #
933

1034
# Build the project
1135
build:
12-
cargo build
36+
cargo +{{stable}} build --all-targets
1337

14-
# Check code: formatting, compilation, linting, and commit signature
15-
check:
16-
cargo +nightly fmt --all -- --check
17-
cargo check --all-features --all-targets
18-
cargo clippy --all-features --all-targets -- -D warnings
19-
@[ "$(git log --pretty='format:%G?' -1 HEAD)" = "N" ] && \
20-
echo "\n⚠️ Unsigned commit: BDK requires that commits be signed." || \
21-
true
38+
# Check MSRV
39+
msrv:
40+
cargo +{{msrv}} build --lib --no-default-features
41+
cargo +{{msrv}} build --lib --no-default-features --features "28_0"
42+
cargo +{{msrv}} build --lib --no-default-features --features "29_0"
43+
cargo +{{msrv}} build --lib --no-default-features --features "30_0"
2244

2345
# Format all code
2446
fmt:
25-
cargo +nightly fmt
47+
cargo +{{nightly}} fmt
48+
49+
# Check code: formatting, compilation, linting, and commit signature
50+
check:
51+
@just _verify-head
52+
cargo +{{nightly}} fmt --all -- --check
53+
cargo +{{stable}} check --all-targets --no-default-features
54+
cargo +{{stable}} check --all-targets --no-default-features --features "28_0"
55+
cargo +{{stable}} check --all-targets --no-default-features --features "29_0"
56+
cargo +{{stable}} check --all-targets --no-default-features --features "30_0"
57+
cargo +{{stable}} clippy --all-targets -- -D warnings
2658

27-
# Run all tests on the workspace with all features
59+
# Run all tests on the workspace
2860
test:
29-
cargo test --all-features
61+
cargo +{{stable}} test --no-fail-fast
62+
63+
# Run doctests. Build and check docs
64+
doc:
65+
cargo +{{stable}} test --doc
66+
RUSTDOCFLAGS='-D warnings' cargo +{{stable}} doc --no-deps
3067

31-
# Run pre-push suite: format, check, and test
32-
pre-push: fmt check test
68+
# Run pre-push suite: format, check, test, doc
69+
pre-push: fmt check test doc
70+
71+
# Verify signed commit
72+
_verify-head:
73+
@[ "$(git log --pretty='format:%G?' -1 HEAD)" = "N" ] && \
74+
echo "\n⚠️ Unsigned commit: BDK requires that commits be signed." || \
75+
true

0 commit comments

Comments
 (0)