Skip to content

Commit c0f79e0

Browse files
committed
Add justfile tooling from rust-psbt
1 parent 7020a73 commit c0f79e0

2 files changed

Lines changed: 56 additions & 0 deletions

File tree

justfile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Once just v1.39.0 is widely deployed, simplify with the `read` function.
2+
NIGHTLY_VERSION := trim(shell('cat "$1"', justfile_directory() / "nightly-version"))
3+
4+
_default:
5+
@just --list
6+
7+
# Install rbmt (Rust Bitcoin Maintainer Tools).
8+
@_install-rbmt:
9+
cargo install --quiet --git https://github.com/rust-bitcoin/rust-bitcoin-maintainer-tools.git --rev $(cat {{justfile_directory()}}/rbmt-version) cargo-rbmt
10+
11+
# Cargo check everything.
12+
check:
13+
cargo check --all --all-targets --all-features
14+
15+
# Cargo build everything.
16+
build:
17+
cargo build --all --all-targets --all-features
18+
19+
# Test everything.
20+
test:
21+
cargo test --all-targets --all-features
22+
23+
# Lint everything.
24+
lint:
25+
cargo +{{NIGHTLY_VERSION}} clippy --all-targets --all-features -- --deny warnings
26+
27+
# Run cargo fmt
28+
fmt:
29+
cargo +{{NIGHTLY_VERSION}} fmt --all
30+
31+
# Generate documentation.
32+
docsrs *flags:
33+
RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" cargo +{{NIGHTLY_VERSION}} doc --all-features {{flags}}
34+
35+
# Update the recent and minimal lock files using rbmt.
36+
[group('tools')]
37+
@update-lock-files: _install-rbmt
38+
rustup run {{NIGHTLY_VERSION}} cargo rbmt lock
39+
40+
# Run CI tasks with rbmt.
41+
[group('ci')]
42+
@ci task toolchain="stable" lock="recent": _install-rbmt
43+
RBMT_LOG_LEVEL=quiet rustup run {{toolchain}} cargo rbmt --lock-file {{lock}} {{task}}
44+
45+
# Test crate.
46+
[group('ci')]
47+
ci-test: (ci "test stable")
48+
49+
# Lint crate.
50+
[group('ci')]
51+
ci-lint: (ci "lint" NIGHTLY_VERSION)
52+
53+
# Bitcoin core integration tests.
54+
[group('ci')]
55+
ci-integration: (ci "integration")

nightly-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nightly-2025-01-21

0 commit comments

Comments
 (0)