8
8
CARGO_TERM_COLOR : always
9
9
10
10
jobs :
11
- prepare :
12
- runs-on : ubuntu-latest
13
- outputs :
14
- rust_version : ${{ steps.read_toolchain.outputs.rust_version }}
11
+ build-test-msrv :
12
+ name : Build & Test MSRV
13
+ runs-on : ${{ matrix.os }}
14
+ strategy :
15
+ matrix :
16
+ os :
17
+ - ubuntu-latest
18
+ - ubuntu-24.04-arm
19
+ features :
20
+ - --no-default-features --features miniscript/no-std,bdk_chain/hashbrown
21
+ - --all-features
15
22
steps :
16
- - name : " Checkout repo "
23
+ - name : Checkout
17
24
uses : actions/checkout@v4
18
25
with :
19
26
persist-credentials : false
20
- - name : " Read rust version"
21
- id : read_toolchain
22
- run : echo "rust_version=$(cat rust-version)" >> $GITHUB_OUTPUT
27
+ # The 'toolchain' argument on this action overrides the Rust compiler version set in rust-toolchain.toml
28
+ # in order to test our MSRV.
29
+ - name : Install Rust toolchain
30
+ uses : actions-rust-lang/setup-rust-toolchain@v1
31
+ with :
32
+ toolchain : 1.85 # MSRV
33
+ cache : true
34
+ - name : Pin dependencies for MSRV
35
+ run : ./ci/pin-msrv.sh
36
+ - name : Build + Test
37
+ run : |
38
+ cargo build --workspace --all-targets ${{ matrix.features }}
39
+ cargo test --workspace ${{ matrix.features }}
23
40
24
- build-test :
25
- needs : prepare
26
- name : Build & Test
41
+ build-test-stable :
42
+ name : Build & Test Rust Stable
27
43
runs-on : ${{ matrix.os }}
28
44
strategy :
29
45
matrix :
30
46
os :
31
47
- ubuntu-latest
32
48
- ubuntu-24.04-arm
33
- rust :
34
- - version : ${{ needs.prepare.outputs.rust_version }}
35
- - version : 1.85.0 # MSRV
36
49
features :
37
50
- --no-default-features --features miniscript/no-std,bdk_chain/hashbrown
38
51
- --all-features
39
52
steps :
40
- - name : checkout
53
+ - name : Checkout
41
54
uses : actions/checkout@v4
42
55
with :
43
56
persist-credentials : false
57
+ # This action will honor the Rust compiler version set in rust-toolchain.toml. We aim to keep it in sync with
58
+ # Rust stable.
44
59
- name : Install Rust toolchain
45
- uses : dtolnay/ rust-toolchain@v1
60
+ uses : actions-rust-lang/setup- rust-toolchain@v1
46
61
with :
47
- toolchain : ${{ matrix.rust.version }}
48
- - name : Rust Cache
49
- uses : Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0
50
- - name : Pin dependencies for MSRV
51
- if : matrix.rust.version == '1.85.0'
52
- run : ./ci/pin-msrv.sh
62
+ cache : true
53
63
- name : Build + Test
54
- env :
55
- MATRIX_RUST_VERSION : ${{ matrix.rust.version }}
56
64
run : |
57
65
cargo build --workspace --all-targets ${{ matrix.features }}
58
66
cargo test --workspace ${{ matrix.features }}
59
67
60
68
check-no-std :
61
- needs : prepare
62
69
name : Check no_std
63
70
runs-on : ubuntu-latest
64
71
steps :
65
72
- name : Checkout
66
73
uses : actions/checkout@v4
67
74
with :
68
75
persist-credentials : false
76
+ # This action automatically reads and applies rust-toolchain.toml
69
77
- name : Install Rust toolchain
70
- uses : dtolnay/ rust-toolchain@v1
78
+ uses : actions-rust-lang/setup- rust-toolchain@v1
71
79
with :
72
- toolchain : ${{ needs.prepare.outputs.rust_version }}
73
- # target: "thumbv6m-none-eabi"
74
- - name : Rust Cache
75
- uses : Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0
80
+ cache : true
76
81
- name : Check no-std
77
82
# TODO "--target thumbv6m-none-eabi" should work but currently does not
78
83
run : cargo check --no-default-features --features miniscript/no-std,bdk_chain/hashbrown
79
84
80
85
check-wasm :
81
- needs : prepare
82
86
name : Check WASM
83
87
runs-on : ubuntu-latest
84
88
env :
@@ -93,15 +97,16 @@ jobs:
93
97
- run : wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1
94
98
- run : sudo apt-get update || exit 1
95
99
- run : sudo apt-get install -y libclang-common-14-dev clang-14 libc6-dev-i386 || exit 1
100
+ # This action automatically reads and applies rust-toolchain.toml
96
101
- name : Install Rust toolchain
97
- uses : dtolnay/ rust-toolchain@v1
102
+ uses : actions-rust-lang/setup- rust-toolchain@v1
98
103
with :
99
- toolchain : ${{ needs.prepare.outputs.rust_version }}
100
- targets : " wasm32-unknown-unknown"
101
- - name : Rust Cache
102
- uses : Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0
104
+ cache : true
105
+ target : wasm32-unknown-unknown
103
106
- name : Check WASM
104
- run : cargo check --target wasm32-unknown-unknown --no-default-features --features miniscript/no-std,bdk_chain/hashbrown
107
+ run : |
108
+ rustup target add wasm32-unknown-unknown
109
+ cargo check --target wasm32-unknown-unknown --no-default-features --features miniscript/no-std,bdk_chain/hashbrown
105
110
106
111
fmt :
107
112
name : Rust fmt
@@ -111,30 +116,29 @@ jobs:
111
116
uses : actions/checkout@v4
112
117
with :
113
118
persist-credentials : false
119
+ # This action automatically reads and applies rust-toolchain.toml
114
120
- name : Install Rust toolchain
115
- uses : dtolnay/ rust-toolchain@v1
121
+ uses : actions-rust-lang/setup- rust-toolchain@v1
116
122
with :
117
- toolchain : nightly
118
- components : rustfmt
123
+ cache : true
119
124
- name : Check fmt
120
125
run : cargo fmt --all --check
121
126
122
127
clippy_check :
123
- needs : prepare
124
128
name : Rust clippy
125
129
runs-on : ubuntu-latest
126
130
permissions :
127
131
checks : write
128
132
steps :
129
- - uses : actions/checkout@v4
133
+ - name : Checkout
134
+ uses : actions/checkout@v4
130
135
with :
131
136
persist-credentials : false
132
- - uses : dtolnay/rust-toolchain@v1
137
+ # This action automatically reads and applies rust-toolchain.toml
138
+ - name : Install Rust toolchain
139
+ uses : actions-rust-lang/setup-rust-toolchain@v1
133
140
with :
134
- toolchain : ${{ needs.prepare.outputs.rust_version }}
135
- components : clippy
136
- - name : Rust Cache
137
- uses : Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0
141
+ cache : true
138
142
- name : Clippy
139
143
run : cargo clippy --all-features --all-targets -- -D warnings
140
144
0 commit comments