Skip to content

Commit fcf3432

Browse files
authored
TEST DO NOT MERGE (#52)
2 parents 7a983c7 + 8742502 commit fcf3432

File tree

961 files changed

+125188
-16622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

961 files changed

+125188
-16622
lines changed

.devcontainer/Dockerfile

+11
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ RUN apt-get update \
3737
valgrind \
3838
docker.io \
3939
iputils-ping \
40+
icecc \
4041
&& :
4142

4243
RUN groupadd -g $USER_GID $USERNAME \
@@ -80,3 +81,13 @@ ENV TIZEN_ROOTFS /tizen_rootfs
8081

8182
# Fast Model GDB plugins path for debugging support
8283
ENV FAST_MODEL_PLUGINS_PATH /opt/FastModelsPortfolio_11.16/plugins/Linux64_GCC-9.3
84+
85+
# Set up ccache as a pigweed command launcher when using the scripts/build/build_examples.py
86+
# script. Also, set up icecc as the command prefix for ccache. Such setup allows to benefit
87+
# from compilation caching and distributed compilation at the same time.
88+
#
89+
# NOTE: In order to use distributed compilation with icecc, one should run
90+
# "scripts/icecc.sh start" before starting the build.
91+
ENV CHIP_PW_COMMAND_LAUNCHER ccache
92+
ENV CCACHE_PREFIX icecc
93+
ENV PATH /usr/lib/ccache:$PATH

.github/.wordlist.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,7 @@ OpenThreadDemo
10061006
openweave
10071007
OperationalCredentials
10081008
operationalDataset
1009+
operationalstate
10091010
opkg
10101011
OPTIGA
10111012
optionMask

.github/workflows/build.yaml

+50-18
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ jobs:
157157
run: echo "$CONCURRENCY_CONTEXT"
158158
- name: Checkout
159159
uses: actions/checkout@v4
160+
with:
161+
fetch-depth: 2
162+
persist-credentials: true
160163
- name: Try to ensure the directories for core dumping exist and we
161164
can write them.
162165
run: |
@@ -186,6 +189,10 @@ jobs:
186189
- name: Clean output
187190
run: rm -rf ./out
188191
- name: Run Tests with sanitizers
192+
# Sanitizer tests are not likely to find extra issues so running the same tests
193+
# as above repeatedly on every pull request seems extra time. Instead keep this run
194+
# for master only
195+
if: github.event.pull_request.number == null
189196
env:
190197
LSAN_OPTIONS: detect_leaks=1
191198
run: |
@@ -201,17 +208,34 @@ jobs:
201208
BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" --export-compile-commands
202209
BUILD_TYPE=sanitizers scripts/tests/gn_tests.sh
203210
done
211+
- name: Generate tests with sanitizers (for tidy)
212+
if: github.event.pull_request.number != null
213+
run: |
214+
rm -rf ./out/sanitizers
215+
BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="is_clang=true is_asan=true chip_data_model_check_die_on_failure=true" --export-compile-commands
204216
- name: Ensure codegen is done for sanitize
205217
run: |
206218
./scripts/run_in_build_env.sh "./scripts/run_codegen_targets.sh out/sanitizers"
219+
- name: Find changed files
220+
id: changed-files
221+
uses: tj-actions/changed-files@v45
207222
- name: Clang-tidy validation
208223
# NOTE: clang-tidy crashes on CodegenDataModel_Write due to Nullable/std::optional check.
209224
# See https://github.com/llvm/llvm-project/issues/97426
225+
env:
226+
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
210227
run: |
228+
touch out/changed_files.txt
229+
for file in ${ALL_CHANGED_FILES}; do
230+
echo "$file changed and will be considered for tidy"
231+
echo "$file" >>out/changed_files.txt
232+
done
233+
211234
./scripts/run_in_build_env.sh \
212235
"./scripts/run-clang-tidy-on-compile-commands.py \
213236
--compile-database out/sanitizers/compile_commands.json \
214237
--file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|-ReadImpl|-InvokeSubscribeImpl|CodegenDataModel_Write|QuieterReporting' \
238+
--file-list-file out/changed_files.txt \
215239
check \
216240
"
217241
- name: Clean output
@@ -375,13 +399,16 @@ jobs:
375399
scripts/build_python_device.sh --chip_detail_logging true
376400
377401
build_darwin:
378-
name: Build on Darwin (clang, python_lib, simulated)
402+
name: Build on Darwin (clang, simulated)
379403
runs-on: macos-13
380404
if: github.actor != 'restyled-io[bot]'
381405

382406
steps:
383407
- name: Checkout
384408
uses: actions/checkout@v4
409+
with:
410+
fetch-depth: 2
411+
persist-credentials: true
385412
- name: Checkout submodules & Bootstrap
386413
uses: ./.github/actions/checkout-submodules-and-bootstrap
387414
with:
@@ -402,37 +429,42 @@ jobs:
402429
CHIP_ROOT_PATH=examples/placeholder/linux
403430
CHIP_ROOT_PATH="$CHIP_ROOT_PATH" BUILD_TYPE="$BUILD_TYPE" scripts/build/gn_gen.sh --args="$GN_ARGS"
404431
scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE"
405-
- name: Setup Build, Run Build and Run Tests
432+
- name: Setup Build, Run Build and Run Tests (asan + target_os=all)
406433
# We can't enable leak checking here in LSAN_OPTIONS, because on
407434
# Darwin that's only supported with a new enough clang, and we're
408435
# not building with the pigweed clang here.
436+
env:
437+
BUILD_TYPE: default
409438
run: |
410-
for BUILD_TYPE in default python_lib; do
411-
case $BUILD_TYPE in
412-
# We want to build various standalone example apps
413-
# (similar to what examples-linux-standalone.yaml
414-
# does), so use target_os="all" to get those picked
415-
# up as part of the "unified" build. But then to
416-
# save CI resources we want to exclude the
417-
# "host clang" build, which uses the pigweed
418-
# clang.
419-
"default") GN_ARGS='target_os="all" is_asan=true enable_host_clang_build=false';;
420-
esac
421-
BUILD_TYPE=$BUILD_TYPE scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" --export-compile-commands
422-
scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE"
423-
BUILD_TYPE=$BUILD_TYPE scripts/tests/gn_tests.sh
424-
done
425-
- name: Ensure codegen is done for sanitize
439+
# We want to build various standalone example apps (similar to what examples-linux-standalone.yaml
440+
# does), so use target_os="all" to get those picked up as part of the "unified" build. But then
441+
# to save CI resources we want to exclude the "host clang" build, which uses the pigweed clang.
442+
scripts/build/gn_gen.sh --args='target_os="all" is_asan=true enable_host_clang_build=false chip_data_model_check_die_on_failure=true' --export-compile-commands
443+
scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE"
444+
scripts/tests/gn_tests.sh
445+
- name: Ensure codegen is done for default
426446
run: |
427447
./scripts/run_in_build_env.sh "./scripts/run_codegen_targets.sh out/default"
448+
- name: Find changed files
449+
id: changed-files
450+
uses: tj-actions/changed-files@v45
428451
- name: Clang-tidy validation
429452
# NOTE: clang-tidy crashes on CodegenDataModel_Write due to Nullable/std::optional check.
430453
# See https://github.com/llvm/llvm-project/issues/97426
454+
env:
455+
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
431456
run: |
457+
touch out/changed_files.txt
458+
for file in ${ALL_CHANGED_FILES}; do
459+
echo "$file changed and will be considered for tidy"
460+
echo "$file" >>out/changed_files.txt
461+
done
462+
432463
./scripts/run_in_build_env.sh \
433464
"./scripts/run-clang-tidy-on-compile-commands.py \
434465
--compile-database out/default/compile_commands.json \
435466
--file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|CodegenDataModel_Write|QuieterReporting' \
467+
--file-list-file out/changed_files.txt \
436468
check \
437469
"
438470
- name: Uploading diagnostic logs
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright (c) 2024 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Cancel workflows on failing CI
16+
on:
17+
workflow_dispatch:
18+
schedule:
19+
- cron: "*/10 * * * *"
20+
21+
jobs:
22+
cancel_workflow:
23+
name: Cancel CI on failing pull requests
24+
25+
runs-on: ubuntu-latest
26+
27+
# Don't run on forked repos
28+
if: github.repository_owner == 'project-chip'
29+
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
- uses: actions/setup-python@v5
34+
with:
35+
python-version: '3.12'
36+
- name: Setup pip modules we use
37+
run: |
38+
pip install \
39+
click \
40+
coloredlogs \
41+
python-dateutil \
42+
pygithub \
43+
&& echo "DONE installint python prerequisites"
44+
- name: Cancel runs
45+
run: |
46+
scripts/tools/cancel_workflows_for_pr.py \
47+
--gh-api-token "${{ secrets.GITHUB_TOKEN }}" \
48+
--require "Restyled" \
49+
--require "Lint Code Base" \
50+
--require "ZAP" \
51+
--require "Run misspell" \
52+
--max-pr-age-minutes 20

.github/workflows/darwin-tests.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ jobs:
7373
platform: darwin
7474
bootstrap-log-name: bootstrap-logs-darwin-${{ matrix.build_variant }}
7575

76+
- name: Build iOS Darwin Framework Tool Build Debug
77+
working-directory: src/darwin/Framework
78+
run: xcodebuild -target "darwin-framework-tool" -sdk iphoneos -configuration Debug AD_HOC_CODE_SIGNING_ALLOWED=YES
79+
7680
- name: Run macOS Darwin Framework Tool Build Debug
7781
working-directory: src/darwin/Framework
7882
run: xcodebuild -target "darwin-framework-tool" -sdk macosx -configuration Debug

.github/workflows/examples-bouffalolab.yaml

+12-37
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,15 @@ jobs:
5858
run: |
5959
./scripts/run_in_build_env.sh \
6060
"./scripts/build/build_examples.py \
61-
--target bouffalolab-bl602dk-light-easyflash \
62-
--target bouffalolab-bl602dk-light-mfd-littlefs \
63-
--target bouffalolab-bl602dk-light-rpc-115200-littlefs \
61+
--target bouffalolab-bl602dk-light-mfd-littlefs-rpc-115200 \
6462
build \
6563
--copy-artifacts-to out/artifacts \
6664
"
6765
- name: Prepare some bloat report from the previous builds
6866
run: |
6967
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
70-
bl602 bl602 lighting-app \
71-
out/artifacts/bouffalolab-bl602dk-light-easyflash/chip-bl602-lighting-example.out \
72-
/tmp/bloat_reports/
73-
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
74-
bl602 bl602+mfd lighting-app \
75-
out/artifacts/bouffalolab-bl602dk-light-mfd-littlefs/chip-bl602-lighting-example.out \
76-
/tmp/bloat_reports/
77-
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
78-
bl602 bl602+rpc lighting-app \
79-
out/artifacts/bouffalolab-bl602dk-light-rpc-115200-littlefs/chip-bl602-lighting-example.out \
68+
bl602 bl602+mfd+littlefs+rpc lighting-app \
69+
out/artifacts/bouffalolab-bl602dk-light-mfd-littlefs-rpc-115200/chip-bl602-lighting-example.out \
8070
/tmp/bloat_reports/
8171
- name: Clean out build output
8272
run: rm -rf ./out
@@ -85,35 +75,25 @@ jobs:
8575
run: |
8676
./scripts/run_in_build_env.sh \
8777
"./scripts/build/build_examples.py \
88-
--target bouffalolab-bl706dk-light-easyflash \
89-
--target bouffalolab-bl706dk-light-mfd-littlefs \
90-
--target bouffalolab-bl706dk-light-ethernet-littlefs \
78+
--target bouffalolab-bl706dk-light-ethernet-easyflash \
9179
--target bouffalolab-bl706dk-light-wifi-littlefs \
92-
--target bouffalolab-bl706dk-light-rpc-115200-littlefs \
80+
--target bouffalolab-bl706dk-light-mfd-rpc-littlefs-115200 \
9381
build \
9482
--copy-artifacts-to out/artifacts \
9583
"
9684
- name: Prepare some bloat report from the previous builds
9785
run: |
9886
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
99-
bl702 bl702 lighting-app \
100-
out/artifacts/bouffalolab-bl706dk-light-easyflash/chip-bl702-lighting-example.out \
101-
/tmp/bloat_reports/
102-
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
103-
bl702 bl702+mfd lighting-app \
104-
out/artifacts/bouffalolab-bl706dk-light-mfd-littlefs/chip-bl702-lighting-example.out \
105-
/tmp/bloat_reports/
106-
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
107-
bl702 bl706-eth lighting-app \
108-
out/artifacts/bouffalolab-bl706dk-light-ethernet-littlefs/chip-bl702-lighting-example.out \
87+
bl702 bl702+eth lighting-app \
88+
out/artifacts/bouffalolab-bl706dk-light-ethernet-easyflash/chip-bl702-lighting-example.out \
10989
/tmp/bloat_reports/
11090
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
111-
bl702 bl706-wifi lighting-app \
91+
bl702 bl702+wifi lighting-app \
11292
out/artifacts/bouffalolab-bl706dk-light-wifi-littlefs/chip-bl702-lighting-example.out \
11393
/tmp/bloat_reports/
11494
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
115-
bl702 bl702+rpc lighting-app \
116-
out/artifacts/bouffalolab-bl706dk-light-rpc-115200-littlefs/chip-bl702-lighting-example.out \
95+
bl702 bl706+mfd+rpc+littlefs lighting-app \
96+
out/artifacts/bouffalolab-bl706dk-light-mfd-rpc-littlefs-115200/chip-bl702-lighting-example.out \
11797
/tmp/bloat_reports/
11898
- name: Clean out build output
11999
run: rm -rf ./out
@@ -123,19 +103,14 @@ jobs:
123103
run: |
124104
./scripts/run_in_build_env.sh \
125105
"./scripts/build/build_examples.py \
126-
--target bouffalolab-bl704ldk-light-easyflash \
127106
--target bouffalolab-bl704ldk-light-mfd-littlefs \
128107
build \
129108
--copy-artifacts-to out/artifacts \
130109
"
131110
- name: Prepare some bloat report from the previous builds
132111
run: |
133112
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
134-
bl702l bl702l lighting-app \
135-
out/artifacts/bouffalolab-bl704ldk-light-easyflash/chip-bl702l-lighting-example.out \
136-
/tmp/bloat_reports/
137-
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
138-
bl702l bl702l+mfd lighting-app \
113+
bl702l bl702l+mfd+littlefs lighting-app \
139114
out/artifacts/bouffalolab-bl704ldk-light-mfd-littlefs/chip-bl702l-lighting-example.out \
140115
/tmp/bloat_reports/
141116
- name: Clean out build output
@@ -145,4 +120,4 @@ jobs:
145120
uses: ./.github/actions/upload-size-reports
146121
if: ${{ !env.ACT }}
147122
with:
148-
platform-name: BouffaloLab
123+
platform-name: BouffaloLab

0 commit comments

Comments
 (0)