Skip to content

Commit 433e8ca

Browse files
committed
Merge #43: Upgrade rbmt to simplify integration config
a881b81 Simplify integration test imports (Nick Johnson) b567e53 Refactor Prepare job to action (Nick Johnson) 47182b0 Upgrade github actions (Nick Johnson) 0b7c977 Remove stale docs (Nick Johnson) eac43cc Upgrade rbmt and simplify integration configs (Nick Johnson) 76e820c Bump serde versions to match bitcoin and fix min version issue (Nick Johnson) Pull request description: Moving the Prepare job to an action for one less job and easy to share configs. ACKs for top commit: tcharding: ACK a881b81 Tree-SHA512: df681e0c30db87fd7fd076f091f96752640928f1ce5361837528e84e8beec8305b389a3641a1675075512a8c09068312fa69560ae5d1ae395f7914b97a82461d
2 parents 8502f1c + a881b81 commit 433e8ca

File tree

12 files changed

+108
-146
lines changed

12 files changed

+108
-146
lines changed

.github/actions/prepare/action.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
26+
- name: "Setup stable toolchain for RBMT"
27+
uses: actions-rust-lang/setup-rust-toolchain@v1
28+
with:
29+
toolchain: stable
30+
31+
- name: "Install RBMT"
32+
shell: bash
33+
run: cargo install --git https://github.com/rust-bitcoin/rust-bitcoin-maintainer-tools.git --rev "$(cat rbmt-version)" cargo-rbmt
34+
35+
- name: "Setup requested toolchain"
36+
uses: actions-rust-lang/setup-rust-toolchain@v1
37+
with:
38+
toolchain: ${{ steps.toolchain.outputs.version }}
39+
components: ${{ inputs.components }}

.github/workflows/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,10 @@ We are attempting to run max 20 parallel jobs using GitHub actions (usage limit
44

55
ref: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration
66

7-
The minimal/recent lock files are handled by CI (`rust.yml`).
8-
97
## Jobs
108

11-
Run from rust.yml unless stated otherwise. Unfortunately we are now exceeding the 20 job target.
12-
(Prepare is quick and must be run first anyway.)
9+
Run from rust.yml unless stated otherwise.
1310

14-
0. `Prepare`
1511
1. `Stable - minimal`
1612
2. `Stable - recent`
1713
3. `Nightly - minimal`
@@ -22,3 +18,4 @@ Run from rust.yml unless stated otherwise. Unfortunately we are now exceeding th
2218
8. `Docs`
2319
9. `Docsrs`
2420
10. `Format`
21+
11. `Integration`

.github/workflows/rust.yml

Lines changed: 31 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,6 @@ on: # yamllint disable-line rule:truthy
99
name: Continuous integration
1010

1111
jobs:
12-
Prepare:
13-
runs-on: ubuntu-latest
14-
outputs:
15-
nightly_version: ${{ steps.read_toolchain.outputs.nightly_version }}
16-
rbmt_version: ${{ steps.read_toolchain.outputs.rbmt_version }}
17-
steps:
18-
- name: "Checkout repo"
19-
uses: actions/checkout@v4
20-
- name: "Read toolchain versions"
21-
id: read_toolchain
22-
run: |
23-
echo "nightly_version=$(cat nightly-version)" >> $GITHUB_OUTPUT
24-
echo "rbmt_version=$(cat rbmt-version)" >> $GITHUB_OUTPUT
25-
2612
Stable: # 2 jobs, one per lock file.
2713
name: Test - stable toolchain
2814
runs-on: ubuntu-latest
@@ -31,32 +17,25 @@ jobs:
3117
matrix:
3218
dep: [minimal, recent]
3319
steps:
34-
- name: "Checkout repo"
35-
uses: actions/checkout@v4
36-
- name: "Select toolchain"
37-
uses: dtolnay/rust-toolchain@stable
38-
- name: "Install rbmt"
39-
run: cargo install --git https://github.com/rust-bitcoin/rust-bitcoin-maintainer-tools.git --rev $(cat rbmt-version) cargo-rbmt
20+
- uses: actions/checkout@v6
21+
- uses: ./.github/actions/prepare
22+
with:
23+
toolchain: stable
4024
- name: "Run tests"
4125
run: cargo rbmt test stable --lock-file ${{ matrix.dep }}
4226

4327
Nightly: # 2 jobs, one per lock file.
4428
name: Test - nightly toolchain
45-
needs: Prepare
4629
runs-on: ubuntu-latest
4730
strategy:
4831
fail-fast: false
4932
matrix:
5033
dep: [minimal, recent]
5134
steps:
52-
- name: "Checkout repo"
53-
uses: actions/checkout@v4
54-
- name: "Select toolchain"
55-
uses: dtolnay/rust-toolchain@v1
35+
- uses: actions/checkout@v6
36+
- uses: ./.github/actions/prepare
5637
with:
57-
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
58-
- name: "Install rbmt"
59-
run: cargo install --git https://github.com/rust-bitcoin/rust-bitcoin-maintainer-tools.git --rev ${{ needs.Prepare.outputs.rbmt_version }} cargo-rbmt
38+
toolchain: nightly
6039
- name: "Run tests"
6140
run: cargo rbmt test nightly --lock-file ${{ matrix.dep }}
6241

@@ -68,36 +47,24 @@ jobs:
6847
matrix:
6948
dep: [minimal, recent]
7049
steps:
71-
- name: "Checkout repo"
72-
uses: actions/checkout@v4
73-
- name: "Install stable toolchain"
74-
uses: dtolnay/rust-toolchain@stable
75-
- name: "Install rbmt"
76-
run: cargo install --git https://github.com/rust-bitcoin/rust-bitcoin-maintainer-tools.git --rev $(cat rbmt-version) cargo-rbmt
77-
- name: "Install MSRV toolchain"
78-
uses: dtolnay/rust-toolchain@stable
50+
- uses: actions/checkout@v6
51+
- uses: ./.github/actions/prepare
7952
with:
8053
toolchain: "1.74.0"
8154
- name: "Run tests"
8255
run: cargo rbmt test msrv --lock-file ${{ matrix.dep }}
8356

8457
Lint:
8558
name: Lint - nightly toolchain
86-
needs: Prepare
8759
runs-on: ubuntu-latest
8860
strategy:
8961
fail-fast: false
9062
steps:
91-
- name: "Checkout repo"
92-
uses: actions/checkout@v4
93-
- name: "Select toolchain"
94-
uses: dtolnay/rust-toolchain@v1
63+
- uses: actions/checkout@v6
64+
- uses: ./.github/actions/prepare
9565
with:
96-
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
97-
- name: "Install clippy"
98-
run: rustup component add clippy
99-
- name: "Install rbmt"
100-
run: cargo install --git https://github.com/rust-bitcoin/rust-bitcoin-maintainer-tools.git --rev ${{ needs.Prepare.outputs.rbmt_version }} cargo-rbmt
66+
toolchain: nightly
67+
components: clippy
10168
- name: "Run lint"
10269
run: cargo rbmt lint
10370

@@ -107,77 +74,47 @@ jobs:
10774
strategy:
10875
fail-fast: false
10976
steps:
110-
- name: "Checkout repo"
111-
uses: actions/checkout@v4
112-
- name: "Select toolchain"
113-
uses: dtolnay/rust-toolchain@stable
114-
- name: "Install rbmt"
115-
run: cargo install --git https://github.com/rust-bitcoin/rust-bitcoin-maintainer-tools.git --rev $(cat rbmt-version) cargo-rbmt
77+
- uses: actions/checkout@v6
78+
- uses: ./.github/actions/prepare
79+
with:
80+
toolchain: stable
11681
- name: "Build docs"
11782
run: cargo rbmt docs
11883

11984
Docsrs:
12085
name: Docs - nightly toolchain
121-
needs: Prepare
12286
runs-on: ubuntu-latest
12387
strategy:
12488
fail-fast: false
12589
steps:
126-
- name: "Checkout repo"
127-
uses: actions/checkout@v4
128-
- name: "Select toolchain"
129-
uses: dtolnay/rust-toolchain@v1
90+
- uses: actions/checkout@v6
91+
- uses: ./.github/actions/prepare
13092
with:
131-
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
132-
- name: "Install rbmt"
133-
run: cargo install --git https://github.com/rust-bitcoin/rust-bitcoin-maintainer-tools.git --rev ${{ needs.Prepare.outputs.rbmt_version }} cargo-rbmt
93+
toolchain: nightly
13494
- name: "Build docs.rs docs"
13595
run: cargo rbmt docsrs
13696

13797
Format: # 1 job, run cargo fmt directly.
13898
name: Format - nightly toolchain
139-
needs: Prepare
14099
runs-on: ubuntu-latest
141100
strategy:
142101
fail-fast: false
143102
steps:
144-
- name: "Checkout repo"
145-
uses: actions/checkout@v4
146-
- name: "Select toolchain"
147-
uses: dtolnay/rust-toolchain@v1
103+
- uses: actions/checkout@v6
104+
- uses: ./.github/actions/prepare
148105
with:
149-
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
150-
- name: "Install rustfmt"
151-
run: rustup component add rustfmt
106+
toolchain: nightly
107+
components: rustfmt
152108
- name: "Check formatting"
153109
run: cargo fmt --all -- --check
154110

155-
Integration: # 1 job for each bitcoind version we support.
156-
name: Integration tests against bitcoind
111+
Integration: # 1 job, run bitcoin core integration tests using rbmt.
112+
name: Integration - against bitcoind
157113
runs-on: ubuntu-latest
158-
strategy:
159-
fail-fast: false
160-
matrix:
161-
feature:
162-
[
163-
"29_0",
164-
"28_2",
165-
"27_2",
166-
"26_2",
167-
"25_2",
168-
"24_2",
169-
"23_2",
170-
"22_1",
171-
"0_21_2",
172-
"0_20_2",
173-
"0_19_1",
174-
"0_18_1",
175-
"0_17_2",
176-
]
177114
steps:
178-
- name: "Checkout repo"
179-
uses: actions/checkout@v4
180-
- name: "Select toolchain"
181-
uses: dtolnay/rust-toolchain@stable
115+
- uses: actions/checkout@v6
116+
- uses: ./.github/actions/prepare
117+
with:
118+
toolchain: stable
182119
- name: "Run integration tests"
183-
run: cd bitcoind-tests && cargo test --features=${{ matrix.feature }}
120+
run: cargo rbmt integration

0 commit comments

Comments
 (0)