Skip to content

Commit

Permalink
ESP32: Optimize the time taken by esp32 workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
sweetymhaiske committed Jul 15, 2021
1 parent fd6e541 commit 21c701c
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 27 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/examples-esp32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,53 +61,69 @@ jobs:
.environment/gn_out/.ninja_log
.environment/pigweed-venv/*.log
- name: Build example All Clusters App
timeout-minutes: 25
run: scripts/examples/esp_example.sh all-clusters-app
timeout-minutes: 10
run: scripts/examples/esp_example.sh all-clusters-app sdkconfig_m5stack.defaults
- name: Copy aside build products
run: |
mkdir -p example_binaries/$BUILD_TYPE-build
cp examples/all-clusters-app/esp32/build/chip-all-clusters-app.elf \
example_binaries/$BUILD_TYPE-build/chip-all-clusters-app.elf
- name: Build example All Clusters App C3
timeout-minutes: 10
run: scripts/examples/esp_example.sh all-clusters-app sdkconfig_c3devkit.defaults
- name: Copy aside build products
run: |
mkdir -p example_binaries/$BUILD_TYPE-build
cp examples/all-clusters-app/esp32/build/chip-all-clusters-app.elf \
example_binaries/$BUILD_TYPE-build/chip-all-clusters-app.elf
- name: Build example Pigweed App
timeout-minutes: 5
run: scripts/examples/esp_example.sh pigweed-app
run: scripts/examples/esp_example.sh pigweed-app sdkconfig.defaults
- name: Copy aside build products
run: |
mkdir -p example_binaries/$BUILD_TYPE-build
cp examples/pigweed-app/esp32/build/chip-pigweed-app.elf \
example_binaries/$BUILD_TYPE-build/chip-pigweed-app.elf
- name: Build example Lock App
timeout-minutes: 5
run: scripts/examples/esp_example.sh lock-app
run: scripts/examples/esp_example.sh lock-app sdkconfig.defaults
- name: Copy aside build products
run: |
mkdir -p example_binaries/$BUILD_TYPE-build
cp examples/lock-app/esp32/build/chip-lock-app.elf \
example_binaries/$BUILD_TYPE-build/chip-lock-app.elf
- name: Build example Persistent Storage App
timeout-minutes: 5
run: scripts/examples/esp_example.sh persistent-storage
run: scripts/examples/esp_example.sh persistent-storage sdkconfig.defaults
- name: Copy aside build products
run: |
mkdir -p example_binaries/$BUILD_TYPE-build
cp examples/persistent-storage/esp32/build/chip-persistent-storage.elf \
example_binaries/$BUILD_TYPE-build/chip-persistent-storage.elf
- name: Build example Shell App
timeout-minutes: 5
run: scripts/examples/esp_example.sh shell
run: scripts/examples/esp_example.sh shell sdkconfig.defaults
- name: Copy aside build products
run: |
mkdir -p example_binaries/$BUILD_TYPE-build
cp examples/shell/esp32/build/chip-shell.elf \
example_binaries/$BUILD_TYPE-build/chip-shell.elf
- name: Build example Temperature Measurement App
timeout-minutes: 25
run: scripts/examples/esp_example.sh temperature-measurement-app
run: scripts/examples/esp_example.sh temperature-measurement-app sdkconfig.optimize.defaults
- name: Copy aside build products
run: |
mkdir -p example_binaries/$BUILD_TYPE-build
cp examples/temperature-measurement-app/esp32/build/chip-temperature-measurement-app.elf \
example_binaries/$BUILD_TYPE-build/chip-temperature-measurement-app.elf
- name: Build example IPV6 Only App
timeout-minutes: 5
run: scripts/examples/esp_example.sh chip-ipv6only-app sdkconfig.defaults
- name: Copy aside build products
run: |
mkdir -p example_binaries/$BUILD_TYPE-build
cp examples/ipv6only-app/esp32/build/chip-ipv6only-app.elf \
example_binaries/$BUILD_TYPE-build/chip-ipv6only-app.elf
- name: Binary artifact suffix
id: outsuffix
uses: haya14busa/[email protected]
Expand Down
38 changes: 18 additions & 20 deletions scripts/examples/esp_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ set -x
env

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

shift 1
Expand All @@ -33,23 +34,20 @@ source "scripts/activate.sh"
# shellcheck source=/dev/null
source "$IDF_PATH/export.sh"

for sdkconfig in "$root"/sdkconfig*.defaults; do
# remove root path to get sdkconfig*.defaults name
sdkconfig_name=${sdkconfig#"$root"/}
if [ "$sdkconfig_name" == "sdkconfig_c3devkit.defaults" ]; then
idf_target="esp32c3"
else
idf_target="esp32"
fi

rm -f "$root"/sdkconfig
(
cd "$root"
idf.py set-target "$idf_target"
idf.py -D SDKCONFIG_DEFAULTS="$sdkconfig_name" build
) || {
echo "build $sdkconfig_name failed"
exit 1
}
cp "$root"/build/chip-"$app".elf "$root"/build/"${sdkconfig_name%".defaults"}"-chip-"$app".elf
done
if [ "$sdkconfig_name" == "sdkconfig_c3devkit.defaults" ]; then
idf_target="esp32c3"
else
idf_target="esp32"
fi

rm -f "$root"/sdkconfig
(
cd "$root"
idf.py set-target "$idf_target"
idf.py -D SDKCONFIG_DEFAULTS="$sdkconfig_name" build
) || {
echo "build $sdkconfig_name failed"
exit 1
}
cp "$root"/build/chip-"$app".elf "$root"/build/"${sdkconfig_name%".defaults"}"-chip-"$app".elf

0 comments on commit 21c701c

Please sign in to comment.