Skip to content

Commit 54993cd

Browse files
committed
CI: Use script from rust-bitcoin-maintainer-tools
We have a CI script in the `rust-bitcoin-maintainer-tools` repository, lets use it.
1 parent 9eff2dc commit 54993cd

File tree

6 files changed

+122
-24
lines changed

6 files changed

+122
-24
lines changed

.github/workflows/rust.yml

Lines changed: 85 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,98 @@
1-
on: [push, pull_request]
1+
on:
2+
push:
3+
branches:
4+
- master
5+
- 'test-ci/**'
6+
pull_request:
27

38
name: Continuous integration
49

510
jobs:
6-
tests:
7-
name: Tests
11+
Stable: # 2 jobs, one per lock file.
12+
name: Test - stable toolchain
813
runs-on: ubuntu-latest
914
strategy:
15+
fail-fast: false
16+
matrix:
17+
dep: [minimal, recent]
18+
steps:
19+
- name: "Checkout repo"
20+
uses: actions/checkout@v4
21+
- name: "Checkout maintainer tools"
22+
uses: actions/checkout@v4
23+
with:
24+
repository: tcharding/rust-bitcoin-maintainer-tools
25+
ref: 05-02-ci
26+
path: maintainer-tools
27+
- name: "Select toolchain"
28+
uses: dtolnay/rust-toolchain@stable
29+
- name: "Copy lock file"
30+
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
31+
- name: "Run test script"
32+
run: ./maintainer-tools/ci/run_task.sh stable
33+
34+
Nightly: # 2 jobs, one per lock file.
35+
name: Test - nightly toolchain
36+
runs-on: ubuntu-latest
37+
strategy:
38+
fail-fast: false
1039
matrix:
11-
include:
12-
- rust: stable
13-
env:
14-
RUSTFMTCHK: true
15-
- rust: nightly
16-
env:
17-
RUSTFMTCHK: false
18-
- rust: 1.56.1
19-
env:
20-
RUSTFMTCHK: false
40+
dep: [minimal, recent]
2141
steps:
22-
- name: Checkout Crate
23-
uses: actions/checkout@v2
24-
- name: Checkout Toolchain
25-
uses: actions-rs/toolchain@v1
42+
- name: "Checkout repo"
43+
uses: actions/checkout@v4
44+
- name: "Checkout maintainer tools"
45+
uses: actions/checkout@v4
2646
with:
27-
profile: minimal
28-
toolchain: ${{ matrix.rust }}
29-
override: true
30-
- name: Running test script
31-
env: ${{ matrix.env }}
32-
run: ./contrib/test.sh
47+
repository: tcharding/rust-bitcoin-maintainer-tools
48+
ref: 05-02-ci
49+
path: maintainer-tools
50+
- name: "Select toolchain"
51+
uses: dtolnay/rust-toolchain@nightly
52+
- name: "Copy lock file"
53+
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
54+
- name: "Run test script"
55+
run: ./maintainer-tools/ci/run_task.sh nightly
56+
57+
MSRV: # 2 jobs, one per lock file.
58+
name: Test - 1.56.1 toolchain
59+
runs-on: ubuntu-latest
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
dep: [minimal, recent]
64+
steps:
65+
- name: "Checkout repo"
66+
uses: actions/checkout@v4
67+
- name: "Checkout maintainer tools"
68+
uses: actions/checkout@v4
69+
with:
70+
repository: tcharding/rust-bitcoin-maintainer-tools
71+
ref: 05-02-ci
72+
path: maintainer-tools
73+
- name: "Select toolchain"
74+
uses: dtolnay/rust-toolchain@stable
75+
with:
76+
toolchain: "1.56.1"
77+
- name: "Copy lock file"
78+
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
79+
- name: "Run test script"
80+
run: ./maintainer-tools/ci/run_task.sh msrv
81+
82+
Format: # 1 jobs, run cargo fmt directly.
83+
name: Format - stable toolchain
84+
runs-on: ubuntu-latest
85+
strategy:
86+
fail-fast: false
87+
steps:
88+
- name: "Checkout repo"
89+
uses: actions/checkout@v4
90+
- name: "Select toolchain"
91+
uses: dtolnay/rust-toolchain@stable
92+
- name: "Check formatting"
93+
run: cargo fmt --all -- --check
3394

34-
Integration:
95+
Integration: # 1 job for each Bitcoin Core version.
3596
name: Integration tests - stable toolchain
3697
runs-on: ubuntu-latest
3798
strategy:

client/contrib/test_vars.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
# Test all these features with "std" enabled.
4+
FEATURES_WITH_STD=""
5+
6+
# Test all these features without "std" enabled.
7+
FEATURES_WITHOUT_STD="verifymessage"
8+
9+
# Run these examples.
10+
EXAMPLES="retry_client:verifymessage"

contrib/crates.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
# Crates in this workspace to test (excl. fuzz an integration-tests).
4+
CRATES=("json" "client")

contrib/pin.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Do pinning as required for current MSRV.
4+
5+
set -euo pipefail
6+
7+
cargo update -p tempfile --precise 3.6.0
8+
cargo update -p cc --precise 1.0.79
9+
cargo update -p log --precise 0.4.18
10+
cargo update -p serde_json --precise 1.0.96
11+
cargo update -p serde --precise 1.0.156
12+

json/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ serde = { version = "1", features = [ "derive" ] }
2727
serde_json = "1"
2828

2929
bitcoin = { version = "0.31.0", features = ["serde", "rand-std"]}
30+

json/contrib/test_vars.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
# Test all these features with "std" enabled.
4+
FEATURES_WITH_STD=""
5+
6+
# Test all these features without "std" enabled.
7+
FEATURES_WITHOUT_STD=""
8+
9+
# Run these examples.
10+
EXAMPLES=""

0 commit comments

Comments
 (0)