-
Notifications
You must be signed in to change notification settings - Fork 83
Add size reports #321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add size reports #321
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
070a102
Add size reports
gmarcosb ee8ddec
Copy size python scripts directly from C++ matter SDK instead of tryi…
gmarcosb cfb06ba
Necessary deps
gmarcosb a94313f
Add .idea to ignore
gmarcosb 7b1311d
Add memdf from Matter C++
gmarcosb a1fe542
Add bloat_check report to PR
gmarcosb feb4b07
Add note about where these came from
gmarcosb 7b235cb
Address review comments
gmarcosb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| name: Git safe directory | ||
| description: For running act with checkout owned by non-root user, e.g. docker | ||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Set git safe.directory to "*" | ||
| shell: bash | ||
| run: git config --system --add safe.directory '*' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| name: Setup size reports | ||
| description: Setup size reports | ||
| inputs: | ||
| gh-context: | ||
| description: "GH Context" | ||
| required: true | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - run: pip install numpy pandas humanfriendly pyelftools cxxfilt tabulate fastcore ghapi | ||
| shell: bash | ||
| - name: Set up environment for size reports | ||
| shell: bash | ||
| env: | ||
| GH_CONTEXT: ${{ inputs.gh-context }} | ||
| run: python scripts/memory/gh_sizes_environment.py "${GH_CONTEXT}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| name: upload-size-reports | ||
| description: upload-size-reports | ||
| inputs: | ||
| platform-name: | ||
| description: "Platform name Name" | ||
| required: true | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Uploading Size Reports | ||
| uses: actions/upload-artifact@v4 | ||
| if: ${{ !env.ACT }} | ||
| with: | ||
| name: Size,${{ inputs.platform-name }}-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }},${{ github.event_name }} | ||
| path: | | ||
| /tmp/bloat_reports/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # Copyright (c) 2020-2025 Project CHIP Authors | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| name: Bloat Check | ||
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: "*/5 * * * *" | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }} | ||
| # Don't cancel an already-running bloat check just because it took more | ||
| # than 5 minutes to run and our cron job is trying to schedule a new one. | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| pull_request_update: | ||
| name: Report on pull requests | ||
|
|
||
| # Don't run on forked repos | ||
| if: github.repository_owner == 'project-chip' | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| - name: Set up environment for size reports | ||
| uses: ./.github/actions/setup-size-reports | ||
| if: ${{ !env.ACT }} | ||
| with: | ||
| gh-context: ${{ toJson(github) }} | ||
| - name: Report | ||
| run: | | ||
| python scripts/memory/gh_report.py \ | ||
| --verbose \ | ||
| --report-increases 0.2 \ | ||
| --report-pr \ | ||
| --github-comment \ | ||
| --github-limit-artifact-pages 50 \ | ||
| --github-limit-artifacts 500 \ | ||
| --github-limit-comments 20 \ | ||
| --github-repository project-chip/rs-matter \ | ||
| --github-api-token "${{ secrets.GITHUB_TOKEN }}" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| schedule: | ||
| - cron: "50 6 * * *" | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| RUST_TOOLCHAIN: stable | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| CARGO_TERM_COLOR: always | ||
|
|
||
| jobs: | ||
| build_and_run_size_report: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Rust | ||
| uses: dtolnay/rust-toolchain@v1 | ||
| with: | ||
| toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
| components: rustfmt, clippy, rust-src | ||
|
|
||
| - name: Setup | Rust no-std target | ||
| run: rustup target add riscv32imac-unknown-none-elf | ||
|
|
||
| - name: Install libdbus | ||
| run: sudo apt-get install -y libdbus-1-dev | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Set up environment for size reports | ||
| uses: ./.github/actions/setup-size-reports | ||
| if: ${{ !env.ACT }} | ||
| with: | ||
| gh-context: ${{ toJson(github) }} | ||
|
|
||
| - name: Examples | ||
| run: cargo build --release --no-default-features --features os,rustcrypto,log | ||
|
|
||
| - name: Prepare bloat report from the previous builds | ||
| run: | | ||
| python scripts/memory/gh_sizes.py \ | ||
| linux rs-matter onoff-light \ | ||
| target/release/onoff_light \ | ||
| /tmp/bloat_reports/ | ||
| python scripts/memory/gh_sizes.py \ | ||
| linux rs-matter dimmable_light \ | ||
| target/release/dimmable_light \ | ||
| /tmp/bloat_reports/ | ||
| python scripts/memory/gh_sizes.py \ | ||
| linux rs-matter speaker \ | ||
| target/release/speaker \ | ||
| /tmp/bloat_reports/ | ||
|
|
||
| - name: Uploading Size Reports | ||
| uses: ./.github/actions/upload-size-reports | ||
| if: ${{ !env.ACT }} | ||
| with: | ||
| platform-name: linux |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| target | ||
| Cargo.lock | ||
| .vscode | ||
| .idea | ||
|
|
||
| # Nix | ||
| .devenv/ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Scripts copied from https://github.com/project-chip/connectedhomeip/tree/master/scripts/tools/memory |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.