Skip to content

Commit

Permalink
Add cargo-bloat-musl.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
koba-e964 committed Feb 26, 2024
1 parent d208e37 commit a8d1116
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/cargo-bloat-musl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Rust (cargo bloat, musl)

"on":
workflow_dispatch:
push:
branches: [master]
pull_request:
branches: [master]

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
cargo-bloat-version:
- "0.11.0"

steps:
- uses: actions/checkout@v4
- name: cargo version
run: cargo --version
- name: add target x86_64-unknown-linux-musl
run: rustup target add x86_64-unknown-linux-musl
- name: install cargo-bloat (v${{ matrix.cargo-bloat-version }})
run: cargo install cargo-bloat --version ${{ matrix.cargo-bloat-version }}
- name: cargo bloat --time (release)
run: cargo bloat --profile=release-cargo-bloat --time --jobs 1 --target x86_64-unknown-linux-musl
- name: cargo bloat (display, release)
run: cargo bloat --profile=release-cargo-bloat --target x86_64-unknown-linux-musl
- name: cargo bloat (display, per-crate, release)
run: cargo bloat --profile=release-cargo-bloat --crates --target x86_64-unknown-linux-musl
- name: cargo bloat (testing, release)
# Size <= 1MiB?
run: cargo bloat --profile=release-cargo-bloat --message-format json --target x86_64-unknown-linux-musl | jq --exit-status '."file-size" <= 1048576'

0 comments on commit a8d1116

Please sign in to comment.