-
Notifications
You must be signed in to change notification settings - Fork 11
213 lines (192 loc) · 7.11 KB
/
Copy pathrust.yml
File metadata and controls
213 lines (192 loc) · 7.11 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
on:
push:
branches:
- master
- 'v**-dev'
pull_request:
name: Continuous integration
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
spv_tests:
name: SPV Components Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Crate
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Test spv crate
run: cargo test -p spv --all-features
- name: Test spv-ffi crate
run: cargo test -p spv-ffi --all-features
key_wallet_tests:
name: Key Wallet Components Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Crate
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Test key-wallet crate
run: cargo test -p key-wallet --all-features
- name: Test key-wallet-manager crate
run: cargo test -p key-wallet-manager --all-features
- name: Test key-wallet-ffi crate
run: cargo test -p key-wallet-ffi --all-features
core_components_tests:
name: Core Components Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Crate
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Test dashcore crate
run: cargo test -p dashcore --all-features
- name: Test dashcore_hashes crate
run: cargo test -p dashcore_hashes --all-features
- name: Test dash-network crate
run: cargo test -p dash-network --all-features
- name: Test internals crate
run: cargo test -p dashcore-private --all-features
- name: Run script-based tests
run: ./contrib/test.sh
clippy:
name: Clippy (Non-strict)
runs-on: ubuntu-latest
steps:
- name: Checkout Crate
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Run clippy (excluding strict-checked crates)
run: |
# Auto-discover all workspace crates and exclude strict-checked ones
STRICT_CRATES=("key-wallet" "key-wallet-manager" "key-wallet-ffi" "dashcore_hashes" "dashcore")
mapfile -t ALL_CRATES < <(cargo metadata --no-deps --format-version=1 | jq -r '.packages[].name' | sort -u)
for crate in "${ALL_CRATES[@]}"; do
if printf '%s\n' "${STRICT_CRATES[@]}" | grep -qx "$crate"; then
continue
fi
echo "Checking $crate (warnings allowed, errors will fail)..."
cargo clippy -p "$crate" --all-features --all-targets -- -W warnings
done
strict-checks:
name: Strict Warnings and Clippy Checks
runs-on: ubuntu-latest
steps:
- name: Checkout Crate
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2
# Check key-wallet with strict warnings
- name: Check key-wallet (deny warnings)
env:
RUSTFLAGS: "-D warnings"
run: |
cargo check -p key-wallet --all-features --lib --bins --tests
cargo build -p key-wallet --all-features --lib --bins
cargo test -p key-wallet --all-features --lib --bins
- name: Clippy key-wallet (deny all warnings)
run: cargo clippy -p key-wallet --all-features --lib --bins --tests -- -D warnings
# Check key-wallet-manager with strict warnings
- name: Check key-wallet-manager (deny warnings)
env:
RUSTFLAGS: "-D warnings"
run: |
cargo check -p key-wallet-manager --all-features --lib --bins --tests
cargo build -p key-wallet-manager --all-features --lib --bins
cargo test -p key-wallet-manager --all-features --lib --bins
- name: Clippy key-wallet-manager (deny all warnings)
run: cargo clippy -p key-wallet-manager --all-features --lib --bins --tests -- -D warnings
# Check key-wallet-ffi with strict warnings
- name: Check key-wallet-ffi (deny warnings)
env:
RUSTFLAGS: "-D warnings"
run: |
cargo check -p key-wallet-ffi --all-features --lib --bins --tests
cargo build -p key-wallet-ffi --all-features --lib --bins
cargo test -p key-wallet-ffi --all-features --lib --bins
- name: Clippy key-wallet-ffi (deny all warnings)
run: cargo clippy -p key-wallet-ffi --all-features --lib --bins --tests -- -D warnings
# Check dashcore with strict warnings
- name: Check dashcore (deny warnings)
env:
RUSTFLAGS: "-D warnings"
run: |
cargo check -p dashcore --all-features --lib --bins --tests
cargo build -p dashcore --all-features --lib --bins
cargo test -p dashcore --all-features --lib --bins
- name: Clippy dashcore (deny all warnings)
run: cargo clippy -p dashcore --all-features --lib --bins --tests -- -D warnings
# Check dashcore_hashes with strict warnings
- name: Check dashcore_hashes (deny warnings)
env:
RUSTFLAGS: "-D warnings"
run: |
cargo check -p dashcore_hashes --all-features --lib --bins --tests
cargo build -p dashcore_hashes --all-features --lib --bins
cargo test -p dashcore_hashes --all-features --lib --bins
- name: Clippy dashcore_hashes (deny all warnings)
run: cargo clippy -p dashcore_hashes --all-features --lib --bins --tests -- -D warnings
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout Crate
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
rpc_tests:
name: RPC Tests
runs-on: ubuntu-latest
strategy:
matrix:
include:
- rust: stable
env:
PIN_VERSIONS: true
steps:
- name: Checkout Crate
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Running test script
env: ${{ matrix.env }}
run: ./contrib/test.sh
integrations_tests:
name: Integration Tests
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable]
dashversion: ["22.0.0", "22.1.3"]
steps:
- name: Checkout Crate
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Running test script
env:
DASHVERSION: ${{ matrix.dashversion }}
run: ./contrib/test-rpc.sh