Skip to content

Commit cddbcfa

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 d37fc8c commit cddbcfa

File tree

4 files changed

+203
-50
lines changed

4 files changed

+203
-50
lines changed

.github/workflows/rust.yml

+177-50
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,205 @@
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-
Nightly:
7-
name: Nightly - Bench + Docs + Fmt
11+
Stable: # 2 jobs, one per manifest.
12+
name: Test - stable toolchain
813
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
dep: [minimal, recent]
918
steps:
10-
- name: Checkout Crate
11-
uses: actions/checkout@v2
12-
- name: Checkout Toolchain
13-
uses: actions-rs/toolchain@v1
19+
- name: "Checkout repo"
20+
uses: actions/checkout@v4
21+
- name: "Checkout maintainer tools"
22+
uses: actions/checkout@v4
1423
with:
15-
profile: minimal
16-
toolchain: nightly
17-
override: true
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: "Set dependencies"
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 manifest.
35+
name: Test - nightly toolchain
36+
runs-on: ubuntu-latest
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
dep: [minimal, recent]
41+
steps:
42+
- name: "Checkout repo"
43+
uses: actions/checkout@v4
44+
- name: "Checkout maintainer tools"
45+
uses: actions/checkout@v4
46+
with:
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: "Set dependencies"
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 manifest.
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+
Lint:
83+
name: Lint - nightly toolchain
84+
runs-on: ubuntu-latest
85+
strategy:
86+
fail-fast: false
87+
matrix:
88+
dep: [recent]
89+
steps:
90+
- name: "Checkout repo"
91+
uses: actions/checkout@v4
92+
- name: "Checkout maintainer tools"
93+
uses: actions/checkout@v4
94+
with:
95+
repository: tcharding/rust-bitcoin-maintainer-tools
96+
ref: 05-02-ci
97+
path: maintainer-tools
98+
- name: "Select toolchain"
99+
uses: dtolnay/rust-toolchain@nightly
18100
- name: Install clippy
19101
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
102+
- name: "Set dependencies"
103+
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
104+
- name: "Run test script"
105+
run: ./maintainer-tools/ci/run_task.sh lint
36106

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

52-
Tests:
53-
name: Tests
153+
Bench:
154+
name: Bench - nightly toolchain
54155
runs-on: ubuntu-latest
55156
strategy:
157+
fail-fast: false
56158
matrix:
57-
include:
58-
- rust: stable
59-
- rust: beta
60-
- rust: nightly
61-
- rust: "1.56.1"
159+
dep: [recent]
160+
steps:
161+
- name: "Checkout repo"
162+
uses: actions/checkout@v4
163+
- name: "Checkout maintainer tools"
164+
uses: actions/checkout@v4
165+
with:
166+
repository: tcharding/rust-bitcoin-maintainer-tools
167+
ref: 05-02-ci
168+
path: maintainer-tools
169+
- name: "Select toolchain"
170+
uses: dtolnay/rust-toolchain@nightly
171+
- name: "Copy lock file"
172+
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
173+
- name: "Run test script"
174+
run: ./maintainer-tools/ci/run_task.sh bench
175+
176+
Format: # 1 jobs, run cargo fmt directly.
177+
name: Format - nightly toolchain
178+
runs-on: ubuntu-latest
179+
strategy:
180+
fail-fast: false
181+
steps:
182+
- name: "Checkout repo"
183+
uses: actions/checkout@v4
184+
- name: "Select toolchain"
185+
uses: dtolnay/rust-toolchain@nightly
186+
- name: "Check formatting"
187+
run: cargo +nightly fmt --all -- --check
188+
189+
Int-tests:
190+
name: Integration tests
191+
runs-on: ubuntu-latest
62192
steps:
63193
- name: Checkout Crate
64194
uses: actions/checkout@v2
65195
- name: Checkout Toolchain
66196
uses: actions-rs/toolchain@v1
67197
with:
68198
profile: minimal
69-
toolchain: ${{ matrix.rust }}
199+
toolchain: stable
70200
override: true
71-
- name: Running cargo
72-
env:
73-
DO_FEATURE_MATRIX: true
74-
DO_NO_STD: true
75-
run: ./contrib/test.sh
201+
- name: Running integration tests
202+
run: ./contrib/integration_test.sh
76203

77204
Embedded:
78205
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"

0 commit comments

Comments
 (0)