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

[Merged by Bors] - add check for unused dependencies #2461

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .github/bors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ status = [
"run-examples",
"check-doc",
"check-missing-examples-in-docs",
"check-unused-dependencies",
]

use_squash_merge = true
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,22 @@ jobs:
file-types: '[".rs"]'
exclude-folders: '["./examples/ios"]'
exclude-files: '[]'

check-unused-dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true

- name: Installs cargo-udeps
run: cargo install cargo-udeps

- name: Install alsa and udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev

- name: Run cargo udeps
run: cargo udeps
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the last run of this job: To find dependencies that are not used by any target, enable '--all-targets'.
Since Bevy supports quite a few different targets, how about adding --all-targets here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Targets here means build targets (tests, examples, ...) not target triples. Using --all-targets would prevent detecting when regular dependencies could be dev-dependencies.