tokio-rs / prost

PROST! a Protocol Buffers implementation for the Rust Language
Apache License 2.0
3.69k stars 481 forks source link

tests: Remove unused dependencies #1043

Closed caspermeijn closed 2 months ago

caspermeijn commented 3 months ago

Found these unused dependencies using: cargo +nightly udeps && cargo +nightly udeps --all-targets

gibbz00 commented 3 months ago

I would suggest adding this step to CI. E.g.

  unused_deps:
    name: Check for unused dependencies
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      ...
      - name: Run cargo-udeps
        uses: aig787/cargo-udeps-action@v1
        with:
          args: --all-features

Unsure if this has to be added in between:

with:
    submodules: 'recursive'
- name: install protoc
  uses: taiki-e/install-action@v2
  with:
    tool: protoc@${{ env.PROTOC_VERSION }}
- name: install ninja
  uses: ./.github/actions/setup-ninja

Also unsure if --benches, --tests, --examples and --bins are enabled by default.

caspermeijn commented 2 months ago

I would suggest adding this step to CI. E.g.

Good idea.

Unsure if this has to be added in between:

Yes, cargo-udeps does a full build and looks at the linked binary. So all dependencies are required.

Also unsure if --benches, --tests, --examples and --bins are enabled by default.

--all-targets will do that for you: https://doc.rust-lang.org/cargo/commands/cargo-build.html#target-selection