-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (95 loc) · 3.5 KB
/
Copy pathci.yml
File metadata and controls
104 lines (95 loc) · 3.5 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
name: ci
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: never
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
# Default storage features compatible with MSRV 1.95 + a standard Linux host.
PORTABLE_FEATURES: "rocksdb,fjall,redb,mdbx,bitcoinconsensus"
jobs:
wallet-no-seckey:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
! grep -r 'SecretKey\|secp256k1::Secret\|seckey' crates/wallet/src
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.95.0
with:
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.95.0
with:
components: clippy
- uses: Swatinem/rust-cache@v2
# In a virtual workspace (no root [package]), `--features` flags are not
# forwarded to library crates; use `-p bitcoin-rs` so the binary's feature
# table propagates all backends to bitcoin-rs-node and its deps.
- run: |
cargo clippy -p bitcoin-rs --all-targets \
--no-default-features --features "${PORTABLE_FEATURES}" \
-- -D warnings
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.95.0
- uses: Swatinem/rust-cache@v2
# Library unit tests run with each crate's own default features.
- run: cargo test --workspace --no-fail-fast
# Node / binary tests run with the full portable feature set. -p is
# required because `--workspace --features` silently ignores --features in
# a virtual workspace (no root [package] section in the top-level Cargo.toml).
- run: |
cargo test -p bitcoin-rs --no-fail-fast \
--no-default-features --features "${PORTABLE_FEATURES}"
bench-smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.95.0
- uses: Swatinem/rust-cache@v2
- run: |
cargo bench -p bitcoin-rs --no-run \
--no-default-features --features "${PORTABLE_FEATURES}"
# Crate-level bench targets are unreachable from -p bitcoin-rs; compile
# them in both allocator configurations so bench-mimalloc breakage is
# visible to CI.
- run: cargo bench -p bitcoin-rs-coinstats -p bitcoin-rs-utxo --no-run
- run: |
cargo bench -p bitcoin-rs-coinstats -p bitcoin-rs-utxo --no-run \
--features bench-mimalloc
deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
with:
rust-version: "1.95.0"
arguments: --workspace --no-default-features --features ${{ env.PORTABLE_FEATURES }}
# Heavy sys-crate gate:
# - libboost-dev for libbitcoinkernel-sys
# Builds and smoke-tests the bitcoinkernel-backed consensus package without
# libbitcoinconsensus; both native Core archives export overlapping symbols and
# cannot share a single Rust test binary.
kernel-only:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo apt-get update && sudo apt-get install -y libboost-dev cmake
- uses: dtolnay/rust-toolchain@1.95.0
- uses: Swatinem/rust-cache@v2
- run: |
cargo test -p bitcoin-rs-consensus --no-fail-fast \
--no-default-features --features kernel -- --include-ignored