Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Use cargo-machete to check for unused dependencies #1974

Merged
merged 4 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/actions/rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ runs:

- name: Install Rust tools
shell: bash
run: cargo +${{ inputs.version }} quickinstall --no-binstall --no-fallback cargo-llvm-cov cargo-nextest flamegraph cargo-hack cargo-mutants hyperfine
run: |
cargo +${{ inputs.version }} quickinstall --no-binstall --no-fallback \
cargo-llvm-cov cargo-nextest flamegraph cargo-hack cargo-mutants hyperfine \
cargo-machete

# sccache slows CI down, so we leave it disabled.
# Leaving the steps below commented out, so we can re-evaluate enabling it later.
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ jobs:
cargo +${{ matrix.rust-toolchain }} fmt --all -- --check $CONFIG_PATH
if: success() || failure()

- name: Check for unused dependencies
run: cargo +${{ matrix.rust-toolchain }} machete --with-metadata

- name: Clippy
run: |
# Use cargo-hack to run clippy on each crate individually with its
Expand Down
2 changes: 0 additions & 2 deletions neqo-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ log = { workspace = true }
neqo-common = { path = "./../neqo-common" }
neqo-crypto = { path = "./../neqo-crypto" }
neqo-http3 = { path = "./../neqo-http3" }
neqo-qpack = { path = "./../neqo-qpack" }
neqo-transport = { path = "./../neqo-transport" }
neqo-udp = { path = "./../neqo-udp", default-features = false, features = ["tokio"] }
qlog = { workspace = true }
quinn-udp = { version = "0.5.0", default-features = false }
larseggert marked this conversation as resolved.
Show resolved Hide resolved
regex = { version = "1.9", default-features = false, features = ["unicode-perl"] }
tokio = { version = "1", default-features = false, features = ["net", "time", "macros", "rt", "rt-multi-thread"] }
url = { version = "2.5", default-features = false }
Expand Down
1 change: 0 additions & 1 deletion neqo-http3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ neqo-qpack = { path = "./../neqo-qpack" }
neqo-transport = { path = "./../neqo-transport" }
qlog = { workspace = true }
sfv = { version = "0.9", default-features = false }
smallvec = { version = "1.11", default-features = false }
url = { version = "2.5", default-features = false }

[dev-dependencies]
Expand Down
4 changes: 3 additions & 1 deletion neqo-qpack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ workspace = true
# Sync with https://searchfox.org/mozilla-central/source/Cargo.lock 2024-02-08
log = { workspace = true }
neqo-common = { path = "./../neqo-common" }
neqo-crypto = { path = "./../neqo-crypto" }
neqo-transport = { path = "./../neqo-transport" }
qlog = { workspace = true }
static_assertions = { version = "1.1", default-features = false }

[dev-dependencies]
test-fixture = { path = "../test-fixture" }

[package.metadata.cargo-machete]
ignored = ["log"]

[lib]
# See https://github.com/bheisler/criterion.rs/blob/master/book/src/faq.md#cargo-bench-gives-unrecognized-option-errors-for-valid-command-line-options
bench = false
3 changes: 3 additions & 0 deletions neqo-udp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ tokio = { version = "1", default-features = false, features = ["net"], optional
[dev-dependencies]
tokio = { version = "1", default-features = false, features = ["net", "time", "macros", "rt", "rt-multi-thread"] }

[package.metadata.cargo-machete]
ignored = ["log"]

[lib]
# See https://github.com/bheisler/criterion.rs/blob/master/book/src/faq.md#cargo-bench-gives-unrecognized-option-errors-for-valid-command-line-options
bench = false
4 changes: 3 additions & 1 deletion test-fixture/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ log = { workspace = true }
neqo-common = { path = "../neqo-common" }
neqo-crypto = { path = "../neqo-crypto" }
neqo-http3 = { path = "../neqo-http3" }
neqo-qpack = { path = "../neqo-qpack" }
neqo-transport = { path = "../neqo-transport" }
qlog = { workspace = true }

[features]
bench = []
disable-random = []

[package.metadata.cargo-machete]
ignored = ["log"]

[lib]
# See https://github.com/bheisler/criterion.rs/blob/master/book/src/faq.md#cargo-bench-gives-unrecognized-option-errors-for-valid-command-line-options
bench = false
Loading