Skip to content

Commit

Permalink
[esp32] Enable light example compilation in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
chshu committed Jan 5, 2022
1 parent 99118d4 commit bfe13b2
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/examples-esp32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ jobs:
- name: Build example Pigweed App
timeout-minutes: 10
run: scripts/examples/esp_example.sh pigweed-app sdkconfig.defaults
- name: Build example Lighting App
timeout-minutes: 10
run: scripts/examples/esp_example.sh lighting-app sdkconfig.defaults
- name: Build example Lock App
timeout-minutes: 10
run: scripts/examples/esp_example.sh lock-app sdkconfig.defaults
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ set(EXTRA_COMPONENT_DIRS
"${IDF_PATH}/examples/common_components"
)

project(chip-light-app)
project(chip-lighting-app)

# C++17 is required for RPC build.
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND)
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 @@ -217,6 +217,7 @@ def Esp32Targets():
yield devkitc.Extend('all-clusters', app=Esp32App.ALL_CLUSTERS)
yield devkitc.Extend('all-clusters-ipv6only', app=Esp32App.ALL_CLUSTERS, enable_ipv4=False)
yield devkitc.Extend('shell', app=Esp32App.SHELL)
yield devkitc.Extend('light', app=Esp32App.LIGHT)
yield devkitc.Extend('lock', app=Esp32App.LOCK)
yield devkitc.Extend('bridge', app=Esp32App.BRIDGE)
yield devkitc.Extend('temperature-measurement', app=Esp32App.TEMPERATURE_MEASUREMENT)
Expand Down
5 changes: 5 additions & 0 deletions scripts/build/builders/esp32.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class Esp32Board(Enum):

class Esp32App(Enum):
ALL_CLUSTERS = auto()
LIGHT = auto()
LOCK = auto()
SHELL = auto()
BRIDGE = auto()
Expand All @@ -40,6 +41,8 @@ class Esp32App(Enum):
def ExamplePath(self):
if self == Esp32App.ALL_CLUSTERS:
return 'examples/all-clusters-app'
elif self == Esp32App.LIGHT:
return 'examples/lighting-app'
elif self == Esp32App.LOCK:
return 'examples/lock-app'
elif self == Esp32App.SHELL:
Expand All @@ -57,6 +60,8 @@ def ExamplePath(self):
def AppNamePrefix(self):
if self == Esp32App.ALL_CLUSTERS:
return 'chip-all-clusters-app'
elif self == Esp32App.LIGHT:
return 'chip-lighting-app'
elif self == Esp32App.LOCK:
return 'chip-lock-app'
elif self == Esp32App.SHELL:
Expand Down
1 change: 1 addition & 0 deletions scripts/build/testdata/all_targets_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ esp32-c3devkit-all-clusters
esp32-devkitc-all-clusters
esp32-devkitc-all-clusters-ipv6only
esp32-devkitc-bridge
esp32-devkitc-light
esp32-devkitc-lock
esp32-devkitc-shell
esp32-devkitc-temperature-measurement
Expand Down
18 changes: 18 additions & 0 deletions scripts/build/testdata/build_all_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,17 @@ bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh;
export SDKCONFIG_DEFAULTS={out}/esp32-devkitc-bridge/sdkconfig.defaults
idf.py -C examples/bridge-app/esp32 -B {out}/esp32-devkitc-bridge reconfigure'

# Generating esp32-devkitc-light
mkdir -p {out}/esp32-devkitc-light

cp examples/lighting-app/esp32/sdkconfig.defaults {out}/esp32-devkitc-light/sdkconfig.defaults

rm -f examples/lighting-app/esp32/sdkconfig

bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh;
export SDKCONFIG_DEFAULTS={out}/esp32-devkitc-light/sdkconfig.defaults
idf.py -C examples/lighting-app/esp32 -B {out}/esp32-devkitc-light reconfigure'

# Generating esp32-devkitc-lock
mkdir -p {out}/esp32-devkitc-lock

Expand Down Expand Up @@ -970,6 +981,13 @@ bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh;
export SDKCONFIG_DEFAULTS={out}/esp32-devkitc-bridge/sdkconfig.defaults
idf.py -C examples/bridge-app/esp32 -B {out}/esp32-devkitc-bridge build'

rm -f examples/lighting-app/esp32/sdkconfig

# Building esp32-devkitc-light
bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh;
export SDKCONFIG_DEFAULTS={out}/esp32-devkitc-light/sdkconfig.defaults
idf.py -C examples/lighting-app/esp32 -B {out}/esp32-devkitc-light build'

rm -f examples/lock-app/esp32/sdkconfig

# Building esp32-devkitc-lock
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 @@ -22,6 +22,7 @@ esp32-c3devkit-all-clusters
esp32-devkitc-all-clusters
esp32-devkitc-all-clusters-ipv6only
esp32-devkitc-bridge
esp32-devkitc-light
esp32-devkitc-lock
esp32-devkitc-shell
esp32-devkitc-temperature-measurement
Expand Down

0 comments on commit bfe13b2

Please sign in to comment.