examples-openiotsdk.yaml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. # Copyright (c) 2021 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 - Open IoT SDK
  15. on:
  16. push:
  17. pull_request:
  18. merge_group:
  19. workflow_dispatch:
  20. concurrency:
  21. group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
  22. cancel-in-progress: true
  23. env:
  24. CHIP_NO_LOG_TIMESTAMPS: true
  25. jobs:
  26. openiotsdk:
  27. name: Open IoT SDK examples building
  28. env:
  29. TEST_NETWORK_NAME: OIStest
  30. runs-on: ubuntu-latest
  31. if: github.actor != 'restyled-io[bot]'
  32. container:
  33. image: ghcr.io/project-chip/chip-build-openiotsdk:1
  34. volumes:
  35. - "/tmp/bloat_reports:/tmp/bloat_reports"
  36. options: --privileged
  37. steps:
  38. - name: Checkout
  39. uses: actions/checkout@v4
  40. - name: Checkout submodules & Bootstrap
  41. uses: ./.github/actions/checkout-submodules-and-bootstrap
  42. with:
  43. platform: openiotsdk linux
  44. extra-submodule-parameters: " --recursive"
  45. - name: Set up environment for size reports
  46. uses: ./.github/actions/setup-size-reports
  47. if: ${{ !env.ACT }}
  48. with:
  49. gh-context: ${{ toJson(github) }}
  50. - name: Build and install Python controller
  51. run: |
  52. scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv'
  53. scripts/run_in_python_env.sh out/venv 'pip install -r scripts/setup/requirements.openiotsdk.txt'
  54. - name: Build shell example
  55. id: build_shell
  56. run: |
  57. scripts/examples/openiotsdk_example.sh shell
  58. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  59. openiotsdk release shell \
  60. examples/shell/openiotsdk/build/chip-openiotsdk-shell-example.elf \
  61. /tmp/bloat_reports/
  62. - name: "Test: shell example"
  63. if: steps.build_shell.outcome == 'success'
  64. run: |
  65. scripts/run_in_python_env.sh out/venv \
  66. 'scripts/examples/openiotsdk_example.sh --no-activate -C test shell'
  67. - name: Clean shell output
  68. run: rm -rf examples/shell/openiotsdk/build
  69. - name: Build lock-app example (mbedtls)
  70. # Disabled being tracked here: https://github.com/project-chip/connectedhomeip/issues/28026
  71. if: false
  72. id: build_lock_app_mbedtls
  73. run: |
  74. scripts/examples/openiotsdk_example.sh -b mbedtls lock-app
  75. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  76. openiotsdk release lock-app-mbedtls \
  77. examples/lock-app/openiotsdk/build/chip-openiotsdk-lock-app-example.elf \
  78. /tmp/bloat_reports/
  79. - name: Build tv-app example
  80. id: build_tv_app
  81. timeout-minutes: 10
  82. run: |
  83. scripts/examples/openiotsdk_example.sh tv-app
  84. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  85. openiotsdk release tv-app \
  86. examples/tv-app/openiotsdk/build/chip-openiotsdk-tv-app-example.elf \
  87. /tmp/bloat_reports/
  88. - name: "Test: tv-app example"
  89. if: steps.build_tv_app.outcome == 'success'
  90. timeout-minutes: 10
  91. run: |
  92. scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up
  93. scripts/run_in_python_env.sh out/venv \
  94. 'scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh --no-activate -C test -n ${TEST_NETWORK_NAME}tap tv-app'
  95. scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down
  96. - name: Clean tv-app output
  97. run: rm -rf examples/tv-app/openiotsdk/build
  98. - name: Build all-clusters-app example
  99. id: build_all_clusters_app
  100. timeout-minutes: 10
  101. run: |
  102. scripts/examples/openiotsdk_example.sh all-clusters-app
  103. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  104. openiotsdk release all-clusters-app \
  105. examples/all-clusters-app/openiotsdk/build/chip-openiotsdk-all-clusters-app-example.elf \
  106. /tmp/bloat_reports/
  107. - name: "Test: all-clusters-app example"
  108. if: steps.build_all_clusters_app.outcome == 'success'
  109. timeout-minutes: 5
  110. run: |
  111. scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up
  112. scripts/run_in_python_env.sh out/venv \
  113. 'scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh --no-activate -C test -n ${TEST_NETWORK_NAME}tap all-clusters-app'
  114. scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down
  115. - name: Clean all-clusters-app output
  116. run: rm -rf examples/all-clusters-app/openiotsdk/build
  117. - name: Build ota-requestor-app example
  118. id: build_ota_requestor_app
  119. timeout-minutes: 10
  120. run: |
  121. scripts/examples/openiotsdk_example.sh -v 1 -V 0.0.1 ota-requestor-app
  122. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  123. openiotsdk release ota-requestor-app \
  124. examples/ota-requestor-app/openiotsdk/build/chip-openiotsdk-ota-requestor-app-example.elf \
  125. /tmp/bloat_reports/
  126. - name: Build unit tests (mbedtls)
  127. # Disabled being tracked here: https://github.com/project-chip/connectedhomeip/issues/28026
  128. if: false
  129. id: build_unit_tests_mbedtls
  130. run: |
  131. scripts/examples/openiotsdk_example.sh -b mbedtls unit-tests
  132. - name: Build the OTA provider (Linux)
  133. id: build_ota_provider_app
  134. if: steps.build_ota_requestor_app.outcome == 'success'
  135. timeout-minutes: 10
  136. run: |
  137. scripts/examples/gn_build_example.sh examples/ota-provider-app/linux/ out/ota-provider chip_config_network_layer_ble=false
  138. - name: "Test: lock-app example (mbedtls)"
  139. if: steps.build_lock_app_mbedtls.outcome == 'success'
  140. run: |
  141. scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up
  142. scripts/run_in_python_env.sh out/venv \
  143. 'scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh --no-activate -C test -n ${TEST_NETWORK_NAME}tap lock-app'
  144. scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down
  145. - name: "Test: ota-requestor-app example"
  146. if: steps.build_ota_requestor_app.outcome == 'success' && steps.build_ota_provider_app.outcome == 'success'
  147. timeout-minutes: 30
  148. run: |
  149. mkdir out/binaries
  150. cp examples/ota-requestor-app/openiotsdk/build/chip-openiotsdk-ota-requestor-app-example.elf out/binaries/
  151. scripts/examples/openiotsdk_example.sh -c -v 2 -V 0.0.2 ota-requestor-app
  152. cp examples/ota-requestor-app/openiotsdk/build/chip-openiotsdk-ota-requestor-app-example.ota out/binaries/
  153. scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up
  154. scripts/run_in_python_env.sh out/venv \
  155. 'scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh --no-activate -p out/binaries -v 2 -V 0.0.2 -C test -n ${TEST_NETWORK_NAME}tap ota-requestor-app'
  156. scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down
  157. - name: "Test: unit-tests (mbedtls)"
  158. if: steps.build_unit_tests_mbedtls.outcome == 'success'
  159. run: |
  160. scripts/run_in_python_env.sh out/venv \
  161. 'scripts/examples/openiotsdk_example.sh --no-activate -C test unit-tests'
  162. - name: Build lock-app example (psa)
  163. # Disabled being tracked here: https://github.com/project-chip/connectedhomeip/issues/28026
  164. if: false
  165. id: build_lock_app_psa
  166. run: |
  167. scripts/examples/openiotsdk_example.sh -c -b psa lock-app
  168. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  169. openiotsdk release lock-app-psa \
  170. examples/lock-app/openiotsdk/build/chip-openiotsdk-lock-app-example.elf \
  171. /tmp/bloat_reports/
  172. - name: "Test: lock-app example (psa)"
  173. if: steps.build_lock_app_psa.outcome == 'success'
  174. run: |
  175. scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up
  176. scripts/run_in_python_env.sh out/venv \
  177. 'scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh --no-activate -C test -n ${TEST_NETWORK_NAME}tap lock-app'
  178. scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down
  179. - name: Build unit tests (psa)
  180. id: build_unit_tests_psa
  181. run: |
  182. scripts/examples/openiotsdk_example.sh -b psa unit-tests
  183. - name: "Test: unit-tests (psa)"
  184. if: steps.build_unit_tests_psa.outcome == 'success'
  185. run: |
  186. scripts/run_in_python_env.sh out/venv \
  187. 'scripts/examples/openiotsdk_example.sh --no-activate -C test unit-tests'