Skip to content

Commit 4b5b7c5

Browse files
committed
update cargo-rbmt
This copies the rust.yml file from rust-bech32 verbatim *except* * I changed the lockfile list from {recent, minimal} to just {recent}. Also, since "recent" appears in a ton of places, I just renamed Cargo-latest.lock to Cargo-recent.lock instead of changing the CI file. * I deleted the "embedded" job which refers to a test that doesn't exist here. * Added setting of ELEMENTSD_EXE env var, needed for the elememntsd tests * I commented out the fmt job, which was commented out before, and which would require a 2000-line diff to re-enable (though maybe we should..) * I re-added the WASM job from the old file, since cargo-rbmt doesn't do WASM (I think) and urprisingly that old job was still passing, so I figured we should keep it. If anything breaks going forward, it'll be this one.
1 parent 8509b72 commit 4b5b7c5

4 files changed

Lines changed: 92 additions & 155 deletions

File tree

.github/actions/checkout-maintainer-tools/action.yml

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

.github/workflows/rust.yml

Lines changed: 91 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -1,173 +1,120 @@
1-
on: # yamllint disable-line rule:truthy
2-
pull_request:
3-
push:
4-
branches:
5-
- master
6-
- 'test-ci/**'
1+
on: [push, pull_request]
72

8-
name: Continuous integration
3+
name: Continuous Integration
94

10-
jobs:
11-
Prepare:
12-
runs-on: ubuntu-latest
13-
outputs:
14-
nightly_version: ${{ steps.read_toolchain.outputs.nightly_version }}
15-
msrv_version: ${{ steps.read_msrv.outputs.msrv_version }}
16-
steps:
17-
- name: "Checkout repo"
18-
uses: actions/checkout@v4
19-
- name: "Read nightly version"
20-
id: read_toolchain
21-
run: |
22-
set -euo pipefail
23-
version=$(cat nightly-version)
24-
echo "nightly_version=$version" >> $GITHUB_OUTPUT
25-
- name: Read MSRV from clippy.toml
26-
id: read_msrv
27-
run: |
28-
set -euo pipefail
29-
msrv=$(grep '^msrv *= *"' clippy.toml | sed -E 's/.*"([^"]+)".*/\1/')
30-
echo "msrv_version=$msrv" >> "$GITHUB_OUTPUT"
31-
32-
Stable:
33-
name: Test - stable toolchain
34-
runs-on: ubuntu-latest
35-
strategy:
36-
fail-fast: false
37-
steps:
38-
- name: "Checkout repo"
39-
uses: actions/checkout@v4
40-
- name: "Checkout maintainer tools"
41-
uses: ./.github/actions/checkout-maintainer-tools
42-
- name: "Select toolchain"
43-
uses: dtolnay/rust-toolchain@stable
44-
- name: "Set dependencies"
45-
run: cp Cargo-latest.lock Cargo.lock
46-
- name: "Run test script"
47-
run: ./maintainer-tools/ci/run_task.sh stable
48-
49-
Nightly:
50-
name: Test - nightly toolchain
51-
needs: Prepare
52-
runs-on: ubuntu-latest
53-
strategy:
54-
fail-fast: false
55-
steps:
56-
- name: "Checkout repo"
57-
uses: actions/checkout@v4
58-
- name: "Checkout maintainer tools"
59-
uses: ./.github/actions/checkout-maintainer-tools
60-
- name: "Select toolchain"
61-
uses: dtolnay/rust-toolchain@v1
62-
with:
63-
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
64-
- name: "Set dependencies"
65-
run: cp Cargo-latest.lock Cargo.lock
66-
- name: "Run test script"
67-
run: ./maintainer-tools/ci/run_task.sh nightly
5+
permissions:
6+
contents: read
687

69-
MSRV:
70-
name: Test - MSRV
71-
needs: Prepare
72-
runs-on: ubuntu-latest
8+
jobs:
9+
Test: # 6 jobs: 3 toolchains × 2 lock files.
10+
name: Test - ${{ matrix.toolchain }} toolchain (${{ matrix.dep }})
11+
runs-on: ubuntu-24.04
7312
strategy:
7413
fail-fast: false
14+
matrix:
15+
dep: [recent]
16+
toolchain: [stable, nightly, msrv]
7517
steps:
76-
- name: "Checkout repo"
18+
- name: Checkout repo
7719
uses: actions/checkout@v4
78-
- name: "Checkout maintainer tools"
79-
uses: ./.github/actions/checkout-maintainer-tools
80-
- name: "Select toolchain"
81-
uses: dtolnay/rust-toolchain@stable
82-
with:
83-
toolchain: ${{ needs.Prepare.outputs.msrv_version }}
84-
- name: "Set dependencies"
85-
run: cp Cargo-latest.lock Cargo.lock
86-
- name: "Run test script"
87-
run: ./maintainer-tools/ci/run_task.sh msrv
20+
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@af3c2868415b17eedc808da6d0589e10b7482660 # v0.1.0
21+
- uses: Swatinem/rust-cache@v2
22+
- name: Run ${{ matrix.toolchain }} tests
23+
run: |
24+
export ELEMENTSD_EXE="$PWD/elementsd-tests/bin/elementsd"
25+
if [ "${{ matrix.toolchain }}" = "msrv" ]; then
26+
MSRV="$(cargo rbmt toolchains --msrv)"
27+
cp "Cargo-${{ matrix.dep }}.lock" Cargo.lock
28+
cargo +"$MSRV" test --locked
29+
else
30+
cargo rbmt --lock-file ${{ matrix.dep }} test --toolchain ${{ matrix.toolchain }}
31+
fi
8832
8933
Lint:
9034
name: Lint - nightly toolchain
91-
needs: Prepare
92-
runs-on: ubuntu-latest
93-
strategy:
94-
fail-fast: false
95-
matrix:
96-
dep: [recent]
35+
runs-on: ubuntu-24.04
9736
steps:
98-
- name: "Checkout repo"
37+
- name: Checkout Crate
9938
uses: actions/checkout@v4
100-
- name: "Checkout maintainer tools"
101-
uses: ./.github/actions/checkout-maintainer-tools
102-
- name: "Select toolchain"
103-
uses: dtolnay/rust-toolchain@v1
104-
with:
105-
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
106-
- name: Install clippy
107-
run: rustup component add clippy
108-
- name: "Set dependencies"
109-
run: cp Cargo-latest.lock Cargo.lock
110-
- name: "Run test script"
111-
run: ./maintainer-tools/ci/run_task.sh lint
39+
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@af3c2868415b17eedc808da6d0589e10b7482660 # v0.1.0
40+
- uses: Swatinem/rust-cache@v2
41+
- name: Run lints
42+
run: cargo rbmt --lock-file recent lint
11243

11344
Docs:
11445
name: Docs - stable toolchain
115-
runs-on: ubuntu-latest
116-
strategy:
117-
fail-fast: false
118-
matrix:
119-
dep: [recent]
46+
runs-on: ubuntu-24.04
12047
steps:
121-
- name: "Checkout repo"
48+
- name: Checkout Crate
12249
uses: actions/checkout@v4
123-
- name: "Checkout maintainer tools"
124-
uses: ./.github/actions/checkout-maintainer-tools
125-
- name: "Select toolchain"
126-
uses: dtolnay/rust-toolchain@stable
127-
- name: "Set dependencies"
128-
run: cp Cargo-latest.lock Cargo.lock
129-
- name: "Run test script"
130-
run: ./maintainer-tools/ci/run_task.sh docs
50+
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@af3c2868415b17eedc808da6d0589e10b7482660 # v0.1.0
51+
- uses: Swatinem/rust-cache@v2
52+
- name: Run doc tests
53+
run: cargo rbmt --lock-file recent docs
13154

13255
Docsrs:
13356
name: Docs - nightly toolchain
134-
needs: Prepare
135-
runs-on: ubuntu-latest
136-
strategy:
137-
fail-fast: false
138-
matrix:
139-
dep: [recent]
57+
runs-on: ubuntu-24.04
14058
steps:
141-
- name: "Checkout repo"
59+
- name: Checkout Crate
14260
uses: actions/checkout@v4
143-
- name: "Checkout maintainer tools"
144-
uses: ./.github/actions/checkout-maintainer-tools
145-
- name: "Select toolchain"
146-
uses: dtolnay/rust-toolchain@v1
147-
with:
148-
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
149-
- name: "Set dependencies"
150-
run: cp Cargo-latest.lock Cargo.lock
151-
- name: "Run test script"
152-
run: ./maintainer-tools/ci/run_task.sh docsrs
61+
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@af3c2868415b17eedc808da6d0589e10b7482660 # v0.1.0
62+
- uses: Swatinem/rust-cache@v2
63+
- name: Run docsrs tests
64+
run: cargo rbmt --lock-file recent docsrs
15365

154-
# Format:
66+
# Format: # 1 job, run cargo fmt directly.
15567
# name: Format - nightly toolchain
156-
# needs: Prepare
157-
# runs-on: ubuntu-latest
158-
# strategy:
159-
# fail-fast: false
68+
# runs-on: ubuntu-24.04
16069
# steps:
161-
# - name: "Checkout repo"
70+
# - name: Checkout Crate
16271
# uses: actions/checkout@v4
163-
# - name: "Select toolchain"
164-
# uses: dtolnay/rust-toolchain@v1
165-
# with:
166-
# toolchain: ${{ needs.Prepare.outputs.nightly_version }}
167-
# - name: "Install rustfmt"
168-
# run: rustup component add rustfmt
169-
# - name: "Check formatting"
170-
# run: cargo fmt --all -- --check
72+
# - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@af3c2868415b17eedc808da6d0589e10b7482660 # v0.1.0
73+
# - name: Check formatting
74+
# run: cargo rbmt --lock-file recent fmt --check
75+
76+
Bench:
77+
name: Bench - nightly toolchain
78+
runs-on: ubuntu-24.04
79+
steps:
80+
- name: Checkout Crate
81+
uses: actions/checkout@v4
82+
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@af3c2868415b17eedc808da6d0589e10b7482660 # v0.1.0
83+
- uses: Swatinem/rust-cache@v2
84+
- name: Run benches
85+
run: cargo rbmt --lock-file recent bench
86+
87+
Arch32bit:
88+
name: Test 32-bit version
89+
runs-on: ubuntu-24.04
90+
steps:
91+
- name: Checkout Crate
92+
uses: actions/checkout@v4
93+
- name: Checkout Toolchain
94+
uses: dtolnay/rust-toolchain@stable
95+
- name: Add architecture i386
96+
run: sudo dpkg --add-architecture i386
97+
- name: Install i686 gcc
98+
run: sudo apt-get update -y && sudo apt-get install -y gcc-multilib
99+
- name: Install target
100+
run: rustup target add i686-unknown-linux-gnu
101+
- name: Run tests on i686
102+
run: cargo test --target i686-unknown-linux-gnu
103+
104+
Cross:
105+
name: Cross test
106+
runs-on: ubuntu-24.04
107+
steps:
108+
- name: Checkout Crate
109+
uses: actions/checkout@v4
110+
- name: Checkout Toolchain
111+
uses: dtolnay/rust-toolchain@stable
112+
- name: Install target
113+
run: rustup target add s390x-unknown-linux-gnu
114+
- name: install cross
115+
run: cargo install cross --locked
116+
- name: run cross test
117+
run: cross test --target s390x-unknown-linux-gnu
171118

172119
Wasm:
173120
name: Check WASM
File renamed without changes.

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)