Skip to content

Commit

Permalink
ci: clean up the bloat action
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed May 30, 2024
1 parent 83a1715 commit 42bb62c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 32 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/bloat.tmpl

This file was deleted.

27 changes: 17 additions & 10 deletions .github/workflows/bloat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,18 @@ jobs:
name: Cargo Bloat
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: taiki-e/checkout-action@v1
- uses: taiki-e/checkout-action@v1

- name: Cache
uses: Swatinem/rust-cache@v2

- name: Install cargo-bloat
uses: taiki-e/install-action@v2
- uses: Boshen/setup-rust@main
with:
tool: cargo-bloat
cache-key: warm
tools: cargo-bloat

- name: Run
env:
RUSTFLAGS: "-C debuginfo=2 -C strip=none"
run: |
export CMD="cargo bloat --profile release-debug -p oxlint --features allocator"
export CMD="cargo bloat -p oxlint --features allocator"
# Get largest functions
export BLOAT_FUNC_CMD="${CMD} -n 10"
Expand All @@ -40,4 +38,13 @@ jobs:
echo "${BLOAT_CRATE}"
# Render summary
envsubst < .github/workflows/bloat.tmpl > $GITHUB_STEP_SUMMARY
echo "# Bloat Summary" >> $GITHUB_STEP_SUMMARY
echo "## Largest functions" >> $GITHUB_STEP_SUMMARY
echo "```" >> $GITHUB_STEP_SUMMARY
echo "${BLOAT_FUNC}" >> $GITHUB_STEP_SUMMARY
echo "```" >> $GITHUB_STEP_SUMMARY
echo "## Largest crates" >> $GITHUB_STEP_SUMMARY
echo "```" >> $GITHUB_STEP_SUMMARY
echo "${BLOAT_CRATE}" >> $GITHUB_STEP_SUMMARY
echo "```" >> $GITHUB_STEP_SUMMARY
11 changes: 2 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,6 @@ opt-level = 'z'
opt-level = 3
lto = "fat"
codegen-units = 1
strip = "symbols"
debug = false
strip = "symbols" # set to `false` for debug information
debug = false # set to `true` for debug information
panic = "abort" # Let it crash and force ourselves to write safe Rust.

# Use the `--profile release-debug` flag to show symbols in release mode.
# e.g. `cargo build --profile release-debug`
[profile.release-debug]
inherits = "release"
strip = false
debug = true

0 comments on commit 42bb62c

Please sign in to comment.