oxc/.github/workflows/bloat.yml
Boshen 21505e885c refactor(cli): move crates/oxc_cli to apps/oxlint (#3413)
We need to split the cli crate up to reduce dependencies,
the current cli crate is pulling in `oxc_prettier`, which is redundant
for the linter.
2024-05-26 05:00:30 +00:00

43 lines
1.1 KiB
YAML

# Run `cargo bloat` for finding out what takes most of the space in your executable.
name: Cargo Bloat
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
bloat:
name: Cargo Bloat
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: taiki-e/checkout-action@v1
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Install cargo-bloat
uses: taiki-e/install-action@v2
with:
tool: cargo-bloat
- name: Run
run: |
export CMD="cargo bloat --profile release-debug -p oxlint --features allocator"
# Get largest functions
export BLOAT_FUNC_CMD="${CMD} -n 10"
export BLOAT_FUNC=`${BLOAT_FUNC_CMD}`
echo "${BLOAT_FUNC}"
# Get largest crates
export BLOAT_CRATE_CMD="${CMD} --crates -n 10"
export BLOAT_CRATE=`${BLOAT_CRATE_CMD}`
echo "${BLOAT_CRATE}"
# Render summary
envsubst < .github/workflows/bloat.tmpl > $GITHUB_STEP_SUMMARY