Skip to content

Commit

Permalink
ci: Test for unused dependencies
Browse files Browse the repository at this point in the history
Adds a test for unused cargo dependencies.

Signed-off-by: Jonathan Woollett-Light <jcawl@amazon.co.uk>
  • Loading branch information
JonathanWoollett-Light committed Sep 26, 2023
1 parent 5b70cf9 commit 96cde67
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
7 changes: 7 additions & 0 deletions tests/integration_tests/build/test_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@ def test_licenses():
)

cargo("deny", f"--manifest-path {toml_file} check licenses bans")


def test_unused_dependencies():
"""
Test that there are no unused dependencies.
"""
cargo("+nightly udeps --all")
3 changes: 2 additions & 1 deletion tools/devctr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ RUN cd /tmp/poetry && \

# Install the Rust toolchain. Kani only work on x86, so only try to install it there.
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN" \
&& rustup install nightly \
&& rustup target add $ARCH-unknown-linux-musl \
&& rustup component add llvm-tools-preview \
&& cargo install cargo-audit cargo-deny grcov cargo-sort \
&& cargo install cargo-audit cargo-deny grcov cargo-sort cargo-udeps \
&& (if [ "$ARCH" = "x86_64" ]; then cargo install kani-verifier && cargo kani setup; else true; fi) \
&& rm -rf "$CARGO_HOME/registry" \
&& ln -s "$CARGO_REGISTRY_DIR" "$CARGO_HOME/registry" \
Expand Down
14 changes: 7 additions & 7 deletions tools/devctr/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 96cde67

Please sign in to comment.