Skip to content

Commit c9852b5

Browse files
committed
Use cargo hack more in CI and fix subxt-metadata features
1 parent 99a8cb9 commit c9852b5

File tree

2 files changed

+15
-26
lines changed

2 files changed

+15
-26
lines changed

.github/workflows/rust.yml

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -181,42 +181,29 @@ jobs:
181181
- name: Cargo check all targets.
182182
run: cargo check --all-targets
183183

184-
# Next, check subxt features.
184+
# Next, check each subxt feature in isolation.
185185
# - `native` feature must always be enabled
186186
# - `web` feature is always ignored.
187-
# - This means, don't check --no-default-features and don't try enabling --all-features; both will fail
188187
- name: Cargo hack; check each subxt feature
189-
run: cargo hack -p subxt --each-feature check --exclude-no-default-features --exclude-all-features --exclude-features web --features native
188+
run: cargo hack --each-feature check --exclude-features web --features native
190189

191190
# Same with subxt-historic
192191
- name: Cargo hack; check each subxt feature
193-
run: cargo hack -p subxt-historic --each-feature check --exclude-no-default-features --exclude-all-features --exclude-features web --features native
192+
run: cargo hack -p subxt-historic --each-feature check --exclude-features web --features native
194193

195-
# Subxt-signer has the "subxt" features enabled in the "check all targets" test. Run it on its own to
196-
# check it without. We can't enable subxt or web features here, so no cargo hack.
197-
- name: Cargo check subxt-signer
198-
run: |
199-
cargo check -p subxt-signer
200-
cargo check -p subxt-signer --no-default-features --features sr25519
201-
cargo check -p subxt-signer --no-default-features --features ecdsa
202-
cargo check -p subxt-signer --no-default-features --features unstable-eth
194+
# And with subxt-rpcs
195+
- name: Cargo hack; check each subxt-rpcs feature
196+
run: cargo hack -p subxt-rpcs --each-feature check --exclude-features web --features native
203197

204-
# Subxt-rpcs has a bunch of clients that can be exposed. Check that they all stand on their own.
205-
- name: Cargo check subxt-rpcs
206-
run: |
207-
cargo check -p subxt-rpcs
208-
cargo check -p subxt-rpcs --no-default-features --features native
209-
cargo check -p subxt-rpcs --no-default-features --features native,subxt
210-
cargo check -p subxt-rpcs --no-default-features --features native,jsonrpsee
211-
cargo check -p subxt-rpcs --no-default-features --features native,reconnecting-rpc-client
212-
cargo check -p subxt-rpcs --no-default-features --features native,mock-rpc-client
213-
cargo check -p subxt-rpcs --no-default-features --features native,unstable-light-client
214-
215-
# We can't enable web features here, so no cargo hack.
198+
# And with subxt-signer (seems to work with a more basic check here; disable web if it becomes an issue).
199+
- name: Cargo hack; check each subxt-signer feature
200+
run: cargo hack -p subxt-signer --each-feature check
201+
202+
# And for subxt-lightclient.
216203
- name: Cargo check subxt-lightclient
217-
run: cargo check -p subxt-lightclient
204+
run: cargo hack -p subxt-lightclient --each-feature check --exclude-features web --features native
218205

219-
# Next, check each other package in isolation.
206+
# Next, check all other crates.
220207
- name: Cargo hack; check each feature/crate on its own
221208
run: cargo hack --exclude subxt --exclude subxt-historic --exclude subxt-signer --exclude subxt-lightclient --exclude subxt-rpcs --exclude-all-features --each-feature check --workspace
222209

metadata/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ default = ["std", "legacy"]
1818
std = ["scale-info/std", "frame-metadata/std"]
1919

2020
# Enable decoding of legacy metadata, too.
21+
# std required by frame-metadata to decode <V14.
2122
legacy = [
23+
"std",
2224
"dep:scale-info-legacy",
2325
"dep:scale-type-resolver",
2426
"frame-decode/legacy",

0 commit comments

Comments
 (0)