Skip to content

Commit 95d035b

Browse files
committed
Merge #348: Use rust-bitcoin-maintainer-tools and re-write CI
93602a9 CI: Use script from rust-bitcoin-maintainer-tools (Tobin C. Harding) 41c457e CI: Reduce indentation (Tobin C. Harding) Pull request description: Use the new maintainer tools test script we created in rust-bitcoin/rust-bitcoin-maintainer-tools#4 For this repo usage of the script is a big change, the coverage does not change that much except we run one example instead of just building it and we run cargo using `cargo --locked` whereas currently for stable and nightly the dependencies used are much more recent. FTR: - We do not format (exists in current ci but is not enforced because of bug is `test.sh`) - We just build the examples (same as current behaviour) - We do not lint (same as current behaviour) - We do not pin, instead we commit a lock file with working dependency versions. Please note that there are two lock files as is customary but in this repo I was unable to get a set of more recent dependencies to build so both files are the same. This replaces #338 ACKs for top commit: apoelstra: ACK 93602a9 Tree-SHA512: 67a298fddb670714fd27736341b2aa922208d45baadffefc7a9b8dc2ebd48d551b8fc36426bea06d89cddd901ae7feeaf0ebe16ec4668cc3066056f9bb6cd580
2 parents d076d16 + 93602a9 commit 95d035b

File tree

12 files changed

+1259
-95
lines changed

12 files changed

+1259
-95
lines changed

.github/workflows/README.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# rust-miniscript workflow notes
2+
3+
We are attempting to run max 20 parallel jobs using GitHub actions (usage limit for free tier).
4+
5+
ref: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration
6+
7+
The minimal/recent lock files are handled by CI (`rust.yml`).
8+
9+
## Jobs
10+
11+
Run from `rust.yml` unless stated otherwise. Total 11 jobs.
12+
13+
1. `Stable - minimal`
14+
2. `Stable - recent`
15+
3. `Nightly - minimal`
16+
4. `Nightly - recent`
17+
5. `MSRV - minimal`
18+
6. `Integration - 0.18.0`
19+
7. `Integration - 0.18.1`
20+
8. `Integration - 0.19.0.1`
21+
9. `Integration - 0.19.1`
22+
10. `Integration - 0.20.0`
23+
11. `Integration - 0.21.0`

.github/workflows/rust.yml

+102-57
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,107 @@
1-
on: [push, pull_request]
1+
--- # rust-bitcoincore-rpc CI: If you edit this file please update README.md
2+
on: # yamllint disable-line rule:truthy
3+
push:
4+
branches:
5+
- master
6+
- 'test-ci/**'
7+
pull_request:
28

39
name: Continuous integration
410

511
jobs:
6-
tests:
7-
name: Tests
8-
runs-on: ubuntu-latest
9-
strategy:
10-
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
21-
steps:
22-
- name: Checkout Crate
23-
uses: actions/checkout@v2
24-
- name: Checkout Toolchain
25-
uses: actions-rs/toolchain@v1
26-
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
12+
Stable: # 2 jobs, one per lock file.
13+
name: Test - stable toolchain
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
dep: [minimal, recent]
19+
steps:
20+
- name: "Checkout repo"
21+
uses: actions/checkout@v4
22+
- name: "Checkout maintainer tools"
23+
uses: actions/checkout@v4
24+
with:
25+
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
26+
rev: b2ac115
27+
path: maintainer-tools
28+
- name: "Select toolchain"
29+
uses: dtolnay/rust-toolchain@stable
30+
- name: "Set dependencies"
31+
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
32+
- name: "Run test script"
33+
run: ./maintainer-tools/ci/run_task.sh stable
3334

34-
integrations-tests:
35-
name: Integration Tests
36-
runs-on: ubuntu-latest
37-
strategy:
38-
matrix:
39-
rust: [stable]
40-
bitcoinversion:
41-
[
42-
"0.18.0",
43-
"0.18.1",
44-
"0.19.0.1",
45-
"0.19.1",
46-
"0.20.0",
47-
"0.20.1",
48-
"0.21.0",
49-
]
50-
steps:
51-
- name: Checkout Crate
52-
uses: actions/checkout@v2
53-
- name: Checkout Toolchain
54-
uses: actions-rs/toolchain@v1
55-
with:
56-
profile: minimal
57-
toolchain: ${{ matrix.rust }}
58-
override: true
59-
- name: Running test script
60-
env:
61-
BITCOINVERSION: ${{ matrix.bitcoinversion }}
62-
run: ./contrib/test.sh
35+
Nightly: # 2 jobs, one per lock file.
36+
name: Test - nightly toolchain
37+
runs-on: ubuntu-latest
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
dep: [minimal, recent]
42+
steps:
43+
- name: "Checkout repo"
44+
uses: actions/checkout@v4
45+
- name: "Checkout maintainer tools"
46+
uses: actions/checkout@v4
47+
with:
48+
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
49+
rev: b2ac115
50+
path: maintainer-tools
51+
- name: "Select toolchain"
52+
uses: dtolnay/rust-toolchain@nightly
53+
- name: "Set dependencies"
54+
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
55+
- name: "Run test script"
56+
run: ./maintainer-tools/ci/run_task.sh nightly
57+
58+
MSRV: # 2 jobs, one per lock file.
59+
name: Test - 1.56.1 toolchain
60+
runs-on: ubuntu-latest
61+
strategy:
62+
fail-fast: false
63+
matrix:
64+
dep: [minimal, recent]
65+
steps:
66+
- name: "Checkout repo"
67+
uses: actions/checkout@v4
68+
- name: "Checkout maintainer tools"
69+
uses: actions/checkout@v4
70+
with:
71+
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
72+
rev: b2ac115
73+
path: maintainer-tools
74+
- name: "Select toolchain"
75+
uses: dtolnay/rust-toolchain@stable
76+
with:
77+
toolchain: "1.56.1"
78+
- name: "Set dependencies"
79+
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
80+
- name: "Run test script"
81+
run: ./maintainer-tools/ci/run_task.sh msrv
82+
83+
Integration: # 1 job for each Bitcoin Core version.
84+
name: Integration tests - stable toolchain
85+
runs-on: ubuntu-latest
86+
strategy:
87+
fail-fast: false
88+
matrix:
89+
bitcoinversion:
90+
[
91+
"0.18.0",
92+
"0.18.1",
93+
"0.19.0.1",
94+
"0.19.1",
95+
"0.20.0",
96+
"0.20.1",
97+
"0.21.0",
98+
]
99+
steps:
100+
- name: "Checkout repo"
101+
uses: actions/checkout@v4
102+
- name: "Select toolchain"
103+
uses: dtolnay/rust-toolchain@stable
104+
- name: "Run integration tests"
105+
env:
106+
BITCOINVERSION: ${{ matrix.bitcoinversion }}
107+
run: ./contrib/integration_test.sh

0 commit comments

Comments
 (0)