@@ -3,130 +3,122 @@ on: [push, pull_request]
33name : CI
44
55jobs :
6+ self-care :
7+ name : Flake self-check
8+ runs-on : ubuntu-latest
9+ steps :
10+ - uses : actions/checkout@v4
11+ - name : Check Nix flake inputs
12+ uses : DeterminateSystems/flake-checker-action@v7
13+ with :
14+ fail-mode : true
15+
16+ pre-commit-checks :
17+ name : " Pre-commit checks: cargo fmt, typos, pgp-signed and conventional commits"
18+ runs-on : ubuntu-latest
19+ steps :
20+ - name : checkout
21+ uses : actions/checkout@v4
22+ - name : Install Nix
23+ uses : DeterminateSystems/nix-installer-action@v11
24+ - name : Nix Cache
25+ uses : DeterminateSystems/magic-nix-cache-action@v6
26+ - name : Rust Cache
27+ uses : Swatinem/rust-cache@v2
28+ - name : Pre-commit checks
29+ run : nix develop -L .#stable --command pre-commit run --all-files
30+
31+ clippy :
32+ name : " Stable build, clippy and test"
33+ runs-on : ubuntu-latest
34+ strategy :
35+ matrix :
36+ features :
37+ - --no-default-features
38+ - --all-features
39+ steps :
40+ - name : checkout
41+ uses : actions/checkout@v4
42+ - name : Install Nix
43+ uses : DeterminateSystems/nix-installer-action@v11
44+ - name : Nix Cache
45+ uses : DeterminateSystems/magic-nix-cache-action@v6
46+ - name : Rust Cache
47+ uses : Swatinem/rust-cache@v2
48+ - name : Build
49+ run : nix develop -L .#stable --command cargo build ${{ matrix.features }}
50+ - name : Clippy
51+ run : nix develop -L .#stable --command cargo clippy ${{ matrix.features }} -- -D warnings
52+ - name : Test
53+ run : nix develop -L .#stable --command cargo test ${{ matrix.features }}
654
755 build-test :
8- name : Build and test
56+ name : " MSRV build and test"
957 runs-on : ubuntu-latest
1058 strategy :
1159 matrix :
12- rust :
13- - version : stable
14- clippy : true
15- - version : 1.63.0 # MSRV
1660 features :
1761 - --no-default-features
1862 - --all-features
1963 steps :
2064 - name : checkout
21- uses : actions/checkout@v2
22- - name : Install Rust toolchain
23- uses : actions-rs/toolchain@v1
24- with :
25- toolchain : ${{ matrix.rust.version }}
26- override : true
27- profile : minimal
65+ uses : actions/checkout@v4
66+ - name : Install Nix
67+ uses : DeterminateSystems/nix-installer-action@v11
68+ - name : Nix Cache
69+ uses : DeterminateSystems/magic-nix-cache-action@v6
2870 - name : Rust Cache
29- uses : Swatinem/rust-cache@v2.2.1
30- - name : Pin dependencies for MSRV
31- if : matrix.rust.version == '1.63.0'
32- run : |
33- cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5"
34- cargo update -p time --precise "0.3.20"
35- cargo update -p home --precise "0.5.5"
36- cargo update -p proptest --precise "1.2.0"
37- cargo update -p url --precise "2.5.0"
38- cargo update -p cc --precise "1.0.105"
39- cargo update -p tokio --precise "1.38.1"
71+ uses : Swatinem/rust-cache@v2
4072 - name : Build
41- run : cargo build ${{ matrix.features }}
73+ run : nix develop -L .#msrv --command cargo build ${{ matrix.features }}
4274 - name : Test
43- run : cargo test ${{ matrix.features }}
75+ run : nix develop -L .#msrv --command cargo test ${{ matrix.features }}
4476
4577 check-no-std :
4678 name : Check no_std
4779 runs-on : ubuntu-latest
80+ strategy :
81+ matrix :
82+ rust :
83+ - msrv
84+ - stable
4885 steps :
49- - name : Checkout
50- uses : actions/checkout@v2
51- - name : Install Rust toolchain
52- uses : actions-rs/toolchain@v1
53- with :
54- toolchain : stable
55- override : true
56- profile : minimal
57- # target: "thumbv6m-none-eabi"
86+ - name : checkout
87+ uses : actions/checkout@v4
88+ - name : Install Nix
89+ uses : DeterminateSystems/nix-installer-action@v11
90+ - name : Nix Cache
91+ uses : DeterminateSystems/magic-nix-cache-action@v6
5892 - name : Rust Cache
59- uses : Swatinem/rust-cache@v2.2.1
93+ uses : Swatinem/rust-cache@v2
94+ # TODO "--target thumbv6m-none-eabi" should work but currently does not
6095 - name : Check bdk_chain
61- working-directory : ./crates/chain
62- # TODO "--target thumbv6m-none-eabi" should work but currently does not
63- run : cargo check --no-default-features --features miniscript/no-std,hashbrown
64- - name : Check bdk wallet
65- working-directory : ./crates/wallet
66- # TODO "--target thumbv6m-none-eabi" should work but currently does not
67- run : cargo check --no-default-features --features miniscript/no-std,bdk_chain/hashbrown
96+ run : nix develop -L ".#${{ matrix.rust }}" --command cargo check -p bdk_chain --no-default-features --features miniscript/no-std,hashbrown
97+ - name : Check bdk
98+ run : nix develop -L ".#${{ matrix.rust }}" --command cargo check -p bdk_wallet --no-default-features --features miniscript/no-std,bdk_chain/hashbrown
6899 - name : Check esplora
69- working-directory : ./crates/esplora
70- # TODO "--target thumbv6m-none-eabi" should work but currently does not
71- run : cargo check --no-default-features --features miniscript/no-std,bdk_chain/hashbrown
100+ run : nix develop -L ".#${{ matrix.rust }}" --command cargo check -p bdk_esplora --no-default-features --features miniscript/no-std,bdk_chain/hashbrown
72101
73102 check-wasm :
74103 name : Check WASM
75- runs-on : ubuntu-20.04
76- env :
77- CC : clang-10
78- CFLAGS : -I/usr/include
79- steps :
80- - name : Checkout
81- uses : actions/checkout@v2
82- # Install a recent version of clang that supports wasm32
83- - run : wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1
84- - run : sudo apt-get update || exit 1
85- - run : sudo apt-get install -y libclang-common-10-dev clang-10 libc6-dev-i386 || exit 1
86- - name : Install Rust toolchain
87- uses : actions-rs/toolchain@v1
88- with :
89- toolchain : stable
90- override : true
91- profile : minimal
92- target : " wasm32-unknown-unknown"
93- - name : Rust Cache
94- uses : Swatinem/rust-cache@v2.2.1
95- - name : Check bdk wallet
96- working-directory : ./crates/wallet
97- run : cargo check --target wasm32-unknown-unknown --no-default-features --features miniscript/no-std,bdk_chain/hashbrown
98- - name : Check esplora
99- working-directory : ./crates/esplora
100- run : cargo check --target wasm32-unknown-unknown --no-default-features --features miniscript/no-std,bdk_chain/hashbrown,async
101-
102- fmt :
103- name : Rust fmt
104- runs-on : ubuntu-latest
105- steps :
106- - name : Checkout
107- uses : actions/checkout@v2
108- - name : Install Rust toolchain
109- uses : actions-rs/toolchain@v1
110- with :
111- toolchain : stable
112- override : true
113- profile : minimal
114- components : rustfmt
115- - name : Check fmt
116- run : cargo fmt --all -- --config format_code_in_doc_comments=true --check
117-
118- clippy_check :
119104 runs-on : ubuntu-latest
105+ strategy :
106+ matrix :
107+ rust :
108+ - msrv
109+ - stable
110+ target :
111+ - wasm32-unknown-unknown
120112 steps :
121- - uses : actions/ checkout@v1
122- - uses : actions-rs/toolchain@v1
123- with :
124- toolchain : 1.78.0
125- components : clippy
126- override : true
113+ - name : checkout
114+ uses : actions/checkout@v4
115+ - name : Install Nix
116+ uses : DeterminateSystems/nix-installer-action@v11
117+ - name : Nix Cache
118+ uses : DeterminateSystems/magic-nix-cache-action@v6
127119 - name : Rust Cache
128- uses : Swatinem/rust-cache@v2.2.1
129- - uses : actions-rs/clippy-check@v1
130- with :
131- token : ${{ secrets.GITHUB_TOKEN }}
132- args : --all-features --all-targets -- -D warnings
120+ uses : Swatinem/rust-cache@v2
121+ - name : Check bdk
122+ run : nix develop -L ".#${{ matrix.rust }}" --command cargo check -p bdk_wallet --target ${{ matrix.target }} --no-default-features --features miniscript/no-std,bdk_chain/hashbrown
123+ - name : Check esplora
124+ run : nix develop -L ".#${{ matrix.rust }}" --command cargo check -p bdk_esplora --target ${{ matrix.target }} --no-default-features --features miniscript/no-std,bdk_chain/hashbrown,async
0 commit comments