Skip to content

Commit be7c31b

Browse files
JonathanPlassepull[bot]
authored andcommitted
Add cargo-udeps in CI (#3646)
1 parent 9b12350 commit be7c31b

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ jobs:
8585
name: ruff
8686
path: target/debug/ruff
8787

88-
8988
cargo-test-wasm:
9089
runs-on: ubuntu-latest
9190
name: "cargo test (wasm)"
@@ -176,3 +175,26 @@ jobs:
176175
with:
177176
name: ecosystem-result
178177
path: ecosystem-result
178+
179+
cargo-udeps:
180+
name: "cargo udeps"
181+
runs-on: ubuntu-latest
182+
steps:
183+
- uses: actions/checkout@v3
184+
- name: "Install Rust toolchain"
185+
run: rustup toolchain install nightly
186+
- name: "Install cargo-udeps"
187+
uses: taiki-e/install-action@cargo-udeps
188+
- name: "Run cargo-udeps"
189+
run: |
190+
unused_dependencies=$(cargo +nightly udeps > unused.txt && cat unused.txt | cut -d $'\n' -f 2-)
191+
if [ -z "$unused_dependencies" ]; then
192+
echo "No unused dependencies found" > $GITHUB_STEP_SUMMARY
193+
exit 0
194+
else
195+
echo "Unused dependencies found" > $GITHUB_STEP_SUMMARY
196+
echo '```console' >> $GITHUB_STEP_SUMMARY
197+
echo "$unused_dependencies" >> $GITHUB_STEP_SUMMARY
198+
echo '```' >> $GITHUB_STEP_SUMMARY
199+
exit 1
200+
fi

0 commit comments

Comments
 (0)