examples-mbed.yaml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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 - Mbed OS
  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. mbedos:
  27. name: Mbed OS examples building
  28. env:
  29. PLATFORM_NAME: mbed
  30. APP_PROFILE: release
  31. APP_TARGET: cy8cproto_062_4343w
  32. runs-on: ubuntu-latest
  33. if: github.actor != 'restyled-io[bot]'
  34. container:
  35. image: ghcr.io/project-chip/chip-build-mbed-os:1
  36. volumes:
  37. - "/tmp/bloat_reports:/tmp/bloat_reports"
  38. steps:
  39. - name: Checkout
  40. uses: actions/checkout@v4
  41. - name: Checkout submodules & Bootstrap
  42. uses: ./.github/actions/checkout-submodules-and-bootstrap
  43. with:
  44. platform: mbed
  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 lock-app example
  51. run: |
  52. ./scripts/run_in_build_env.sh \
  53. "./scripts/build/build_examples.py \
  54. --target $PLATFORM_NAME-$APP_TARGET-lock-$APP_PROFILE \
  55. build \
  56. "
  57. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  58. $PLATFORM_NAME $APP_TARGET lock-app-$APP_PROFILE \
  59. out/$PLATFORM_NAME-$APP_TARGET-lock-$APP_PROFILE/chip-mbed-lock-app-example.elf \
  60. /tmp/bloat_reports/
  61. rm -rf ./out
  62. - name: Build lighting-app example
  63. if: github.event_name == 'push'
  64. run: |
  65. ./scripts/run_in_build_env.sh \
  66. "./scripts/build/build_examples.py \
  67. --target $PLATFORM_NAME-$APP_TARGET-light-$APP_PROFILE \
  68. build \
  69. "
  70. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  71. $PLATFORM_NAME $APP_TARGET lighting-app-$APP_PROFILE \
  72. out/$PLATFORM_NAME-$APP_TARGET-light-$APP_PROFILE/chip-mbed-lighting-app-example.elf \
  73. /tmp/bloat_reports/
  74. rm -rf ./out
  75. - name: Build pigweed-app example
  76. if: github.event_name == 'push'
  77. run: |
  78. ./scripts/run_in_build_env.sh \
  79. "./scripts/build/build_examples.py \
  80. --target $PLATFORM_NAME-$APP_TARGET-pigweed-$APP_PROFILE \
  81. build \
  82. "
  83. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  84. $PLATFORM_NAME $APP_TARGET pigweed-app-$APP_PROFILE \
  85. out/$PLATFORM_NAME-$APP_TARGET-pigweed-$APP_PROFILE/chip-mbed-pigweed-app-example.elf \
  86. /tmp/bloat_reports/
  87. rm -rf ./out
  88. - name: Build all-clusters-app example
  89. if: github.event_name == 'push'
  90. run: |
  91. ./scripts/run_in_build_env.sh \
  92. "./scripts/build/build_examples.py \
  93. --target $PLATFORM_NAME-$APP_TARGET-all-clusters-$APP_PROFILE \
  94. build \
  95. "
  96. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  97. $PLATFORM_NAME $APP_TARGET all-clusters-app-$APP_PROFILE \
  98. out/$PLATFORM_NAME-$APP_TARGET-all-clusters-$APP_PROFILE/chip-mbed-all-clusters-app-example.elf \
  99. /tmp/bloat_reports/
  100. rm -rf ./out
  101. - name: Build all-clusters-minimal-app example
  102. if: github.event_name == 'push'
  103. run: |
  104. ./scripts/run_in_build_env.sh \
  105. "./scripts/build/build_examples.py \
  106. --target $PLATFORM_NAME-$APP_TARGET-all-clusters-minimal-$APP_PROFILE \
  107. build \
  108. "
  109. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  110. $PLATFORM_NAME $APP_TARGET all-clusters-minimal-app-$APP_PROFILE \
  111. out/$PLATFORM_NAME-$APP_TARGET-all-clusters-minimal-$APP_PROFILE/chip-mbed-all-clusters-minimal-app-example.elf \
  112. /tmp/bloat_reports/
  113. rm -rf ./out
  114. - name: Build shell example
  115. if: github.event_name == 'push'
  116. run: |
  117. ./scripts/run_in_build_env.sh \
  118. "./scripts/build/build_examples.py \
  119. --target $PLATFORM_NAME-$APP_TARGET-shell-$APP_PROFILE \
  120. build \
  121. "
  122. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  123. $PLATFORM_NAME $APP_TARGET shell-app-$APP_PROFILE \
  124. out/$PLATFORM_NAME-$APP_TARGET-shell-$APP_PROFILE/chip-mbed-shell-example.elf \
  125. /tmp/bloat_reports/
  126. rm -rf ./out
  127. - name: Build ota-requestor-app example
  128. if: github.event_name == 'push'
  129. run: |
  130. ./scripts/run_in_build_env.sh \
  131. "./scripts/build/build_examples.py \
  132. --target $PLATFORM_NAME-$APP_TARGET-ota-requestor-$APP_PROFILE \
  133. build \
  134. "
  135. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  136. $PLATFORM_NAME $APP_TARGET ota-requestor-app-$APP_PROFILE \
  137. out/$PLATFORM_NAME-$APP_TARGET-ota-requestor-$APP_PROFILE/chip-mbed-ota-requestor-app-example.elf \
  138. /tmp/bloat_reports/
  139. rm -rf ./out
  140. - name: Build unit tests
  141. # Temporarily disable build due to running out of flash space
  142. if: false
  143. run: scripts/tests/mbed/mbed_unit_tests.sh -b=$APP_TARGET -p=$APP_PROFILE
  144. - name: Uploading Size Reports
  145. uses: ./.github/actions/upload-size-reports
  146. if: ${{ !env.ACT }}
  147. with:
  148. platform-name: Mbed