Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9a60557

Browse files
feat(idf): Add ci.json support for IDF examples
1 parent ee6a288 commit 9a60557

File tree

7 files changed

+42
-5
lines changed

7 files changed

+42
-5
lines changed

‎.github/scripts/on-push-idf.sh‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
CHECK_REQUIREMENTS="./components/arduino-esp32/.github/scripts/sketch_utils.sh check_requirements"
6+
7+
# Export IDF environment
8+
. ${IDF_PATH}/export.sh
9+
10+
# Find all sub-folders in ./components/arduino-esp32/idf_component_examples and save them in a variable
11+
idf_component_examples=$(find ./components/arduino-esp32/idf_component_examples -type d)
12+
13+
for example in $idf_component_examples; do
14+
idf.py -C "$example" set-target "$IDF_TARGET"
15+
16+
has_requirements=$(${CHECK_REQUIREMENTS} "$example" "$example/sdkconfig")
17+
if [ "$has_requirements" -eq 1 ]; then
18+
echo "$example does not meet the requirements for $IDF_TARGET"
19+
continue
20+
fi
21+
22+
echo "Building $example"
23+
idf.py -C "$example" -DEXTRA_COMPONENT_DIRS="$PWD/components" build
24+
done

‎.github/workflows/push.yml‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ on:
3131
- "!libraries/**.properties"
3232
- "!libraries/**.py"
3333
- "package/**"
34+
- "idf_component_examples/**"
3435
- "tools/**.py"
3536
- "platform.txt"
3637
- "programmers.txt"
@@ -125,6 +126,7 @@ jobs:
125126
- 'Kconfig.projbuild'
126127
- 'CMakeLists.txt'
127128
- "variants/esp32c2/**/*"
129+
- "idf_component_examples/**"
128130
129131
- name: Set chunks
130132
id: set-chunks
@@ -271,11 +273,7 @@ jobs:
271273
env:
272274
IDF_TARGET: ${{ matrix.idf_target }}
273275
shell: bash
274-
run: |
275-
. ${IDF_PATH}/export.sh
276-
idf.py -C ./components/arduino-esp32/idf_component_examples/hello_world -DEXTRA_COMPONENT_DIRS=$PWD/components build
277-
idf.py -C ./components/arduino-esp32/idf_component_examples/hw_cdc_hello_world -DEXTRA_COMPONENT_DIRS=$PWD/components build
278-
idf.py -C ./components/arduino-esp32/idf_component_examples/esp_matter_light -DEXTRA_COMPONENT_DIRS=$PWD/components build
276+
run: ./components/arduino-esp32/.github/scripts/on-push-idf.sh
279277

280278
# Save artifacts to gh-pages
281279
save-master-artifacts:

‎idf_component_examples/esp_matter_light/CMakeLists.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ set(PROJECT_VER_NUMBER 1)
88
# This should be done before using the IDF_TARGET variable.
99
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
1010

11+
idf_build_set_property(MINIMAL_BUILD ON)
1112
project(arduino_managed_component_light)
1213

1314
# WARNING: This is just an example for using key for decrypting the encrypted OTA image
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"requires": [
3+
"CONFIG_SOC_WIFI_SUPPORTED=y",
4+
"CONFIG_ESP_MATTER_ENABLE_DATA_MODEL=y"
5+
]
6+
}

‎idf_component_examples/hello_world/CMakeLists.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
cmake_minimum_required(VERSION 3.16)
66

77
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
8+
9+
idf_build_set_property(MINIMAL_BUILD ON)
810
project(main)

‎idf_component_examples/hw_cdc_hello_world/CMakeLists.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ include($ENV{IDF_PATH}/tools/cmake/project.cmake)
99
list(APPEND compile_definitions "ARDUINO_USB_CDC_ON_BOOT=1")
1010
list(APPEND compile_definitions "ARDUINO_USB_MODE=1")
1111

12+
idf_build_set_property(MINIMAL_BUILD ON)
1213
project(hw_cdc_hello_world)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"requires": [
3+
"CONFIG_SOC_USB_SERIAL_JTAG_SUPPORTED=y"
4+
]
5+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /