Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/actions/git-safe-directory/action.yaml
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 '*'
17 changes: 17 additions & 0 deletions .github/actions/setup-size-reports/action.yaml
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}"
17 changes: 17 additions & 0 deletions .github/actions/upload-size-reports/action.yaml
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/
55 changes: 55 additions & 0 deletions .github/workflows/bloat-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright (c) 2020-2025 Project CHIP Authors
Comment thread
gmarcosb marked this conversation as resolved.
#
# 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 }}"
65 changes: 65 additions & 0 deletions .github/workflows/size-check.yml
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
target
Cargo.lock
.vscode
.idea

# Nix
.devenv/
Expand Down
1 change: 1 addition & 0 deletions scripts/memory/README.md
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
Loading