Skip to content

Commit

Permalink
Add cargo-udeps in CI (#3646)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanPlasse authored Mar 22, 2023
1 parent 1e45b13 commit 3ec1ea8
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ jobs:
name: ruff
path: target/debug/ruff


cargo-test-wasm:
runs-on: ubuntu-latest
name: "cargo test (wasm)"
Expand Down Expand Up @@ -176,3 +175,26 @@ jobs:
with:
name: ecosystem-result
path: ecosystem-result

cargo-udeps:
name: "cargo udeps"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Install Rust toolchain"
run: rustup toolchain install nightly
- name: "Install cargo-udeps"
uses: taiki-e/install-action@cargo-udeps
- name: "Run cargo-udeps"
run: |
unused_dependencies=$(cargo +nightly udeps > unused.txt && cat unused.txt | cut -d $'\n' -f 2-)
if [ -z "$unused_dependencies" ]; then
echo "No unused dependencies found" > $GITHUB_STEP_SUMMARY
exit 0
else
echo "Unused dependencies found" > $GITHUB_STEP_SUMMARY
echo '```console' >> $GITHUB_STEP_SUMMARY
echo "$unused_dependencies" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
exit 1
fi

0 comments on commit 3ec1ea8

Please sign in to comment.