forked from bitcoindevkit/bdk
-
Notifications
You must be signed in to change notification settings - Fork 0
168 lines (158 loc) · 4.98 KB
/
cont_integration.yml
File metadata and controls
168 lines (158 loc) · 4.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
on: [push, pull_request]
name: CI
permissions: {}
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
rust_version: ${{ steps.read_toolchain.outputs.rust_version }}
steps:
- name: "Checkout repo"
uses: actions/checkout@v6
with:
persist-credentials: false
- name: "Read rust version"
id: read_toolchain
run: echo "rust_version=$(cat rust-version)" >> $GITHUB_OUTPUT
build-test:
needs: prepare
name: Build & Test
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- version: ${{ needs.prepare.outputs.rust_version }}
- version: 1.85.0 # MSRV
features:
- --no-default-features --features bdk_chain/hashbrown
- --all-features
steps:
- name: checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.rust.version }}
override: true
cache: true
- name: Pin dependencies for MSRV
if: matrix.rust.version == '1.85.0'
run: ./ci/pin-msrv.sh
- name: Build + Test
env:
MATRIX_RUST_VERSION: ${{ matrix.rust.version }}
run: |
cargo build --workspace --exclude 'example_*' ${{ matrix.features }}
cargo test --workspace --exclude 'example_*' ${{ matrix.features }}
check-no-std:
needs: prepare
name: Check no_std
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ needs.prepare.outputs.rust_version }}
override: true
cache: true
# target: "thumbv6m-none-eabi"
- name: Check bdk_chain
working-directory: ./crates/chain
# TODO "--target thumbv6m-none-eabi" should work but currently does not
run: cargo check --no-default-features --features hashbrown
- name: Check esplora
working-directory: ./crates/esplora
# TODO "--target thumbv6m-none-eabi" should work but currently does not
run: cargo check --no-default-features --features bdk_chain/hashbrown
check-wasm:
needs: prepare
name: Check WASM
runs-on: ubuntu-latest
env:
CC: clang-14
CFLAGS: -I/usr/include
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
# Install a recent version of clang that supports wasm32
- run: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1
- run: sudo apt-get update || exit 1
- run: sudo apt-get install -y libclang-common-14-dev clang-14 libc6-dev-i386 || exit 1
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ needs.prepare.outputs.rust_version }}
override: true
cache: true
target: "wasm32-unknown-unknown"
- name: Check esplora
working-directory: ./crates/esplora
run: cargo check --target wasm32-unknown-unknown --no-default-features --features bdk_core/hashbrown,async
fmt:
name: Rust fmt
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
override: true
cache: true
components: rustfmt
- name: Check fmt
run: cargo fmt --all --check
clippy_check:
needs: prepare
name: Rust clippy
runs-on: ubuntu-latest
permissions:
checks: write
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ needs.prepare.outputs.rust_version }}
components: clippy
override: true
cache: true
- name: Clippy
run: cargo clippy --all-features --all-targets -- -D warnings
build-examples:
needs: prepare
name: Build & Test Examples
runs-on: ubuntu-latest
strategy:
matrix:
example-dir:
- example_cli
- example_bitcoind_rpc_polling
- example_electrum
- example_esplora
steps:
- name: checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ needs.prepare.outputs.rust_version }}
override: true
cache: true
- name: Build
working-directory: examples/${{ matrix.example-dir }}
run: cargo build