Skip to content

Commit 19097e2

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 3d95080 commit 19097e2

File tree

6 files changed

+235
-51
lines changed

6 files changed

+235
-51
lines changed

.github/workflows/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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. `Lint`
19+
7. `Docs`
20+
8. `Docsrs`
21+
9. `Bench`
22+
10. `Format`
23+
10. `Int-tests`
24+
11. `Embedded`

.github/workflows/rust.yml

+181-51
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,208 @@
1-
on: [push, pull_request]
1+
--- # rust-miniscript 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-
Nightly:
7-
name: Nightly - Bench + Docs + Fmt
12+
Stable: # 2 jobs, one per lock file.
13+
name: Test - stable toolchain
814
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
dep: [minimal, recent]
919
steps:
10-
- name: Checkout Crate
11-
uses: actions/checkout@v2
12-
- name: Checkout Toolchain
13-
uses: actions-rs/toolchain@v1
20+
- name: "Checkout repo"
21+
uses: actions/checkout@v4
22+
- name: "Checkout maintainer tools"
23+
uses: actions/checkout@v4
1424
with:
15-
profile: minimal
16-
toolchain: nightly
17-
override: true
18-
- name: Install clippy
25+
repository: tcharding/rust-bitcoin-maintainer-tools
26+
ref: 05-02-ci
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
34+
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: tcharding/rust-bitcoin-maintainer-tools
49+
ref: 05-02-ci
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: # 1 jobs, minimal lock file only.
59+
name: Test - 1.56.1 toolchain
60+
runs-on: ubuntu-latest
61+
strategy:
62+
fail-fast: false
63+
matrix:
64+
dep: [minimal]
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: tcharding/rust-bitcoin-maintainer-tools
72+
ref: 05-02-ci
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+
Lint:
84+
name: Lint - nightly toolchain
85+
runs-on: ubuntu-latest
86+
strategy:
87+
fail-fast: false
88+
matrix:
89+
dep: [recent]
90+
steps:
91+
- name: "Checkout repo"
92+
uses: actions/checkout@v4
93+
- name: "Checkout maintainer tools"
94+
uses: actions/checkout@v4
95+
with:
96+
repository: tcharding/rust-bitcoin-maintainer-tools
97+
ref: 05-02-ci
98+
path: maintainer-tools
99+
- name: "Select toolchain"
100+
uses: dtolnay/rust-toolchain@nightly
101+
- name: "Install clippy"
19102
run: rustup component add clippy
20-
- name: Running benchmarks
21-
env:
22-
DO_BENCH: true
23-
run: ./contrib/test.sh
24-
- name: Building docs
25-
env:
26-
DO_DOCS: true
27-
run: ./contrib/test.sh
28-
- name: Running formatter
29-
env:
30-
DO_FMT: true
31-
run: ./contrib/test.sh
32-
- name: Running linter
33-
env:
34-
DO_LINT: true
35-
run: ./contrib/test.sh
103+
- name: "Set dependencies"
104+
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
105+
- name: "Run test script"
106+
run: ./maintainer-tools/ci/run_task.sh lint
36107

37-
Int-tests:
38-
name: Integration tests
108+
Docs:
109+
name: Docs - stable toolchain
39110
runs-on: ubuntu-latest
111+
strategy:
112+
fail-fast: false
113+
matrix:
114+
dep: [recent]
40115
steps:
41-
- name: Checkout Crate
42-
uses: actions/checkout@v2
43-
- name: Checkout Toolchain
44-
uses: actions-rs/toolchain@v1
116+
- name: "Checkout repo"
117+
uses: actions/checkout@v4
118+
- name: "Checkout maintainer tools"
119+
uses: actions/checkout@v4
45120
with:
46-
profile: minimal
47-
toolchain: stable
48-
override: true
49-
- name: Running integration tests
50-
run: ./contrib/integration_test.sh
121+
repository: tcharding/rust-bitcoin-maintainer-tools
122+
ref: 05-02-ci
123+
path: maintainer-tools
124+
- name: "Select toolchain"
125+
uses: dtolnay/rust-toolchain@stable
126+
- name: "Set dependencies"
127+
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
128+
- name: "Run test script"
129+
run: ./maintainer-tools/ci/run_task.sh docs
130+
131+
Docsrs:
132+
name: Docs - nightly toolchain
133+
runs-on: ubuntu-latest
134+
strategy:
135+
fail-fast: false
136+
matrix:
137+
dep: [recent]
138+
steps:
139+
- name: "Checkout repo"
140+
uses: actions/checkout@v4
141+
- name: "Checkout maintainer tools"
142+
uses: actions/checkout@v4
143+
with:
144+
repository: tcharding/rust-bitcoin-maintainer-tools
145+
ref: 05-02-ci
146+
path: maintainer-tools
147+
- name: "Select toolchain"
148+
uses: dtolnay/rust-toolchain@nightly
149+
- name: "Set dependencies"
150+
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
151+
- name: "Run test script"
152+
run: ./maintainer-tools/ci/run_task.sh docsrs
51153

52-
Tests:
53-
name: Tests
154+
Bench:
155+
name: Bench - nightly toolchain
54156
runs-on: ubuntu-latest
55157
strategy:
158+
fail-fast: false
56159
matrix:
57-
include:
58-
- rust: stable
59-
- rust: beta
60-
- rust: nightly
61-
- rust: "1.56.1"
160+
dep: [recent]
161+
steps:
162+
- name: "Checkout repo"
163+
uses: actions/checkout@v4
164+
- name: "Checkout maintainer tools"
165+
uses: actions/checkout@v4
166+
with:
167+
repository: tcharding/rust-bitcoin-maintainer-tools
168+
ref: 05-02-ci
169+
path: maintainer-tools
170+
- name: "Select toolchain"
171+
uses: dtolnay/rust-toolchain@nightly
172+
- name: "Set dependencies"
173+
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
174+
- name: "Run test script"
175+
run: ./maintainer-tools/ci/run_task.sh bench
176+
177+
Format: # 1 jobs, run cargo fmt directly.
178+
name: Format - nightly toolchain
179+
runs-on: ubuntu-latest
180+
strategy:
181+
fail-fast: false
182+
steps:
183+
- name: "Checkout repo"
184+
uses: actions/checkout@v4
185+
- name: "Select toolchain"
186+
uses: dtolnay/rust-toolchain@nightly
187+
- name: "Install rustfmt"
188+
run: rustup component add rustfmt
189+
- name: "Check formatting"
190+
run: cargo +nightly fmt --all -- --check
191+
192+
Int-tests:
193+
name: Integration tests
194+
runs-on: ubuntu-latest
62195
steps:
63196
- name: Checkout Crate
64197
uses: actions/checkout@v2
65198
- name: Checkout Toolchain
66199
uses: actions-rs/toolchain@v1
67200
with:
68201
profile: minimal
69-
toolchain: ${{ matrix.rust }}
202+
toolchain: stable
70203
override: true
71-
- name: Running cargo
72-
env:
73-
DO_FEATURE_MATRIX: true
74-
DO_NO_STD: true
75-
run: ./contrib/test.sh
204+
- name: Running integration tests
205+
run: ./contrib/integration_test.sh
76206

77207
Embedded:
78208
runs-on: ubuntu-latest

contrib/crates.sh

+4
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=(".") # Non-workspaces don't have crates.

contrib/pin.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Do pinning as required for current MSRV.
4+
5+
set -euo pipefail
6+
7+
cargo update -p cc --precise 1.0.79

contrib/test_vars.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
# Test all these features with "std" enabled.
4+
FEATURES_WITH_STD="compiler trace serde rand base64"
5+
6+
# Test all these features with "no-std" enabled.
7+
# rust-miniscript only: https://github.com/rust-bitcoin/rust-miniscript/issues/681
8+
FEATURES_WITH_NO_STD="compiler trace serde rand base64"
9+
10+
# Test all these features without "std" enabled.
11+
FEATURES_WITHOUT_STD=""
12+
13+
# Run these examples.
14+
# Note `examples/big` should not be run.
15+
EXAMPLES="htlc:std,compiler parse:std sign_multisig:std verify_tx:std xpub_descriptors:std taproot:std,compiler psbt_sign_finalize:std,base64"

contrib/whitelist_deps.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
# Remove once we upgrade to `bitcoin v0.32.0`.
4+
DUPLICATE_DEPS=("bech32")

0 commit comments

Comments
 (0)