Skip to content

Commit

Permalink
TEST DO NOT MERGE (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykrupp authored Oct 15, 2024
2 parents 7a983c7 + 8742502 commit fcf3432
Show file tree
Hide file tree
Showing 961 changed files with 125,188 additions and 16,622 deletions.
11 changes: 11 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ RUN apt-get update \
valgrind \
docker.io \
iputils-ping \
icecc \
&& :

RUN groupadd -g $USER_GID $USERNAME \
Expand Down Expand Up @@ -80,3 +81,13 @@ ENV TIZEN_ROOTFS /tizen_rootfs

# Fast Model GDB plugins path for debugging support
ENV FAST_MODEL_PLUGINS_PATH /opt/FastModelsPortfolio_11.16/plugins/Linux64_GCC-9.3

# Set up ccache as a pigweed command launcher when using the scripts/build/build_examples.py
# script. Also, set up icecc as the command prefix for ccache. Such setup allows to benefit
# from compilation caching and distributed compilation at the same time.
#
# NOTE: In order to use distributed compilation with icecc, one should run
# "scripts/icecc.sh start" before starting the build.
ENV CHIP_PW_COMMAND_LAUNCHER ccache
ENV CCACHE_PREFIX icecc
ENV PATH /usr/lib/ccache:$PATH
1 change: 1 addition & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,7 @@ OpenThreadDemo
openweave
OperationalCredentials
operationalDataset
operationalstate
opkg
OPTIGA
optionMask
Expand Down
68 changes: 50 additions & 18 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ jobs:
run: echo "$CONCURRENCY_CONTEXT"
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
persist-credentials: true
- name: Try to ensure the directories for core dumping exist and we
can write them.
run: |
Expand Down Expand Up @@ -186,6 +189,10 @@ jobs:
- name: Clean output
run: rm -rf ./out
- name: Run Tests with sanitizers
# Sanitizer tests are not likely to find extra issues so running the same tests
# as above repeatedly on every pull request seems extra time. Instead keep this run
# for master only
if: github.event.pull_request.number == null
env:
LSAN_OPTIONS: detect_leaks=1
run: |
Expand All @@ -201,17 +208,34 @@ jobs:
BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" --export-compile-commands
BUILD_TYPE=sanitizers scripts/tests/gn_tests.sh
done
- name: Generate tests with sanitizers (for tidy)
if: github.event.pull_request.number != null
run: |
rm -rf ./out/sanitizers
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
- name: Ensure codegen is done for sanitize
run: |
./scripts/run_in_build_env.sh "./scripts/run_codegen_targets.sh out/sanitizers"
- name: Find changed files
id: changed-files
uses: tj-actions/changed-files@v45
- name: Clang-tidy validation
# NOTE: clang-tidy crashes on CodegenDataModel_Write due to Nullable/std::optional check.
# See https://github.com/llvm/llvm-project/issues/97426
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
touch out/changed_files.txt
for file in ${ALL_CHANGED_FILES}; do
echo "$file changed and will be considered for tidy"
echo "$file" >>out/changed_files.txt
done
./scripts/run_in_build_env.sh \
"./scripts/run-clang-tidy-on-compile-commands.py \
--compile-database out/sanitizers/compile_commands.json \
--file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|-ReadImpl|-InvokeSubscribeImpl|CodegenDataModel_Write|QuieterReporting' \
--file-list-file out/changed_files.txt \
check \
"
- name: Clean output
Expand Down Expand Up @@ -375,13 +399,16 @@ jobs:
scripts/build_python_device.sh --chip_detail_logging true
build_darwin:
name: Build on Darwin (clang, python_lib, simulated)
name: Build on Darwin (clang, simulated)
runs-on: macos-13
if: github.actor != 'restyled-io[bot]'

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
persist-credentials: true
- name: Checkout submodules & Bootstrap
uses: ./.github/actions/checkout-submodules-and-bootstrap
with:
Expand All @@ -402,37 +429,42 @@ jobs:
CHIP_ROOT_PATH=examples/placeholder/linux
CHIP_ROOT_PATH="$CHIP_ROOT_PATH" BUILD_TYPE="$BUILD_TYPE" scripts/build/gn_gen.sh --args="$GN_ARGS"
scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE"
- name: Setup Build, Run Build and Run Tests
- name: Setup Build, Run Build and Run Tests (asan + target_os=all)
# We can't enable leak checking here in LSAN_OPTIONS, because on
# Darwin that's only supported with a new enough clang, and we're
# not building with the pigweed clang here.
env:
BUILD_TYPE: default
run: |
for BUILD_TYPE in default python_lib; do
case $BUILD_TYPE in
# We want to build various standalone example apps
# (similar to what examples-linux-standalone.yaml
# does), so use target_os="all" to get those picked
# up as part of the "unified" build. But then to
# save CI resources we want to exclude the
# "host clang" build, which uses the pigweed
# clang.
"default") GN_ARGS='target_os="all" is_asan=true enable_host_clang_build=false';;
esac
BUILD_TYPE=$BUILD_TYPE scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" --export-compile-commands
scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE"
BUILD_TYPE=$BUILD_TYPE scripts/tests/gn_tests.sh
done
- name: Ensure codegen is done for sanitize
# We want to build various standalone example apps (similar to what examples-linux-standalone.yaml
# does), so use target_os="all" to get those picked up as part of the "unified" build. But then
# to save CI resources we want to exclude the "host clang" build, which uses the pigweed clang.
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
scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE"
scripts/tests/gn_tests.sh
- name: Ensure codegen is done for default
run: |
./scripts/run_in_build_env.sh "./scripts/run_codegen_targets.sh out/default"
- name: Find changed files
id: changed-files
uses: tj-actions/changed-files@v45
- name: Clang-tidy validation
# NOTE: clang-tidy crashes on CodegenDataModel_Write due to Nullable/std::optional check.
# See https://github.com/llvm/llvm-project/issues/97426
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
touch out/changed_files.txt
for file in ${ALL_CHANGED_FILES}; do
echo "$file changed and will be considered for tidy"
echo "$file" >>out/changed_files.txt
done
./scripts/run_in_build_env.sh \
"./scripts/run-clang-tidy-on-compile-commands.py \
--compile-database out/default/compile_commands.json \
--file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|CodegenDataModel_Write|QuieterReporting' \
--file-list-file out/changed_files.txt \
check \
"
- name: Uploading diagnostic logs
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/cancel_workflows_for_pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright (c) 2024 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: Cancel workflows on failing CI
on:
workflow_dispatch:
schedule:
- cron: "*/10 * * * *"

jobs:
cancel_workflow:
name: Cancel CI on failing pull requests

runs-on: ubuntu-latest

# Don't run on forked repos
if: github.repository_owner == 'project-chip'

steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Setup pip modules we use
run: |
pip install \
click \
coloredlogs \
python-dateutil \
pygithub \
&& echo "DONE installint python prerequisites"
- name: Cancel runs
run: |
scripts/tools/cancel_workflows_for_pr.py \
--gh-api-token "${{ secrets.GITHUB_TOKEN }}" \
--require "Restyled" \
--require "Lint Code Base" \
--require "ZAP" \
--require "Run misspell" \
--max-pr-age-minutes 20
4 changes: 4 additions & 0 deletions .github/workflows/darwin-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ jobs:
platform: darwin
bootstrap-log-name: bootstrap-logs-darwin-${{ matrix.build_variant }}

- name: Build iOS Darwin Framework Tool Build Debug
working-directory: src/darwin/Framework
run: xcodebuild -target "darwin-framework-tool" -sdk iphoneos -configuration Debug AD_HOC_CODE_SIGNING_ALLOWED=YES

- name: Run macOS Darwin Framework Tool Build Debug
working-directory: src/darwin/Framework
run: xcodebuild -target "darwin-framework-tool" -sdk macosx -configuration Debug
Expand Down
49 changes: 12 additions & 37 deletions .github/workflows/examples-bouffalolab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,15 @@ jobs:
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target bouffalolab-bl602dk-light-easyflash \
--target bouffalolab-bl602dk-light-mfd-littlefs \
--target bouffalolab-bl602dk-light-rpc-115200-littlefs \
--target bouffalolab-bl602dk-light-mfd-littlefs-rpc-115200 \
build \
--copy-artifacts-to out/artifacts \
"
- name: Prepare some bloat report from the previous builds
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
bl602 bl602 lighting-app \
out/artifacts/bouffalolab-bl602dk-light-easyflash/chip-bl602-lighting-example.out \
/tmp/bloat_reports/
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
bl602 bl602+mfd lighting-app \
out/artifacts/bouffalolab-bl602dk-light-mfd-littlefs/chip-bl602-lighting-example.out \
/tmp/bloat_reports/
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
bl602 bl602+rpc lighting-app \
out/artifacts/bouffalolab-bl602dk-light-rpc-115200-littlefs/chip-bl602-lighting-example.out \
bl602 bl602+mfd+littlefs+rpc lighting-app \
out/artifacts/bouffalolab-bl602dk-light-mfd-littlefs-rpc-115200/chip-bl602-lighting-example.out \
/tmp/bloat_reports/
- name: Clean out build output
run: rm -rf ./out
Expand All @@ -85,35 +75,25 @@ jobs:
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target bouffalolab-bl706dk-light-easyflash \
--target bouffalolab-bl706dk-light-mfd-littlefs \
--target bouffalolab-bl706dk-light-ethernet-littlefs \
--target bouffalolab-bl706dk-light-ethernet-easyflash \
--target bouffalolab-bl706dk-light-wifi-littlefs \
--target bouffalolab-bl706dk-light-rpc-115200-littlefs \
--target bouffalolab-bl706dk-light-mfd-rpc-littlefs-115200 \
build \
--copy-artifacts-to out/artifacts \
"
- name: Prepare some bloat report from the previous builds
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
bl702 bl702 lighting-app \
out/artifacts/bouffalolab-bl706dk-light-easyflash/chip-bl702-lighting-example.out \
/tmp/bloat_reports/
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
bl702 bl702+mfd lighting-app \
out/artifacts/bouffalolab-bl706dk-light-mfd-littlefs/chip-bl702-lighting-example.out \
/tmp/bloat_reports/
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
bl702 bl706-eth lighting-app \
out/artifacts/bouffalolab-bl706dk-light-ethernet-littlefs/chip-bl702-lighting-example.out \
bl702 bl702+eth lighting-app \
out/artifacts/bouffalolab-bl706dk-light-ethernet-easyflash/chip-bl702-lighting-example.out \
/tmp/bloat_reports/
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
bl702 bl706-wifi lighting-app \
bl702 bl702+wifi lighting-app \
out/artifacts/bouffalolab-bl706dk-light-wifi-littlefs/chip-bl702-lighting-example.out \
/tmp/bloat_reports/
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
bl702 bl702+rpc lighting-app \
out/artifacts/bouffalolab-bl706dk-light-rpc-115200-littlefs/chip-bl702-lighting-example.out \
bl702 bl706+mfd+rpc+littlefs lighting-app \
out/artifacts/bouffalolab-bl706dk-light-mfd-rpc-littlefs-115200/chip-bl702-lighting-example.out \
/tmp/bloat_reports/
- name: Clean out build output
run: rm -rf ./out
Expand All @@ -123,19 +103,14 @@ jobs:
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target bouffalolab-bl704ldk-light-easyflash \
--target bouffalolab-bl704ldk-light-mfd-littlefs \
build \
--copy-artifacts-to out/artifacts \
"
- name: Prepare some bloat report from the previous builds
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
bl702l bl702l lighting-app \
out/artifacts/bouffalolab-bl704ldk-light-easyflash/chip-bl702l-lighting-example.out \
/tmp/bloat_reports/
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
bl702l bl702l+mfd lighting-app \
bl702l bl702l+mfd+littlefs lighting-app \
out/artifacts/bouffalolab-bl704ldk-light-mfd-littlefs/chip-bl702l-lighting-example.out \
/tmp/bloat_reports/
- name: Clean out build output
Expand All @@ -145,4 +120,4 @@ jobs:
uses: ./.github/actions/upload-size-reports
if: ${{ !env.ACT }}
with:
platform-name: BouffaloLab
platform-name: BouffaloLab
Loading

0 comments on commit fcf3432

Please sign in to comment.