Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/orf/cargo-bloat-action
Track rust binary sizes across builds using Github Actions
https://github.com/orf/cargo-bloat-action
actions cargo github-actions rust
Last synced: 3 months ago
JSON representation
Track rust binary sizes across builds using Github Actions
- Host: GitHub
- URL: https://github.com/orf/cargo-bloat-action
- Owner: orf
- License: mit
- Created: 2019-12-28T17:03:07.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-27T10:01:20.000Z (about 2 years ago)
- Last Synced: 2024-10-26T05:39:13.345Z (3 months ago)
- Topics: actions, cargo, github-actions, rust
- Language: TypeScript
- Homepage:
- Size: 1.86 MB
- Stars: 96
- Watchers: 5
- Forks: 15
- Open Issues: 36
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cargo Bloat Action :rocket:
Analyse and track your Rust project binary size over time. This action runs on every pull request and gives you a breakdown of
your total binary size, how much each crate contributes to that size and a list of changes to your dependency tree.**Table of Contents**
* [Example workflow](#example-workflow)
* [Screenshots](#screenshots)
* [Why?](#why)
* [Contribute](#contribute)## Example Workflow
Check out [cargo-bloat-example](https://github.com/orf/cargo-bloat-example/) for a full example project. For an example pull request,
see https://github.com/orf/cargo-bloat-example/pull/1.```yaml
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- mastername: bloat
jobs:
cargo_bloat:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Run cargo bloat
uses: orf/cargo-bloat-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
```## Options
* `by_function` - Display per-function bloat instead of per-crate bloat
* `bloat_args` - Custom arguments to pass to `cargo bloat`
* `tree_args` - Custom arguments to pass to `cargo tree`
* `exclude_packages` - packages to exclude from running `cargo bloat` on (useful for projects unsupported by cargo bloat such as static libraries).## Screenshots
### Total size change
![](./images/comment.png)
### Size difference per crate
![](./images/breakdown.png)
### Changes in your dependency tree (`cargo tree`)
![](./images/dependencies.png)
## Why?
I think it's important to track the size of your dependencies. It's not the most important thing, but I think these metrics belong in a
pull request that modifies dependencies in order to have a full picture of the impact the change makes and to make an informed decision
before merging.## Contribute
All contributions are welcome!