Skip to content

Commit

Permalink
CI: Add idf_target for esp_example.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
wqx6 committed Apr 2, 2024
1 parent 6c89640 commit 1b32c13
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/examples-esp32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ jobs:
rm -rf ./zzz_pregenerated
mv scripts/codegen.py.renamed scripts/codegen.py
mv scripts/tools/zap/generate.py.renamed scripts/tools/zap/generate.py
- name: Build example All Clusters App C3
run: scripts/examples/esp_example.sh all-clusters-app sdkconfig_c3devkit.defaults
- name: Build example All Clusters App(Target:ESP32C3)
run: scripts/examples/esp_example.sh all-clusters-app sdkconfig.defaults.esp32c3 esp32c3
- name: Copy aside build products
run: |
mkdir -p example_binaries/esp32-build
Expand All @@ -106,10 +106,10 @@ jobs:
run: scripts/examples/esp_example.sh pigweed-app sdkconfig.defaults

- name: Build example Lighting App (Target:ESP32H2)
run: scripts/examples/esp_example.sh lighting-app sdkconfig.defaults.esp32h2
run: scripts/examples/esp_example.sh lighting-app sdkconfig.defaults.esp32h2 esp32h2

- name: Build example Lock App (Target:ESP32C6)
run: scripts/examples/esp_example.sh lock-app sdkconfig.defaults.esp32c6
run: scripts/examples/esp_example.sh lock-app sdkconfig.defaults.esp32c6 esp32c6

- name: Uploading Size Reports
uses: ./.github/actions/upload-size-reports
Expand Down Expand Up @@ -155,10 +155,13 @@ jobs:
run: scripts/examples/esp_example.sh ota-provider-app sdkconfig.defaults

- name: Build example Light Switch App (Target:ESP32C3)
run: scripts/examples/esp_example.sh light-switch-app sdkconfig.defaults.esp32c3
run: scripts/examples/esp_example.sh light-switch-app sdkconfig.defaults.esp32c3 esp32c3

- name: Build example Lighting App (external platform)
run: scripts/examples/esp_example.sh lighting-app sdkconfig.ext_plat.defaults

- name: Build example Energy Management App
run: scripts/examples/esp_example.sh energy-management-app sdkconfig.defaults

- name: Build example LIT ICD App (Target:ESP32H2)
run: scripts/examples/esp_example.sh lit-icd-app sdkconfig.defaults esp32h2
13 changes: 7 additions & 6 deletions scripts/examples/esp_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ env

app="$1"
sdkconfig_name="$2"
idf_target="$3"
root=examples/$app/esp32

shift 1
Expand All @@ -30,16 +31,16 @@ if [ -z "$app" ]; then
exit 1
fi

source "$IDF_PATH/export.sh"
source "scripts/activate.sh"
# shellcheck source=/dev/null
supported_idf_target=("esp32" "esp32c3" "esp32c2" "esp32c6" "esp32s3" "esp32h2")

if [ "$sdkconfig_name" == "sdkconfig_c3devkit.defaults" ]; then
idf_target="esp32c3"
else
if [ -z "$idf_target" ] || [[ ! "${supported_idf_target[*]}" =~ "$idf_target" ]]; then
idf_target="esp32"
fi

source "$IDF_PATH/export.sh"
source "scripts/activate.sh"
# shellcheck source=/dev/null

rm -f "$root"/sdkconfig
(
cd "$root"
Expand Down

0 comments on commit 1b32c13

Please sign in to comment.