oxc/.github/workflows/bloat.yaml
2023-03-05 04:12:05 -08:00

41 lines
1 KiB
YAML

# Run `cargo bloat` for finding out what takes most of the space in your executable.
name: Bloat
on:
workflow_dispatch:
env:
CARGO_TERM_QUIET: true
jobs:
bloat:
name: Bloat
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Install cargo-bloat
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)
echo "$BLOAT_FUNC"
# Get largest crates
export BLOAT_CRATE=$(cargo bloat --profile release-debug --bin oxc_cli --crates -n 10)
echo "$BLOAT_CRATE"
# Get longest compile time
export BLOAT_TIME=$(cargo bloat --profile release-debug --bin oxc_cli --time -j 1)
echo "$BLOAT_TIME"
# Render summary
envsubst < .github/workflows/bloat.tmpl > $GITHUB_STEP_SUMMARY