-
-
Notifications
You must be signed in to change notification settings - Fork 454
43 lines (33 loc) · 1.09 KB
/
bloat.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# 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.ref }}
cancel-in-progress: true
jobs:
bloat:
name: Cargo Bloat
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- 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 oxc_cli --bin oxlint"
# 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