Skip to content

PR code size Check#446

Open
Jean-Francois Penven (jepenven-silabs) wants to merge 1 commit intomainfrom
test_ci_code_size
Open

PR code size Check#446
Jean-Francois Penven (jepenven-silabs) wants to merge 1 commit intomainfrom
test_ci_code_size

Conversation

@jepenven-silabs
Copy link
Contributor

@jepenven-silabs Jean-Francois Penven (jepenven-silabs) commented Jan 21, 2026

Issue Link:
Fix MATTER-5919 For now it tracks the multi-sensor app as it's out smallest app configuration possibl

Description of Problem/Feature:
The goal is to prevent component changes bloat accross all samples. Should a fix or feature be needed for a specific use case, then the fix/feature should be apply only to that use case and not cause bloats accross all samples apps

Description of Fix/Solution:
Build the multi-sensor app on the PR and on the PR target branch and compare both code size. Fails should the threshold of increase is met.

Testing Done:

Tested with the CI of this PR.

Comment on lines 16 to 74
name: Code Size Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
submodules: "true" # Do not initialize submodules automatically

- name: Install tools
uses: ./.github/actions/install-tools

# TODO checkout PR target and build canary app on it.

- name: Build code-canary app
uses: SiliconLabsSoftware/matter_build_action@v2.0.0
with:
json-file-path: ".github/silabs-code-size.json"
path-to-example-app: "./slc/apps/multi-sensor-app/thread/multi-sensor-app.slcp"
example-app: code-canary
build-script: "./slc/build.sh"
output-directory: " "
build-type: "standard"
- name: Generate Code Size Result with current changes
shell: bash
run: |
./slc/script/code_size_result.sh ./out current.csv
- name: Checkout PR target branch
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.base.ref }}
submodules: "true"
- name: Build code-canary app on PR target
uses: SiliconLabsSoftware/matter_build_action@v2.0.0
with:
json-file-path: ".github/silabs-code-size.json"
path-to-example-app: "./slc/apps/multi-sensor-app/thread/multi-sensor-app.slcp"
example-app: code-canary
build-script: "./slc/build.sh"
output-directory: " "
build-type: "standard"
- name: Go back to PR branch
run: |
git checkout ${{ github.head_ref }}
- name: Generate Code Size Result with PR target
shell: bash
run: |
./slc/script/code_size_result.sh ./out target.csv
- name: Compare Code Size Results
shell: bash
run: |
cat ./target.csv
- name: Compare Code Size Results
shell: bash
run: |
ls -la ./
- name: Perform checks and display results
shell: bash
run: |
python3 ./slc/script/code_size_diff_check.py ./current.csv ./target.csv No newline at end of file

Check warning

Code scanning / CodeQL

Workflow does not contain permissions

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}
@jepenven-silabs Jean-Francois Penven (jepenven-silabs) force-pushed the test_ci_code_size branch 3 times, most recently from 8b32560 to bc967da Compare January 23, 2026 12:33
@jepenven-silabs Jean-Francois Penven (jepenven-silabs) changed the title [DO NOT MERGE !!!!!!!]Test ci code size PR code size Check Feb 13, 2026
@jepenven-silabs Jean-Francois Penven (jepenven-silabs) changed the base branch from test_code_ci_target to main February 13, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant