Skip to content

Commit eb10a6d

Browse files
committed
CI: Use the new cargo rbmt tool
Use the mad new `cargo rbmt` tool for CI. Note that for `bitcoin` the `extra_tests.sh` test are rolled into `rbmt.toml` now that running without default args is supported.
1 parent f8ea01c commit eb10a6d

File tree

39 files changed

+248
-352
lines changed

39 files changed

+248
-352
lines changed

.github/actions/prepare/action.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: 'Prepare Rust Environment'
2+
description: 'Setup Rust toolchain and install RBMT'
3+
inputs:
4+
toolchain:
5+
description: 'Rust toolchain to use (nightly reads from nightly-version file)'
6+
required: false
7+
default: 'stable'
8+
components:
9+
description: 'Rust components to install (e.g., clippy, rustfmt)'
10+
required: false
11+
default: ''
12+
runs:
13+
using: "composite"
14+
steps:
15+
- name: "Determine toolchain"
16+
id: toolchain
17+
shell: bash
18+
run: |
19+
if [ "${INPUTS_TOOLCHAIN}" = "nightly" ]; then
20+
TOOLCHAIN="$(cat nightly-version)"
21+
else
22+
TOOLCHAIN="${INPUTS_TOOLCHAIN}"
23+
fi
24+
echo "version=$TOOLCHAIN" >> $GITHUB_OUTPUT
25+
env:
26+
INPUTS_TOOLCHAIN: ${{ inputs.toolchain }}
27+
28+
- name: "Setup requested toolchain"
29+
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
30+
with:
31+
toolchain: ${{ steps.toolchain.outputs.version }}
32+
components: ${{ inputs.components }}
33+
34+
- name: "Install RBMT"
35+
shell: bash
36+
run: cargo install --git https://github.com/rust-bitcoin/rust-bitcoin-maintainer-tools.git --rev "$(cat rbmt-version)" cargo-rbmt --locked

.github/workflows/rust.yml

Lines changed: 35 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,6 @@ name: Continuous integration
1111
permissions: {}
1212

1313
jobs:
14-
Prepare:
15-
runs-on: ubuntu-24.04
16-
permissions:
17-
contents: read
18-
outputs:
19-
nightly_version: ${{ steps.read_toolchain.outputs.nightly_version }}
20-
maintainer_tools_version: ${{ steps.read_toolchain.outputs.maintainer_tools_version }}
21-
steps:
22-
- name: "Checkout repo"
23-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
24-
with:
25-
persist-credentials: false
26-
- name: "Read workspace versions"
27-
id: read_toolchain
28-
run: |
29-
echo "nightly_version=$(cat nightly-version)" >> $GITHUB_OUTPUT
30-
echo "maintainer_tools_version=$(cat maintainer-tools-version)" >> $GITHUB_OUTPUT
31-
3214
Stable: # 2 jobs, one per manifest.
3315
name: Test - stable toolchain
3416
needs: Prepare
@@ -40,23 +22,14 @@ jobs:
4022
matrix:
4123
dep: [minimal, recent]
4224
steps:
43-
- name: "Checkout repo"
44-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
25+
- uses: actions/checkout@v6
4526
with:
4627
persist-credentials: false
47-
- name: "Checkout maintainer tools"
48-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28+
- uses: ./.github/actions/prepare
4929
with:
50-
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
51-
ref: ${{ needs.Prepare.outputs.maintainer_tools_version }}
52-
path: maintainer-tools
53-
persist-credentials: false
54-
- name: "Select toolchain"
55-
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6 # stable
56-
- name: "Set dependencies"
57-
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
58-
- name: "Run test script"
59-
run: ./maintainer-tools/ci/run_task.sh stable
30+
toolchain: stable
31+
- name: "Run tests"
32+
run: cargo rbmt test stable --lock-file ${{ matrix.dep }}
6033

6134
Nightly: # 2 jobs, one per manifest.
6235
name: Test - nightly toolchain
@@ -69,25 +42,14 @@ jobs:
6942
matrix:
7043
dep: [minimal, recent]
7144
steps:
72-
- name: "Checkout repo"
73-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
45+
- uses: actions/checkout@v6
7446
with:
7547
persist-credentials: false
76-
- name: "Checkout maintainer tools"
77-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
78-
with:
79-
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
80-
ref: ${{ needs.Prepare.outputs.maintainer_tools_version }}
81-
path: maintainer-tools
82-
persist-credentials: false
83-
- name: "Select toolchain"
84-
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
48+
- uses: ./.github/actions/prepare
8549
with:
86-
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
87-
- name: "Set dependencies"
88-
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
89-
- name: "Run test script"
90-
run: ./maintainer-tools/ci/run_task.sh nightly
50+
toolchain: nightly
51+
- name: "Run tests"
52+
run: cargo rbmt test nightly --lock-file ${{ matrix.dep }}
9153

9254
MSRV: # 2 jobs, one per manifest.
9355
name: Test - MSRV toolchain
@@ -100,31 +62,14 @@ jobs:
10062
matrix:
10163
dep: [minimal, recent]
10264
steps:
103-
- name: "Checkout repo"
104-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
65+
- uses: actions/checkout@v6
10566
with:
10667
persist-credentials: false
107-
- name: "Checkout maintainer tools"
108-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
109-
with:
110-
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
111-
ref: ${{ needs.Prepare.outputs.maintainer_tools_version }}
112-
path: maintainer-tools
113-
persist-credentials: false
114-
- name: "Free disk space"
115-
uses: endersonmenezes/free-disk-space@6c4664f43348c8c7011b53488d5ca65e9fc5cd1a # v3.0.0
116-
with:
117-
remove_android: true
118-
remove_dotnet: true
119-
remove_haskell: true
120-
- name: "Select toolchain"
121-
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6 # stable
68+
- uses: ./.github/actions/prepare
12269
with:
12370
toolchain: "1.74.0"
124-
- name: "Set dependencies"
125-
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
126-
- name: "Run test script"
127-
run: ./maintainer-tools/ci/run_task.sh msrv
71+
- name: "Run tests"
72+
run: cargo rbmt test msrv --lock-file ${{ matrix.dep }}
12873

12974
Lint:
13075
name: Lint - nightly toolchain
@@ -137,27 +82,15 @@ jobs:
13782
matrix:
13883
dep: [recent]
13984
steps:
140-
- name: "Checkout repo"
141-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
142-
with:
143-
persist-credentials: false
144-
- name: "Checkout maintainer tools"
145-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
85+
- uses: actions/checkout@v6
14686
with:
147-
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
148-
ref: ${{ needs.Prepare.outputs.maintainer_tools_version }}
149-
path: maintainer-tools
15087
persist-credentials: false
151-
- name: "Select toolchain"
152-
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
88+
- uses: ./.github/actions/prepare
15389
with:
154-
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
155-
- name: "Install clippy"
156-
run: rustup component add clippy
157-
- name: "Set dependencies"
158-
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
159-
- name: "Run test script"
160-
run: ./maintainer-tools/ci/run_task.sh lint
90+
toolchain: nightly
91+
components: clippy
92+
- name: "Run lint"
93+
run: cargo rbmt lint
16194

16295
Docs:
16396
name: Docs - stable toolchain
@@ -170,23 +103,14 @@ jobs:
170103
matrix:
171104
dep: [recent]
172105
steps:
173-
- name: "Checkout repo"
174-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
106+
- uses: actions/checkout@v6
175107
with:
176108
persist-credentials: false
177-
- name: "Checkout maintainer tools"
178-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
109+
- uses: ./.github/actions/prepare
179110
with:
180-
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
181-
ref: ${{ needs.Prepare.outputs.maintainer_tools_version }}
182-
path: maintainer-tools
183-
persist-credentials: false
184-
- name: "Select toolchain"
185-
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6 # stable
186-
- name: "Set dependencies"
187-
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
188-
- name: "Run test script"
189-
run: ./maintainer-tools/ci/run_task.sh docs
111+
toolchain: stable
112+
- name: "Build docs"
113+
run: cargo rbmt docs
190114

191115
Docsrs:
192116
name: Docs - nightly toolchain
@@ -199,25 +123,14 @@ jobs:
199123
matrix:
200124
dep: [recent]
201125
steps:
202-
- name: "Checkout repo"
203-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
126+
- uses: actions/checkout@v6
204127
with:
205128
persist-credentials: false
206-
- name: "Checkout maintainer tools"
207-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
208-
with:
209-
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
210-
ref: ${{ needs.Prepare.outputs.maintainer_tools_version }}
211-
path: maintainer-tools
212-
persist-credentials: false
213-
- name: "Select toolchain"
214-
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
129+
- uses: ./.github/actions/prepare
215130
with:
216-
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
217-
- name: "Set dependencies"
218-
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
219-
- name: "Run test script"
220-
run: ./maintainer-tools/ci/run_task.sh docsrs
131+
toolchain: nightly
132+
- name: "Build docs.rs docs"
133+
run: cargo rbmt docsrs
221134

222135
Bench:
223136
name: Bench - nightly toolchain
@@ -230,25 +143,14 @@ jobs:
230143
matrix:
231144
dep: [recent]
232145
steps:
233-
- name: "Checkout repo"
234-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
146+
- uses: actions/checkout@v6
235147
with:
236148
persist-credentials: false
237-
- name: "Checkout maintainer tools"
238-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
149+
- uses: ./.github/actions/prepare
239150
with:
240-
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
241-
ref: ${{ needs.Prepare.outputs.maintainer_tools_version }}
242-
path: maintainer-tools
243-
persist-credentials: false
244-
- name: "Select toolchain"
245-
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
246-
with:
247-
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
248-
- name: "Set dependencies"
249-
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
250-
- name: "Run test script"
251-
run: ./maintainer-tools/ci/run_task.sh bench
151+
toolchain: nightly
152+
- name: "Run benches"
153+
run: cargo rbmt test nightly --lock-file ${{ matrix.dep }}
252154

253155
Arch32bit:
254156
name: Test 32-bit version

addresses/contrib/extra_lints.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

addresses/contrib/test_vars.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

addresses/rbmt.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Configuration for rbmt (Rust Bitcoin Maintainer Tools)
2+
3+
[test]
4+
# Examples to run with specific features enabled.
5+
# Format: "example_name:feature1 feature2"
6+
examples = []
7+
8+
# Features to test with the conventional `std` feature enabled.
9+
# Tests each feature alone with std, all pairs, and all together.
10+
features_with_std = []
11+
12+
# Features to test without the `std` feature.
13+
# Tests each feature alone, all pairs, and all together.
14+
features_without_std = ["alloc"]

base58/contrib/extra_lints.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

base58/contrib/test_vars.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

base58/rbmt.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Configuration for rbmt (Rust Bitcoin Maintainer Tools)
2+
3+
[test]
4+
# Examples to run with specific features enabled.
5+
# Format: "example_name:feature1 feature2"
6+
examples = []
7+
8+
# Features to test with the conventional `std` feature enabled.
9+
# Tests each feature alone with std, all pairs, and all together.
10+
features_with_std = []
11+
12+
# Features to test without the `std` feature.
13+
# Tests each feature alone, all pairs, and all together.
14+
features_without_std = ["alloc"]

bip158/contrib/extra_lints.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

bip158/contrib/test_vars.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)