@@ -2,31 +2,31 @@ name: CI
22
33on :
44 push :
5- branches : main
5+ branches : [ main]
66 pull_request :
7- branches : main
7+ branches : [ main]
88
99env :
1010 RUSTFLAGS : --deny warnings
1111
1212jobs :
1313 lint :
14- runs-on : ubuntu-latest
15-
16- steps :
14+ runs-on : ubuntu-latest
15+ steps :
1716 - uses : actions/checkout@v4
1817
19- - name : Install Rust Toolchain Components
20- uses : actions-rs/ toolchain@v1
18+ - name : Install Rust
19+ uses : dtolnay/rust- toolchain@stable
2120 with :
2221 components : clippy, rustfmt
23- override : true
24- toolchain : stable
2522
2623 - uses : Swatinem/rust-cache@v2
2724
28- - name : Clippy
29- run : cargo clippy --all --all-targets
25+ - name : Clippy (default features)
26+ run : cargo clippy --all-targets
27+
28+ - name : Clippy (all features)
29+ run : cargo clippy --all-targets --all-features
3030
3131 - name : Format
3232 run : cargo fmt --all -- --check
@@ -38,38 +38,31 @@ jobs:
3838 fail-fast : false
3939 matrix :
4040 os : [ubuntu-latest, windows-latest, macOS-latest]
41- include :
42- - os : ubuntu-latest
43- target : x86_64-unknown-linux-gnu
44- - os : windows-latest
45- target : x86_64-pc-windows-msvc
46- - os : macOS-latest
47- target : x86_64-apple-darwin
4841
4942 steps :
50- - uses : actions/checkout@v3
51-
52- - name : Install Rust toolchain
53- uses : actions-rs/ toolchain@v1
54- with :
55- profile : minimal
56- toolchain : stable
57- target : ${{ matrix.target }}
58- override : true
59-
60- - name : Cache dependencies
61- uses : actions/cache@v3
62- with :
63- path : |
64- ~/.cargo/registry
65- ~/.cargo/git
66- target
67- key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
68- restore-keys : |
69- ${{ runner.os }}-cargo-
70-
71- - name : Run cargo test
72- uses : actions-rs/cargo@v1
73- with :
74- command : test
75- args : --all
43+ - uses : actions/checkout@v4
44+
45+ - name : Install Rust
46+ uses : dtolnay/rust- toolchain@stable
47+
48+ - uses : Swatinem/rust-cache@v2
49+
50+ - name : Test default features
51+ run : cargo test
52+
53+ - name : Test all features
54+ run : cargo test --all-features
55+
56+ - name : Test library only
57+ run : cargo test --no-default-features --features std
58+
59+ - name : Build CLI
60+ run : cargo build --release --features cli
61+
62+ - name : Test CLI binary (Unix)
63+ if : runner.os != 'Windows'
64+ run : |
65+ echo 'wpkh(02f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9)' > test.desc
66+ ./target/release/descriptor-codec encode "$(cat test.desc)" > encoded.hex
67+ ./target/release/descriptor-codec decode "$(cat encoded.hex)" > decoded.desc
68+ diff test.desc decoded.desc
0 commit comments