ci: unused dependencies sanity check (#590)

* ci: add unused deps sanity check

* ci: fix unused deps issue template title

* ci: rename udeps job

* chore: formatting

* chore: make `cargo-udeps` ignore `aquamarine`

* deps: resolve unused deps

* ci: check every feature and target in udeps job
This commit is contained in:
Bjerg
2022-12-23 13:19:50 +01:00
committed by GitHub
parent 9d439d6fc8
commit 562e895f21
15 changed files with 74 additions and 42 deletions

View File

@ -0,0 +1,15 @@
---
title: "chore: some installed deps are not needed"
labels: C-debt, A-dependencies
---
Some dependencies specified in `Cargo.toml` are not needed.
Check the [unused dependencies sanity check]({{env.WORKFLOW_URL}}) workflow for details.
This issue was raised by the workflow at `.github/workflows/sanity.yml`.
> **Note**
> If this is a false positive, please refer to the [`cargo-udeps` docs][cargo-udeps-docs] on how to ignore the dependencies.
[cargo-udeps-docs]: https://github.com/est31/cargo-udeps#ignoring-some-of-the-dependencies

View File

@ -43,8 +43,6 @@ jobs:
- name: Install latest nextest release
uses: taiki-e/install-action@nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Update packages
run: cargo update
@ -60,3 +58,30 @@ jobs:
with:
update_existing: true
filename: .github/SANITY_DEPS_ISSUE_TEMPLATE.md
unused-deps:
# Pin to `20.04` instead of `ubuntu-latest`, until ubuntu-latest migration is complete
# See also <https://github.com/foundry-rs/foundry/issues/3827>
runs-on: ubuntu-20.04
name: unused dependencies
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Install cargo-udeps
run: cargo install cargo-udeps --locked
- name: Check for unused dependencies
run: cargo +nightly udeps --all-features --all-targets
- uses: JasonEtco/create-an-issue@v2
if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
update_existing: true
filename: .github/SANITY_UNUSED_DEPS_ISSUE_TEMPLATE.md