forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull request project-chip#3: Update CI scripts for Matter
Merge in WMN_TOOLS/matter from export_iot_code_size to silabs Squashed commit of the following: commit 094b86e7eba433b23fc5cf76e74939d1cd059ee3 Author: jepenven-silabs <[email protected]> Date: Mon May 9 12:27:36 2022 -0400 Update CI scripts for Matter
- Loading branch information
1 parent
d9a5c53
commit ada265e
Showing
4 changed files
with
171 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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,22 @@ | ||
####Imports | ||
import subprocess | ||
import sys | ||
import json | ||
import os | ||
import glob | ||
from pathlib import Path | ||
|
||
#Defines | ||
BOARDS = {"BRD4161A", "BRD4186A"} | ||
BUILDS = {"OpenThread"} | ||
BUILD_TYPES = {("standard", ""), ("release", "\"chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false is_debug=false show_qr_code=false chip_build_libshell=false enable_openthread_cli=false chip_openthread_ftd=true\"")} | ||
building_command = './scripts/examples/gn_efr32_example.sh ./silabs_examples/{app}/efr32 ./out/custom/{app}/{network} {board} {buildArguments}' | ||
|
||
for examples in glob.glob("./silabs_examples/*"): | ||
for build in BUILDS: | ||
for board in BOARDS: | ||
for build_type in BUILD_TYPES: | ||
parsed_path = examples.split('/') | ||
#Build all custom examples | ||
c = building_command.format(app=parsed_path[2], network=build + "/" + build_type[0], board=board, buildArguments=build_type[1]) | ||
val = subprocess.check_call(c, shell=True) |
This file contains 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,22 @@ | ||
####Imports | ||
import subprocess | ||
import sys | ||
import json | ||
from pathlib import Path | ||
|
||
#Defines | ||
APPS = {"lighting-app", "lock-app", "light-switch-app"} | ||
BOARDS = {"BRD4161A", "BRD4186A"} | ||
BUILDS = {"OpenThread"} | ||
BUILD_TYPES = {("standard", ""), ("release", "\"chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false is_debug=false show_qr_code=false chip_build_libshell=false enable_openthread_cli=false chip_openthread_ftd=true\"")} | ||
building_command = './scripts/examples/gn_efr32_example.sh ./examples/{app}/efr32 ./out/CSA/{app}{network} {board} {buildArguments}' | ||
|
||
#Build everything | ||
for build in BUILDS: | ||
for app_name in APPS: | ||
for board in BOARDS: | ||
for build_type in BUILD_TYPES: | ||
|
||
#Build all examples | ||
c = building_command.format(app=app_name, network= "/" + build + "/" + build_type[0], board=board, buildArguments=build_type[1]) | ||
val = subprocess.check_call(c, shell= True) |
This file contains 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,35 @@ | ||
####Imports | ||
import subprocess | ||
import sys | ||
import json | ||
from pathlib import Path | ||
import os | ||
|
||
print("Code size will run for CSA examples only") | ||
|
||
#Defines | ||
code_size_command = 'code_size_analyzer_cli --map_file {path} --stack_name matter --target_part {board} --compiler gcc --output_file {ouput_path}' | ||
output_folder_name = 'matter_{network}-{app}-{type}_{board}/gcc' | ||
complete_json_path = '{prefix}/{app}-{type}.json' | ||
|
||
found = False | ||
|
||
for root, dirs, files in os.walk("./out/CSA/"): | ||
for file in files: | ||
if file.endswith(".map"): | ||
found = True | ||
map_file_path = os.path.join(root, file) | ||
# Retrieve info from map file path | ||
build_info = map_file_path.replace("./out/CSA", "").split('/') | ||
|
||
# Generate JSON used for IoT code size report | ||
complete_output_path = "./out/iot_reports/" + output_folder_name.format(app=build_info[1], network=build_info[2], type=build_info[3], board=build_info[4]) | ||
print(complete_output_path) | ||
Path(complete_output_path).mkdir(parents=True, exist_ok=True) | ||
json_file_path = complete_json_path.format(prefix=complete_output_path, app=build_info[1], type=build_info[3]) | ||
d = code_size_command.format(path=map_file_path, board=build_info[4], ouput_path=json_file_path) | ||
val = subprocess.check_call(d, shell=True) | ||
|
||
if not found: | ||
print("Nothing found!!!") | ||
exit(1) |