examples-esp32.yaml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. # Copyright (c) 2020 Project CHIP Authors
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. name: Build example - ESP32
  15. on:
  16. push:
  17. pull_request:
  18. merge_group:
  19. concurrency:
  20. group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
  21. cancel-in-progress: true
  22. env:
  23. CHIP_NO_LOG_TIMESTAMPS: true
  24. jobs:
  25. esp32:
  26. name: ESP32
  27. runs-on: ubuntu-latest
  28. if: github.actor != 'restyled-io[bot]'
  29. container:
  30. image: ghcr.io/project-chip/chip-build-esp32:2
  31. volumes:
  32. - "/tmp/bloat_reports:/tmp/bloat_reports"
  33. steps:
  34. - name: Checkout
  35. uses: actions/checkout@v4
  36. - name: Checkout submodules
  37. uses: ./.github/actions/checkout-submodules-and-bootstrap
  38. with:
  39. platform: esp32
  40. - name: Set up environment for size reports
  41. uses: ./.github/actions/setup-size-reports
  42. if: ${{ !env.ACT }}
  43. with:
  44. gh-context: ${{ toJson(github) }}
  45. - name: Build some M5Stack variations
  46. run: |
  47. ./scripts/run_in_build_env.sh \
  48. "./scripts/build/build_examples.py \
  49. --enable-flashbundle \
  50. --target esp32-m5stack-all-clusters \
  51. build \
  52. --copy-artifacts-to out/artifacts \
  53. "
  54. - name: Prepare bloat report
  55. run: |
  56. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  57. esp32 m5stack all-clusters-app \
  58. out/esp32-m5stack-all-clusters/chip-all-clusters-app.elf \
  59. /tmp/bloat_reports/
  60. - name: Prepare code pregen and ensure compile time pregen not possible
  61. run: |
  62. ./scripts/run_in_build_env.sh "./scripts/codepregen.py ./zzz_pregenerated"
  63. mv scripts/codegen.py scripts/codegen.py.renamed
  64. - name: Clean output
  65. run: rm -rf ./out
  66. - name: Build some M5Stack variations with pregen
  67. run: |
  68. ./scripts/run_in_build_env.sh \
  69. "./scripts/build/build_examples.py \
  70. --enable-flashbundle \
  71. --target esp32-m5stack-all-clusters-minimal \
  72. --target esp32-m5stack-all-clusters-rpc-ipv6only \
  73. --pregen-dir ./zzz_pregenerated \
  74. build \
  75. --copy-artifacts-to out/artifacts \
  76. "
  77. - name: Check no code generation in output
  78. run: |
  79. CNT=$(find out -name "CHIPClusters.h" | wc -l)
  80. if [ "${CNT}" != "0" ]; then
  81. echo "ERROR: found unexpected generated files:"
  82. find out -name "CHIPClusters.h"
  83. exit 1
  84. fi
  85. - name: Undo code pregeneration changes
  86. run: |
  87. rm -rf ./zzz_pregenerated
  88. mv scripts/codegen.py.renamed scripts/codegen.py
  89. - name: Build example All Clusters App C3
  90. run: scripts/examples/esp_example.sh all-clusters-app sdkconfig_c3devkit.defaults
  91. - name: Copy aside build products
  92. run: |
  93. mkdir -p example_binaries/esp32-build
  94. cp examples/all-clusters-app/esp32/build/chip-all-clusters-app.elf \
  95. example_binaries/esp32-build/chip-all-clusters-app.elf
  96. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  97. esp32 c3devkit all-clusters-app \
  98. example_binaries/esp32-build/chip-all-clusters-app.elf \
  99. /tmp/bloat_reports/
  100. - name: Build example Pigweed App
  101. run: scripts/examples/esp_example.sh pigweed-app sdkconfig.defaults
  102. - name: Build example Lighting App (Target:ESP32H2)
  103. run: scripts/examples/esp_example.sh lighting-app sdkconfig.defaults.esp32h2
  104. - name: Build example Lock App (Target:ESP32C6)
  105. run: scripts/examples/esp_example.sh lock-app sdkconfig.defaults.esp32c6
  106. - name: Uploading Size Reports
  107. uses: ./.github/actions/upload-size-reports
  108. if: ${{ !env.ACT }}
  109. with:
  110. platform-name: ESP32
  111. esp32_1:
  112. name: ESP32_1
  113. runs-on: ubuntu-latest
  114. if: github.actor != 'restyled-io[bot]'
  115. container:
  116. image: ghcr.io/project-chip/chip-build-esp32:2
  117. volumes:
  118. - "/tmp/bloat_reports:/tmp/bloat_reports"
  119. steps:
  120. - name: Checkout
  121. uses: actions/checkout@v4
  122. - name: Checkout submodules & Bootstrap
  123. uses: ./.github/actions/checkout-submodules-and-bootstrap
  124. with:
  125. platform: esp32
  126. - name: Build example Bridge App
  127. run: scripts/examples/esp_example.sh bridge-app
  128. - name: Build example Persistent Storage App
  129. run: scripts/examples/esp_example.sh persistent-storage sdkconfig.defaults
  130. - name: Build example Shell App
  131. run: scripts/examples/esp_example.sh shell sdkconfig.defaults
  132. - name: Build example Temperature Measurement App
  133. run: scripts/examples/esp_example.sh temperature-measurement-app sdkconfig.optimize.defaults
  134. - name: Build example OTA Requestor App
  135. run: scripts/examples/esp_example.sh ota-requestor-app sdkconfig.defaults
  136. - name: Build example OTA Provider App
  137. run: scripts/examples/esp_example.sh ota-provider-app sdkconfig.defaults
  138. - name: Build example Light Switch App (Target:ESP32C3)
  139. run: scripts/examples/esp_example.sh light-switch-app sdkconfig.defaults.esp32c3