Skip to content

Commit e66b6d4

Browse files
committed
Merge #540: ci: migrate GitHub Actions to cargo rbmt
0e2d336 ci: rename misspelled lint script (Renato Britto) 569b87e bitreq: cfg-gate std-only URL helpers (Renato Britto) f3606c2 ci: switch GitHub Actions to cargo rbmt (Renato Britto) 58e9248 ci: add rbmt metadata and lint configuration (Renato Britto) Pull request description: Fixes #538 This PR migrates the CI workflow from the maintainer-tools shell entrypoints to cargo rbmt, joins Stable/Nightly/MSRV test jobs into a single toolchain/lockfile matrix and makes the supporting library changes needed for checks to pass cleanly. Summary: - gate async TLS code on the async feature in bitreq - fix the `webpki-roots` cfg name in bitreq - add workspace and per-crate rbmt metadata - migrate `rust.yaml` to cargo rbmt - rename `lint-integtation-tests.sh` to `lint-integration-tests.sh` ACKs for top commit: tnull: ACK 0e2d336 tcharding: ACK 0e2d336 luisschwab: ACK 0e2d336 Tree-SHA512: df4ca8351e3373198edd581790e9f041d303a88c06b267f542f77226e43ca97b3af96ba39223f1cf2ab36678f904cb2bdbbbbdc3c03182a7433d6434b7f7323d
2 parents bf5d24e + 0e2d336 commit e66b6d4

10 files changed

Lines changed: 90 additions & 133 deletions

File tree

.github/workflows/rust.yaml

Lines changed: 35 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -9,93 +9,30 @@ on: # yamllint disable-line rule:truthy
99
name: Continuous integration
1010

1111
jobs:
12-
Prepare:
13-
runs-on: ubuntu-slim
14-
outputs:
15-
nightly_version: ${{ steps.read_toolchain.outputs.nightly_version }}
16-
steps:
17-
- name: "Checkout repo"
18-
uses: actions/checkout@v4
19-
- name: "Read nightly version"
20-
id: read_toolchain
21-
run: echo "nightly_version=$(cat nightly-version)" >> $GITHUB_OUTPUT
22-
23-
Stable: # 2 jobs, one per lock file.
24-
name: Test - stable toolchain
12+
Test: # 6 jobs: 3 toolchains × 2 lock files.
13+
name: Test - ${{ matrix.toolchain }} toolchain (${{ matrix.dep }})
2514
runs-on: ubuntu-latest
2615
strategy:
2716
fail-fast: false
2817
matrix:
2918
dep: [minimal, recent]
19+
toolchain: [stable, nightly, msrv]
3020
steps:
3121
- name: "Checkout repo"
3222
uses: actions/checkout@v4
33-
- name: "Checkout maintainer tools"
34-
uses: actions/checkout@v4
35-
with:
36-
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
37-
ref: c3324024ced9bb1eb854397686919c3ff7d97e1e
38-
path: maintainer-tools
39-
- name: "Select toolchain"
40-
uses: dtolnay/rust-toolchain@stable
41-
- name: "Set dependencies"
42-
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
43-
- name: "Run test script"
44-
run: ./maintainer-tools/ci/run_task.sh stable
45-
46-
Nightly: # 2 jobs, one per lock file.
47-
name: Test - nightly toolchain
48-
needs: Prepare
49-
runs-on: ubuntu-latest
50-
strategy:
51-
fail-fast: false
52-
matrix:
53-
dep: [minimal, recent]
54-
steps:
55-
- name: "Checkout repo"
56-
uses: actions/checkout@v4
57-
- name: "Checkout maintainer tools"
58-
uses: actions/checkout@v4
59-
with:
60-
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
61-
ref: c3324024ced9bb1eb854397686919c3ff7d97e1e
62-
path: maintainer-tools
63-
- name: "Select toolchain"
64-
uses: dtolnay/rust-toolchain@v1
65-
with:
66-
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
67-
- name: "Set dependencies"
68-
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
69-
- name: "Run test script"
70-
run: ./maintainer-tools/ci/run_task.sh nightly
71-
72-
MSRV: # 2 jobs, one per lock file.
73-
name: Test - 1.75.0 toolchain
74-
runs-on: ubuntu-latest
75-
strategy:
76-
fail-fast: false
77-
matrix:
78-
dep: [minimal, recent]
79-
steps:
80-
- name: "Checkout repo"
81-
uses: actions/checkout@v4
82-
- name: "Checkout maintainer tools"
83-
uses: actions/checkout@v4
84-
with:
85-
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
86-
path: maintainer-tools
87-
- name: "Select toolchain"
88-
uses: dtolnay/rust-toolchain@stable
89-
with:
90-
toolchain: "1.75.0"
91-
- name: "Set dependencies"
92-
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
93-
- name: "Run test script"
94-
run: ./maintainer-tools/ci/run_task.sh msrv
23+
- uses: Swatinem/rust-cache@v2
24+
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0
25+
- name: "Run ${{ matrix.toolchain }} tests"
26+
run: |
27+
cargo rbmt --lock-file ${{ matrix.dep }} test --toolchain ${{ matrix.toolchain }} \
28+
-p bitreq \
29+
-p corepc-client \
30+
-p jsonrpc-fuzz \
31+
-p jsonrpc \
32+
-p corepc-types
9533
9634
Lint:
9735
name: Lint - nightly toolchain
98-
needs: Prepare
9936
runs-on: ubuntu-latest
10037
env:
10138
BITCOIND_SKIP_DOWNLOAD: "1"
@@ -106,24 +43,17 @@ jobs:
10643
steps:
10744
- name: "Checkout repo"
10845
uses: actions/checkout@v4
109-
- name: "Checkout maintainer tools"
110-
uses: actions/checkout@v4
111-
with:
112-
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
113-
ref: c3324024ced9bb1eb854397686919c3ff7d97e1e
114-
path: maintainer-tools
115-
- name: "Select toolchain"
116-
uses: dtolnay/rust-toolchain@v1
117-
with:
118-
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
119-
- name: "Install clippy"
120-
run: rustup component add clippy
121-
- name: "Set dependencies"
122-
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
123-
- name: "Run test script"
46+
- uses: Swatinem/rust-cache@v2
47+
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0
48+
- name: "Run lints"
12449
run: |
125-
./maintainer-tools/ci/run_task.sh lint
126-
./contrib/lint-integtation-tests.sh
50+
cargo rbmt --lock-file ${{ matrix.dep }} lint \
51+
-p bitreq \
52+
-p corepc-client \
53+
-p jsonrpc-fuzz \
54+
-p jsonrpc \
55+
-p corepc-types
56+
./contrib/lint-integration-tests.sh
12757
./contrib/lint-verify.sh
12858
12959
Docs:
@@ -138,22 +68,13 @@ jobs:
13868
steps:
13969
- name: "Checkout repo"
14070
uses: actions/checkout@v4
141-
- name: "Checkout maintainer tools"
142-
uses: actions/checkout@v4
143-
with:
144-
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
145-
ref: c3324024ced9bb1eb854397686919c3ff7d97e1e
146-
path: maintainer-tools
147-
- name: "Select toolchain"
148-
uses: dtolnay/rust-toolchain@stable
149-
- name: "Set dependencies"
150-
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
151-
- name: "Run test script"
152-
run: ./maintainer-tools/ci/run_task.sh docs
71+
- uses: Swatinem/rust-cache@v2
72+
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0
73+
- name: "Run doc tests"
74+
run: cargo rbmt --lock-file ${{ matrix.dep }} docs
15375

15476
Docsrs:
15577
name: Docs - nightly toolchain
156-
needs: Prepare
15778
runs-on: ubuntu-latest
15879
env:
15980
BITCOIND_SKIP_DOWNLOAD: "1"
@@ -164,43 +85,26 @@ jobs:
16485
steps:
16586
- name: "Checkout repo"
16687
uses: actions/checkout@v4
167-
- name: "Checkout maintainer tools"
168-
uses: actions/checkout@v4
169-
with:
170-
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
171-
ref: c3324024ced9bb1eb854397686919c3ff7d97e1e
172-
path: maintainer-tools
173-
- name: "Select toolchain"
174-
uses: dtolnay/rust-toolchain@v1
175-
with:
176-
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
177-
- name: "Set dependencies"
178-
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
179-
- name: "Run test script"
180-
run: ./maintainer-tools/ci/run_task.sh docsrs
88+
- uses: Swatinem/rust-cache@v2
89+
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0
90+
- name: "Run docsrs tests"
91+
run: cargo rbmt --lock-file ${{ matrix.dep }} docsrs
18192

18293
Format: # 1 job, run cargo fmt directly.
18394
name: Format - nightly toolchain
184-
needs: Prepare
18595
runs-on: ubuntu-latest
18696
strategy:
18797
fail-fast: false
18898
steps:
18999
- name: "Checkout repo"
190100
uses: actions/checkout@v4
191-
- name: "Select toolchain"
192-
uses: dtolnay/rust-toolchain@v1
193-
with:
194-
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
195-
- name: "Install rustfmt"
196-
run: rustup component add rustfmt
101+
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0
197102
- name: "Check formatting"
198103
run: |
199-
cargo fmt --all -- --check
104+
cargo rbmt fmt --check
200105
./contrib/fmt-integration-tests.sh
201106
./contrib/fmt-verify.sh
202107
203-
204108
Verify: # 1 job, run `verify` directly.
205109
name: Verify - stable toolchain
206110
runs-on: ubuntu-latest
@@ -247,8 +151,8 @@ jobs:
247151
steps:
248152
- name: "Checkout repo"
249153
uses: actions/checkout@v4
250-
- name: "Select toolchain"
251-
uses: dtolnay/rust-toolchain@stable
154+
- uses: Swatinem/rust-cache@v2
155+
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0
252156
- name: "Cache downloaded bitcoind"
253157
uses: actions/cache@v4
254158
with:

Cargo.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
members = [ "bitreq", "client", "fuzz", "jsonrpc", "node", "types"]
33
exclude = ["integration_test", "verify"]
44
resolver = "2"
5+
rust-version = "1.75.0"
56

67
[patch.crates-io.corepc-client]
78
path = "client"
@@ -14,3 +15,31 @@ path = "node"
1415

1516
[patch.crates-io.corepc-types]
1617
path = "types"
18+
19+
[workspace.metadata.rbmt.toolchains]
20+
nightly = "nightly-2025-09-12"
21+
stable = "1.94.1"
22+
23+
[workspace.metadata.rbmt.integration]
24+
package = "integration-test"
25+
versions = [
26+
"30_2",
27+
"30_0",
28+
"29_0",
29+
"28_2",
30+
"28_1",
31+
"28_0",
32+
"27_2",
33+
"27_1",
34+
"27_0",
35+
"26_2",
36+
"25_2",
37+
"24_2",
38+
"23_2",
39+
"22_1",
40+
"0_21_2",
41+
"0_20_2",
42+
"0_19_1",
43+
"0_18_1",
44+
"0_17_2",
45+
]

bitreq/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ url = { version = "2.4" }
4545
[package.metadata.docs.rs]
4646
all-features = true
4747

48+
[package.metadata.rbmt.lint]
49+
# Unavoidable TLS/crypto dep-graph version conflicts.
50+
allowed_duplicates = ["base64", "windows-sys"]
51+
4852
[features]
4953
default = ["std"]
5054
std = []

bitreq/src/url.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ impl Url {
383383
pub fn as_str(&self) -> &str { &self.serialization }
384384

385385
/// Returns `true` if the URL scheme is "https" or "wss".
386+
#[cfg(feature = "std")]
386387
pub(crate) fn is_https(&self) -> bool { matches!(self.scheme(), "https" | "wss") }
387388

388389
/// Returns `true` if a non-default port was explicitly specified in the URL.
@@ -401,6 +402,7 @@ impl Url {
401402
///
402403
/// The returned string includes the leading `/` (if present) and the `?`
403404
/// separator (if there's a query string). Returns "/" if the path is empty.
405+
#[cfg(feature = "std")]
404406
pub(crate) fn path_and_query(&self) -> String {
405407
let path = self.path();
406408
let path = if path.is_empty() { "/" } else { path };

client/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ exclude = ["tests", "contrib"]
1616
all-features = true
1717
rustdoc-args = ["--cfg", "docsrs"]
1818

19+
[package.metadata.rbmt.lint]
20+
# `base64`: bitcoin (via corepc-types) uses v0.21 while jsonrpc uses v0.22.
21+
allowed_duplicates = ["base64"]
22+
1923
[features]
2024
# Enable this feature to get a blocking JSON-RPC client.
2125
client-sync = ["jsonrpc"]

clippy.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
msrv = "1.75.0"
21
too-many-arguments-threshold = 13

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ lint-verify:
3939
$REPO_DIR/contrib/lint-verify.sh
4040

4141
lint-integration-tests:
42-
$REPO_DIR/contrib/lint-integtation-tests.sh
42+
$REPO_DIR/contrib/lint-integration-tests.sh
4343

4444
# Run cargo fmt
4545
fmt:

node/Cargo.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,17 @@ latest = ["30_2"]
7373
[package.metadata.docs.rs]
7474
features = ["28_2"]
7575
rustdoc-args = ["--cfg", "docsrs"]
76+
77+
[package.metadata.rbmt.lint]
78+
# The node crate requires a version feature to compile; use `latest` for per-package lint.
79+
features = ["latest"]
80+
# Duplicates from build-dep/dep splits, --target=all, or upstream version conflicts.
81+
allowed_duplicates = [
82+
"anyhow", # build-dep and regular dep, same version
83+
"base64", # bitcoin uses v0.21, jsonrpc uses v0.22
84+
"bitcoin_hashes", # build-dep (download) and transitive dep via bitcoin, same version
85+
"bitreq", # build-dep (download) and regular dep via jsonrpc, same version
86+
"linux-raw-sys", # same version, appears twice under --target=all
87+
"rustix", # same version, appears twice under --target=all
88+
"windows-sys", # ring/rustls pin v0.52, tar/tempfile/rustix pin v0.59
89+
]

rbmt-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6560b728ae6a81af9d92713b630ba26772fbd970

0 commit comments

Comments
 (0)