Skip to content

Commit

Permalink
EFR32 add light switch example to CI (#15486)
Browse files Browse the repository at this point in the history
* Add light switch app to build example and CI. also add a wifi build to ci

* build wifi wf200 lock instead of rs911x. The need sdk is not available for the CI

* fix path for wf200 build

* fix typo
  • Loading branch information
jmartinez-silabs authored and pull[bot] committed Jan 19, 2024
1 parent 431ab82 commit 4430707
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/examples-efr32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,35 +63,38 @@ jobs:
.environment/pigweed-venv/*.log
- name: Build some BRD4161A variants
timeout-minutes: 30
timeout-minutes: 50
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--enable-flashbundle \
--target-glob '*-brd4161a-{lock,light,unit-test}' \
--target-glob '*-brd4161a-{lock,light,switch,window-covering,unit-test}' \
build \
--copy-artifacts-to out/artifacts \
"
- name: Prepare bloat report for light app
- name: Prepare some bloat report from the previous builds
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
efr32 BRD4161A lighting-app \
out/efr32-brd4161a-light/chip-efr32-lighting-example.out \
/tmp/bloat_reports/
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
efr32 BRD4161A window-app \
out/efr32-brd4161a-window-covering/chip-efr32-window-example.out \
/tmp/bloat_reports/
- name: Build example EFR32 Lighting App for BRD4161A with RPCs
timeout-minutes: 10
run: |
scripts/examples/gn_efr32_example.sh examples/lighting-app/efr32/ out/lighting_app_debug_rpc BRD4161A \
'import("//with_pw_rpc.gni")'
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A+rpc lighting-app \
out/lighting_app_debug_rpc/BRD4161A/chip-efr32-lighting-example.out /tmp/bloat_reports/
- name: Build example EFR32 Window Covering for BRD4161A
- name: Build example EFR32+WF200 WiFi Lock app for BRD4161A
timeout-minutes: 10
run: |
scripts/examples/gn_efr32_example.sh examples/window-app/efr32/ out/window_app_debug BRD4161A
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A window-app \
out/window_app_debug/BRD4161A/chip-efr32-window-example.out /tmp/bloat_reports/
scripts/examples/gn_efr32_example.sh examples/lock-app/efr32/ out/lock_app_wifi_wf200 BRD4161A --wifi wf200
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A+wf200 lock-app \
out/lock_app_wifi_wf200/BRD4161A/chip-efr32-lock-example.out /tmp/bloat_reports/
- name: Uploading Size Reports
uses: actions/upload-artifact@v2
if: ${{ !env.ACT }}
Expand Down
8 changes: 8 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,14 @@
"efr32-brd4186a-unit-test",
"efr32-brd4187a-unit-test",
"efr32-brd4304a-unit-test",
"efr32-brd4161a-switch",
"efr32-brd4163a-switch",
"efr32-brd4164a-switch",
"efr32-brd4166a-switch",
"efr32-brd4170a-switch",
"efr32-brd4186a-switch",
"efr32-brd4187a-switch",
"efr32-brd4304a-switch",
"efr32-brd4161a-window-covering",
"efr32-brd4163a-window-covering",
"efr32-brd4164a-window-covering",
Expand Down
1 change: 1 addition & 0 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ def Efr32Targets():

for board_target in board_targets:
yield board_target.Extend('window-covering', app=Efr32App.WINDOW_COVERING)
yield board_target.Extend('switch', app=Efr32App.SWITCH)
yield board_target.Extend('unit-test', app=Efr32App.UNIT_TEST)

rpc_aware_targets = [
Expand Down
7 changes: 7 additions & 0 deletions scripts/build/builders/efr32.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
class Efr32App(Enum):
LIGHT = auto()
LOCK = auto()
SWITCH = auto()
WINDOW_COVERING = auto()
UNIT_TEST = auto()

Expand All @@ -29,6 +30,8 @@ def ExampleName(self):
return 'lighting-app'
elif self == Efr32App.LOCK:
return 'lock-app'
elif self == Efr32App.SWITCH:
return 'light-switch-app'
elif self == Efr32App.WINDOW_COVERING:
return 'window-app'
else:
Expand All @@ -39,6 +42,8 @@ def AppNamePrefix(self):
return 'chip-efr32-lighting-example'
elif self == Efr32App.LOCK:
return 'chip-efr32-lock-example'
elif self == Efr32App.SWITCH:
return 'chip-efr32-light-switch-example'
elif self == Efr32App.WINDOW_COVERING:
return 'chip-efr32-window-example'
elif self == Efr32App.UNIT_TEST:
Expand All @@ -51,6 +56,8 @@ def FlashBundleName(self):
return 'lighting_app.flashbundle.txt'
elif self == Efr32App.LOCK:
return 'lock_app.flashbundle.txt'
elif self == Efr32App.SWITCH:
return 'light_switch_app.flashbundle.txt'
elif self == Efr32App.WINDOW_COVERING:
return 'window_app.flashbundle.txt'
elif self == Efr32App.UNIT_TEST:
Expand Down
8 changes: 8 additions & 0 deletions scripts/build/testdata/all_targets_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,48 +21,56 @@ efr32-brd4161a-light
efr32-brd4161a-light-rpc
efr32-brd4161a-lock
efr32-brd4161a-lock-rpc
efr32-brd4161a-switch
efr32-brd4161a-unit-test
efr32-brd4161a-window-covering
efr32-brd4163a-light (NOGLOB: only user requested)
efr32-brd4163a-light-rpc (NOGLOB: only user requested)
efr32-brd4163a-lock (NOGLOB: only user requested)
efr32-brd4163a-lock-rpc (NOGLOB: only user requested)
efr32-brd4163a-switch (NOGLOB: only user requested)
efr32-brd4163a-unit-test (NOGLOB: only user requested)
efr32-brd4163a-window-covering (NOGLOB: only user requested)
efr32-brd4164a-light (NOGLOB: only user requested)
efr32-brd4164a-light-rpc (NOGLOB: only user requested)
efr32-brd4164a-lock (NOGLOB: only user requested)
efr32-brd4164a-lock-rpc (NOGLOB: only user requested)
efr32-brd4164a-switch (NOGLOB: only user requested)
efr32-brd4164a-unit-test (NOGLOB: only user requested)
efr32-brd4164a-window-covering (NOGLOB: only user requested)
efr32-brd4166a-light (NOGLOB: only user requested)
efr32-brd4166a-light-rpc (NOGLOB: only user requested)
efr32-brd4166a-lock (NOGLOB: only user requested)
efr32-brd4166a-lock-rpc (NOGLOB: only user requested)
efr32-brd4166a-switch (NOGLOB: only user requested)
efr32-brd4166a-unit-test (NOGLOB: only user requested)
efr32-brd4166a-window-covering (NOGLOB: only user requested)
efr32-brd4170a-light (NOGLOB: only user requested)
efr32-brd4170a-light-rpc (NOGLOB: only user requested)
efr32-brd4170a-lock (NOGLOB: only user requested)
efr32-brd4170a-lock-rpc (NOGLOB: only user requested)
efr32-brd4170a-switch (NOGLOB: only user requested)
efr32-brd4170a-unit-test (NOGLOB: only user requested)
efr32-brd4170a-window-covering (NOGLOB: only user requested)
efr32-brd4186a-light (NOGLOB: only user requested)
efr32-brd4186a-light-rpc (NOGLOB: only user requested)
efr32-brd4186a-lock (NOGLOB: only user requested)
efr32-brd4186a-lock-rpc (NOGLOB: only user requested)
efr32-brd4186a-switch (NOGLOB: only user requested)
efr32-brd4186a-unit-test (NOGLOB: only user requested)
efr32-brd4186a-window-covering (NOGLOB: only user requested)
efr32-brd4187a-light (NOGLOB: only user requested)
efr32-brd4187a-light-rpc (NOGLOB: only user requested)
efr32-brd4187a-lock (NOGLOB: only user requested)
efr32-brd4187a-lock-rpc (NOGLOB: only user requested)
efr32-brd4187a-switch (NOGLOB: only user requested)
efr32-brd4187a-unit-test (NOGLOB: only user requested)
efr32-brd4187a-window-covering (NOGLOB: only user requested)
efr32-brd4304a-light (NOGLOB: only user requested)
efr32-brd4304a-light-rpc (NOGLOB: only user requested)
efr32-brd4304a-lock (NOGLOB: only user requested)
efr32-brd4304a-lock-rpc (NOGLOB: only user requested)
efr32-brd4304a-switch (NOGLOB: only user requested)
efr32-brd4304a-unit-test (NOGLOB: only user requested)
efr32-brd4304a-window-covering (NOGLOB: only user requested)
esp32-c3devkit-all-clusters
Expand Down
48 changes: 48 additions & 0 deletions scripts/build/testdata/build_all_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/exa
# Generating efr32-brd4161a-lock-rpc
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4161A" import("//with_pw_rpc.gni")' {out}/efr32-brd4161a-lock-rpc

# Generating efr32-brd4161a-switch
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/light-switch-app/efr32 '--args=efr32_board="BRD4161A"' {out}/efr32-brd4161a-switch

# Generating efr32-brd4161a-unit-test
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/src/test_driver/efr32 '--args=efr32_board="BRD4161A"' {out}/efr32-brd4161a-unit-test

Expand All @@ -205,6 +208,9 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/exa
# Generating efr32-brd4163a-lock-rpc
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4163A" import("//with_pw_rpc.gni")' {out}/efr32-brd4163a-lock-rpc

# Generating efr32-brd4163a-switch
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/light-switch-app/efr32 '--args=efr32_board="BRD4163A"' {out}/efr32-brd4163a-switch

# Generating efr32-brd4163a-unit-test
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/src/test_driver/efr32 '--args=efr32_board="BRD4163A"' {out}/efr32-brd4163a-unit-test

Expand All @@ -223,6 +229,9 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/exa
# Generating efr32-brd4164a-lock-rpc
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4164A" import("//with_pw_rpc.gni")' {out}/efr32-brd4164a-lock-rpc

# Generating efr32-brd4164a-switch
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/light-switch-app/efr32 '--args=efr32_board="BRD4164A"' {out}/efr32-brd4164a-switch

# Generating efr32-brd4164a-unit-test
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/src/test_driver/efr32 '--args=efr32_board="BRD4164A"' {out}/efr32-brd4164a-unit-test

Expand All @@ -241,6 +250,9 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/exa
# Generating efr32-brd4166a-lock-rpc
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4166A" import("//with_pw_rpc.gni")' {out}/efr32-brd4166a-lock-rpc

# Generating efr32-brd4166a-switch
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/light-switch-app/efr32 '--args=efr32_board="BRD4166A"' {out}/efr32-brd4166a-switch

# Generating efr32-brd4166a-unit-test
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/src/test_driver/efr32 '--args=efr32_board="BRD4166A"' {out}/efr32-brd4166a-unit-test

Expand All @@ -259,6 +271,9 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/exa
# Generating efr32-brd4170a-lock-rpc
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4170A" import("//with_pw_rpc.gni")' {out}/efr32-brd4170a-lock-rpc

# Generating efr32-brd4170a-switch
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/light-switch-app/efr32 '--args=efr32_board="BRD4170A"' {out}/efr32-brd4170a-switch

# Generating efr32-brd4170a-unit-test
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/src/test_driver/efr32 '--args=efr32_board="BRD4170A"' {out}/efr32-brd4170a-unit-test

Expand All @@ -277,6 +292,9 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/exa
# Generating efr32-brd4186a-lock-rpc
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4186A" import("//with_pw_rpc.gni")' {out}/efr32-brd4186a-lock-rpc

# Generating efr32-brd4186a-switch
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/light-switch-app/efr32 '--args=efr32_board="BRD4186A"' {out}/efr32-brd4186a-switch

# Generating efr32-brd4186a-unit-test
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/src/test_driver/efr32 '--args=efr32_board="BRD4186A"' {out}/efr32-brd4186a-unit-test

Expand All @@ -295,6 +313,9 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/exa
# Generating efr32-brd4187a-lock-rpc
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4187A" import("//with_pw_rpc.gni")' {out}/efr32-brd4187a-lock-rpc

# Generating efr32-brd4187a-switch
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/light-switch-app/efr32 '--args=efr32_board="BRD4187A"' {out}/efr32-brd4187a-switch

# Generating efr32-brd4187a-unit-test
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/src/test_driver/efr32 '--args=efr32_board="BRD4187A"' {out}/efr32-brd4187a-unit-test

Expand All @@ -313,6 +334,9 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/exa
# Generating efr32-brd4304a-lock-rpc
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4304A" import("//with_pw_rpc.gni")' {out}/efr32-brd4304a-lock-rpc

# Generating efr32-brd4304a-switch
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/light-switch-app/efr32 '--args=efr32_board="BRD4304A"' {out}/efr32-brd4304a-switch

# Generating efr32-brd4304a-unit-test
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/src/test_driver/efr32 '--args=efr32_board="BRD4304A"' {out}/efr32-brd4304a-unit-test

Expand Down Expand Up @@ -906,6 +930,9 @@ ninja -C {out}/efr32-brd4161a-lock
# Building efr32-brd4161a-lock-rpc
ninja -C {out}/efr32-brd4161a-lock-rpc

# Building efr32-brd4161a-switch
ninja -C {out}/efr32-brd4161a-switch

# Building efr32-brd4161a-unit-test
ninja -C {out}/efr32-brd4161a-unit-test

Expand All @@ -924,6 +951,9 @@ ninja -C {out}/efr32-brd4163a-lock
# Building efr32-brd4163a-lock-rpc
ninja -C {out}/efr32-brd4163a-lock-rpc

# Building efr32-brd4163a-switch
ninja -C {out}/efr32-brd4163a-switch

# Building efr32-brd4163a-unit-test
ninja -C {out}/efr32-brd4163a-unit-test

Expand All @@ -942,6 +972,9 @@ ninja -C {out}/efr32-brd4164a-lock
# Building efr32-brd4164a-lock-rpc
ninja -C {out}/efr32-brd4164a-lock-rpc

# Building efr32-brd4164a-switch
ninja -C {out}/efr32-brd4164a-switch

# Building efr32-brd4164a-unit-test
ninja -C {out}/efr32-brd4164a-unit-test

Expand All @@ -960,6 +993,9 @@ ninja -C {out}/efr32-brd4166a-lock
# Building efr32-brd4166a-lock-rpc
ninja -C {out}/efr32-brd4166a-lock-rpc

# Building efr32-brd4166a-switch
ninja -C {out}/efr32-brd4166a-switch

# Building efr32-brd4166a-unit-test
ninja -C {out}/efr32-brd4166a-unit-test

Expand All @@ -978,6 +1014,9 @@ ninja -C {out}/efr32-brd4170a-lock
# Building efr32-brd4170a-lock-rpc
ninja -C {out}/efr32-brd4170a-lock-rpc

# Building efr32-brd4170a-switch
ninja -C {out}/efr32-brd4170a-switch

# Building efr32-brd4170a-unit-test
ninja -C {out}/efr32-brd4170a-unit-test

Expand All @@ -996,6 +1035,9 @@ ninja -C {out}/efr32-brd4186a-lock
# Building efr32-brd4186a-lock-rpc
ninja -C {out}/efr32-brd4186a-lock-rpc

# Building efr32-brd4186a-switch
ninja -C {out}/efr32-brd4186a-switch

# Building efr32-brd4186a-unit-test
ninja -C {out}/efr32-brd4186a-unit-test

Expand All @@ -1014,6 +1056,9 @@ ninja -C {out}/efr32-brd4187a-lock
# Building efr32-brd4187a-lock-rpc
ninja -C {out}/efr32-brd4187a-lock-rpc

# Building efr32-brd4187a-switch
ninja -C {out}/efr32-brd4187a-switch

# Building efr32-brd4187a-unit-test
ninja -C {out}/efr32-brd4187a-unit-test

Expand All @@ -1032,6 +1077,9 @@ ninja -C {out}/efr32-brd4304a-lock
# Building efr32-brd4304a-lock-rpc
ninja -C {out}/efr32-brd4304a-lock-rpc

# Building efr32-brd4304a-switch
ninja -C {out}/efr32-brd4304a-switch

# Building efr32-brd4304a-unit-test
ninja -C {out}/efr32-brd4304a-unit-test

Expand Down
1 change: 1 addition & 0 deletions scripts/build/testdata/glob_star_targets_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ efr32-brd4161a-light
efr32-brd4161a-light-rpc
efr32-brd4161a-lock
efr32-brd4161a-lock-rpc
efr32-brd4161a-switch
efr32-brd4161a-unit-test
efr32-brd4161a-window-covering
esp32-c3devkit-all-clusters
Expand Down

0 comments on commit 4430707

Please sign in to comment.