diff --git a/.github/workflows/bloat.tmpl b/.github/workflows/bloat.tmpl deleted file mode 100644 index c334ff0dae8418..00000000000000 --- a/.github/workflows/bloat.tmpl +++ /dev/null @@ -1,13 +0,0 @@ -# Bloat Summary - -## Largest functions - -``` -${BLOAT_FUNC} -``` - -## Largest crates - -``` -${BLOAT_CRATE} -``` diff --git a/.github/workflows/bloat.yml b/.github/workflows/bloat.yml index 0b9297fb452fac..a1527646875a4d 100644 --- a/.github/workflows/bloat.yml +++ b/.github/workflows/bloat.yml @@ -14,30 +14,34 @@ 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" + shell: bash 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 + touch GITHUB_STEP_SUMMARY + echo "# Bloat Summary" >> GITHUB_STEP_SUMMARY + echo "" >> GITHUB_STEP_SUMMARY + + echo "## Largest functions" >> GITHUB_STEP_SUMMARY + echo "```" >> GITHUB_STEP_SUMMARY + echo "" >> GITHUB_STEP_SUMMARY + cargo bloat --release -p oxlint --features allocator -n 15 >> GITHUB_STEP_SUMMARY + echo "" >> GITHUB_STEP_SUMMARY + echo "```" >> GITHUB_STEP_SUMMARY + + echo "## Largest crates" >> GITHUB_STEP_SUMMARY + echo "```" >> GITHUB_STEP_SUMMARY + echo "" >> GITHUB_STEP_SUMMARY + `cargo bloat --release -p oxlint --features allocator --crates -n 15` >> GITHUB_STEP_SUMMARY + echo "" >> GITHUB_STEP_SUMMARY + echo "```" >> GITHUB_STEP_SUMMARY + + eat GITHUB_STEP_SUMMARY > $GITHUB_STEP_SUMMARY diff --git a/Cargo.toml b/Cargo.toml index a4f5f64f686222..2f4bf249fade75 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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