fix(deps): Remove unused dependencies, and check for them in CI (#6216)
* Remove unused dependencies * Check for newly unused dependencies in CI * Use the correct grep command * Always show cargo machete output * Ignore cargo machete exit status, use grep instead * Use if instead of && and subshells * Invert if logic
This commit is contained in:
parent
9d2b912840
commit
98c634bbee
|
|
@ -60,3 +60,10 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- run: 'echo "No build required"'
|
- run: 'echo "No build required"'
|
||||||
|
|
||||||
|
unused-deps:
|
||||||
|
name: Check for unused dependencies
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- run: 'echo "No build required"'
|
||||||
|
|
|
||||||
|
|
@ -279,3 +279,40 @@ jobs:
|
||||||
with:
|
with:
|
||||||
command: check ${{ matrix.checks }}
|
command: check ${{ matrix.checks }}
|
||||||
arguments: --workspace ${{ matrix.features }}
|
arguments: --workspace ${{ matrix.features }}
|
||||||
|
|
||||||
|
unused-deps:
|
||||||
|
name: Check for unused dependencies
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout git repository
|
||||||
|
uses: actions/checkout@v3.3.0
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Install toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
profile: minimal
|
||||||
|
override: true
|
||||||
|
|
||||||
|
- name: Install cargo-machete
|
||||||
|
uses: baptiste0928/cargo-install@v1
|
||||||
|
with:
|
||||||
|
crate: cargo-machete
|
||||||
|
|
||||||
|
- name: Check unused dependencies
|
||||||
|
# Exclude macro and transitive dependencies by filtering them out of the output,
|
||||||
|
# then if there are any more unused dependencies, fail the job.
|
||||||
|
run: |
|
||||||
|
echo "-- full cargo machete output, including ignored dependencies --"
|
||||||
|
cargo machete --skip-target-dir || true
|
||||||
|
echo "-- unused dependencies are below this line, full output is above --"
|
||||||
|
if (cargo machete --skip-target-dir 2>/dev/null || true) | \
|
||||||
|
grep -v -e gumdrop -e humantime-serde -e tinyvec -e "found the following" -e Cargo.toml -e Done; then
|
||||||
|
echo "New unused dependencies were found, please remove them!"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "No unused dependencies found."
|
||||||
|
fi
|
||||||
|
|
|
||||||
|
|
@ -297,12 +297,6 @@ version = "0.8.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cf9ff0bbfd639f15c74af777d81383cf53efb7c93613f6cab67c6c11e05bbf8b"
|
checksum = "cf9ff0bbfd639f15c74af777d81383cf53efb7c93613f6cab67c6c11e05bbf8b"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "bech32"
|
|
||||||
version = "0.9.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bellman"
|
name = "bellman"
|
||||||
version = "0.13.1"
|
version = "0.13.1"
|
||||||
|
|
@ -5278,7 +5272,7 @@ version = "0.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "804268e702b664fc09d3e2ce82786d0addf4ae57ba6976469be63e09066bf9f7"
|
checksum = "804268e702b664fc09d3e2ce82786d0addf4ae57ba6976469be63e09066bf9f7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bech32 0.8.1",
|
"bech32",
|
||||||
"bs58",
|
"bs58",
|
||||||
"f4jumble",
|
"f4jumble",
|
||||||
"zcash_encoding",
|
"zcash_encoding",
|
||||||
|
|
@ -5436,13 +5430,10 @@ dependencies = [
|
||||||
name = "zebra-chain"
|
name = "zebra-chain"
|
||||||
version = "1.0.0-beta.21"
|
version = "1.0.0-beta.21"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes",
|
|
||||||
"bech32 0.9.1",
|
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"bitvec",
|
"bitvec",
|
||||||
"blake2b_simd",
|
"blake2b_simd",
|
||||||
"blake2s_simd",
|
"blake2s_simd",
|
||||||
"bls12_381",
|
|
||||||
"bs58",
|
"bs58",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
|
@ -5478,7 +5469,6 @@ dependencies = [
|
||||||
"sha2",
|
"sha2",
|
||||||
"spandoc",
|
"spandoc",
|
||||||
"static_assertions",
|
"static_assertions",
|
||||||
"subtle",
|
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"tinyvec",
|
"tinyvec",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
|
@ -5506,7 +5496,6 @@ dependencies = [
|
||||||
"bls12_381",
|
"bls12_381",
|
||||||
"chrono",
|
"chrono",
|
||||||
"color-eyre",
|
"color-eyre",
|
||||||
"dirs",
|
|
||||||
"displaydoc",
|
"displaydoc",
|
||||||
"futures",
|
"futures",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
|
|
@ -5599,7 +5588,6 @@ dependencies = [
|
||||||
"jsonrpc-http-server",
|
"jsonrpc-http-server",
|
||||||
"num_cpus",
|
"num_cpus",
|
||||||
"proptest",
|
"proptest",
|
||||||
"proptest-derive",
|
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
|
@ -5607,7 +5595,6 @@ dependencies = [
|
||||||
"tokio",
|
"tokio",
|
||||||
"tower",
|
"tower",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-futures",
|
|
||||||
"zcash_address",
|
"zcash_address",
|
||||||
"zebra-chain",
|
"zebra-chain",
|
||||||
"zebra-consensus",
|
"zebra-consensus",
|
||||||
|
|
@ -5639,7 +5626,6 @@ dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"color-eyre",
|
"color-eyre",
|
||||||
"dirs",
|
"dirs",
|
||||||
"displaydoc",
|
|
||||||
"futures",
|
"futures",
|
||||||
"halo2_proofs",
|
"halo2_proofs",
|
||||||
"hex",
|
"hex",
|
||||||
|
|
@ -5726,7 +5712,6 @@ dependencies = [
|
||||||
"futures",
|
"futures",
|
||||||
"gumdrop",
|
"gumdrop",
|
||||||
"hex",
|
"hex",
|
||||||
"humantime",
|
|
||||||
"humantime-serde",
|
"humantime-serde",
|
||||||
"hyper",
|
"hyper",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
|
|
|
||||||
|
|
@ -33,13 +33,10 @@ bench = ["zebra-test"]
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
||||||
# Cryptography
|
# Cryptography
|
||||||
aes = "0.7.5"
|
|
||||||
bech32 = "0.9.1"
|
|
||||||
bitvec = "1.0.1"
|
bitvec = "1.0.1"
|
||||||
bitflags = "1.3.2"
|
bitflags = "1.3.2"
|
||||||
blake2b_simd = "1.0.1"
|
blake2b_simd = "1.0.1"
|
||||||
blake2s_simd = "1.0.1"
|
blake2s_simd = "1.0.1"
|
||||||
bls12_381 = "0.7.0"
|
|
||||||
bs58 = { version = "0.4.0", features = ["check"] }
|
bs58 = { version = "0.4.0", features = ["check"] }
|
||||||
byteorder = "1.4.3"
|
byteorder = "1.4.3"
|
||||||
equihash = "0.2.0"
|
equihash = "0.2.0"
|
||||||
|
|
@ -53,7 +50,6 @@ ripemd = "0.1.3"
|
||||||
# Matches version used by hdwallet
|
# Matches version used by hdwallet
|
||||||
secp256k1 = { version = "0.21.3", features = ["serde"] }
|
secp256k1 = { version = "0.21.3", features = ["serde"] }
|
||||||
sha2 = { version = "0.9.9", features = ["compress"] }
|
sha2 = { version = "0.9.9", features = ["compress"] }
|
||||||
subtle = "2.4.1"
|
|
||||||
uint = "0.9.5"
|
uint = "0.9.5"
|
||||||
x25519-dalek = { version = "2.0.0-pre.1", features = ["serde"] }
|
x25519-dalek = { version = "2.0.0-pre.1", features = ["serde"] }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ rand = { version = "0.8.5", package = "rand" }
|
||||||
rayon = "1.6.1"
|
rayon = "1.6.1"
|
||||||
|
|
||||||
chrono = { version = "0.4.23", default-features = false, features = ["clock", "std"] }
|
chrono = { version = "0.4.23", default-features = false, features = ["clock", "std"] }
|
||||||
dirs = "4.0.0"
|
|
||||||
displaydoc = "0.2.3"
|
displaydoc = "0.2.3"
|
||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
once_cell = "1.17.1"
|
once_cell = "1.17.1"
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ getblocktemplate-rpcs = [
|
||||||
# Test-only features
|
# Test-only features
|
||||||
proptest-impl = [
|
proptest-impl = [
|
||||||
"proptest",
|
"proptest",
|
||||||
"proptest-derive",
|
|
||||||
"zebra-consensus/proptest-impl",
|
"zebra-consensus/proptest-impl",
|
||||||
"zebra-state/proptest-impl",
|
"zebra-state/proptest-impl",
|
||||||
"zebra-network/proptest-impl",
|
"zebra-network/proptest-impl",
|
||||||
|
|
@ -52,7 +51,6 @@ tokio = { version = "1.25.0", features = ["time", "rt-multi-thread", "macros", "
|
||||||
tower = "0.4.13"
|
tower = "0.4.13"
|
||||||
|
|
||||||
tracing = "0.1.37"
|
tracing = "0.1.37"
|
||||||
tracing-futures = "0.2.5"
|
|
||||||
|
|
||||||
hex = { version = "0.4.3", features = ["serde"] }
|
hex = { version = "0.4.3", features = ["serde"] }
|
||||||
serde = { version = "1.0.152", features = ["serde_derive"] }
|
serde = { version = "1.0.152", features = ["serde_derive"] }
|
||||||
|
|
@ -64,7 +62,6 @@ zcash_address = { version = "0.2.0", optional = true }
|
||||||
|
|
||||||
# Test-only feature proptest-impl
|
# Test-only feature proptest-impl
|
||||||
proptest = { version = "0.10.1", optional = true }
|
proptest = { version = "0.10.1", optional = true }
|
||||||
proptest-derive = { version = "0.3.0", optional = true }
|
|
||||||
|
|
||||||
zebra-chain = { path = "../zebra-chain" }
|
zebra-chain = { path = "../zebra-chain" }
|
||||||
zebra-consensus = { path = "../zebra-consensus" }
|
zebra-consensus = { path = "../zebra-consensus" }
|
||||||
|
|
@ -77,7 +74,6 @@ zebra-state = { path = "../zebra-state" }
|
||||||
insta = { version = "1.28.0", features = ["redactions", "json", "ron"] }
|
insta = { version = "1.28.0", features = ["redactions", "json", "ron"] }
|
||||||
|
|
||||||
proptest = "0.10.1"
|
proptest = "0.10.1"
|
||||||
proptest-derive = "0.3.0"
|
|
||||||
|
|
||||||
thiserror = "1.0.38"
|
thiserror = "1.0.38"
|
||||||
tokio = { version = "1.25.0", features = ["full", "tracing", "test-util"] }
|
tokio = { version = "1.25.0", features = ["full", "tracing", "test-util"] }
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ proptest-impl = [
|
||||||
bincode = "1.3.3"
|
bincode = "1.3.3"
|
||||||
chrono = { version = "0.4.23", default-features = false, features = ["clock", "std"] }
|
chrono = { version = "0.4.23", default-features = false, features = ["clock", "std"] }
|
||||||
dirs = "4.0.0"
|
dirs = "4.0.0"
|
||||||
displaydoc = "0.2.3"
|
|
||||||
futures = "0.3.26"
|
futures = "0.3.26"
|
||||||
hex = "0.4.3"
|
hex = "0.4.3"
|
||||||
indexmap = "1.9.2"
|
indexmap = "1.9.2"
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,6 @@ zebra-state = { path = "../zebra-state" }
|
||||||
abscissa_core = "0.5"
|
abscissa_core = "0.5"
|
||||||
gumdrop = { version = "0.7", features = ["default_expr"]}
|
gumdrop = { version = "0.7", features = ["default_expr"]}
|
||||||
chrono = { version = "0.4.23", default-features = false, features = ["clock", "std"] }
|
chrono = { version = "0.4.23", default-features = false, features = ["clock", "std"] }
|
||||||
humantime = "2.1.0"
|
|
||||||
humantime-serde = "1.1.1"
|
humantime-serde = "1.1.1"
|
||||||
indexmap = "1.9.2"
|
indexmap = "1.9.2"
|
||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue