|
| 1 | +# Default recipe |
| 2 | +_default: |
| 3 | + @just --list |
| 4 | + |
| 5 | +# ======================== # |
| 6 | +# Aliases # |
| 7 | +# ======================== # |
| 8 | + |
1 | 9 | alias b := build |
2 | 10 | alias c := check |
| 11 | +alias d := doc |
3 | 12 | alias f := fmt |
4 | | -alias t := test |
| 13 | +alias m := msrv |
5 | 14 | alias p := pre-push |
| 15 | +alias t := test |
6 | 16 |
|
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 | +# ======================== # |
9 | 33 |
|
10 | 34 | # Build the project |
11 | 35 | build: |
12 | | - cargo build |
| 36 | + cargo +{{stable}} build --all-targets |
13 | 37 |
|
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" |
22 | 44 |
|
23 | 45 | # Format all code |
24 | 46 | 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 |
26 | 58 |
|
27 | | -# Run all tests on the workspace with all features |
| 59 | +# Run all tests on the workspace |
28 | 60 | 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 |
30 | 67 |
|
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