ci: add cargo-unused

This commit is contained in:
Boshen 2023-03-05 22:09:28 +08:00
parent 2f9e3832a0
commit 5faae992b2
No known key found for this signature in database
GPG key ID: 9C7A8C8AB22BEBD1
2 changed files with 28 additions and 3 deletions

View file

@ -1,6 +1,6 @@
# Run `cargo bloat` for finding out what takes most of the space in your executable.
name: Bloat
name: Cargo Bloat
on:
workflow_dispatch:
@ -10,7 +10,7 @@ env:
jobs:
bloat:
name: Bloat
name: Cargo Bloat
runs-on: ubuntu-latest
steps:
- name: Checkout
@ -23,7 +23,6 @@ jobs:
run: cargo install cargo-bloat --no-default-features
- name: Run
id: size
run: |
# Get largest functions
export BLOAT_FUNC=$(cargo bloat --profile release-debug --bin oxc_cli -n 10)

26
.github/workflows/cargo-unused.yaml vendored Normal file
View file

@ -0,0 +1,26 @@
# Run `cargo-unused-features` for finding out unused features
name: Cargo Unused Features
on:
workflow_dispatch:
env:
CARGO_TERM_QUIET: true
jobs:
bloat:
name: Cargo Unused Features
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Install cargo-unused-features
run: cargo install cargo-unused-features
- name: Run
run: unused-features analyze