examples-nrfconnect.yaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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 - nRF Connect SDK
  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. nrfconnect:
  26. name: nRF Connect SDK
  27. env:
  28. BUILD_TYPE: nrfconnect
  29. runs-on: ubuntu-latest
  30. if: github.actor != 'restyled-io[bot]'
  31. container:
  32. image: ghcr.io/project-chip/chip-build-nrf-platform:1
  33. volumes:
  34. - "/tmp/bloat_reports:/tmp/bloat_reports"
  35. steps:
  36. - name: Checkout
  37. uses: actions/checkout@v4
  38. - name: Checkout submodules & Bootstrap
  39. uses: ./.github/actions/checkout-submodules-and-bootstrap
  40. with:
  41. platform: nrfconnect
  42. - name: Detect changed paths
  43. uses: dorny/paths-filter@v2
  44. id: changed_paths
  45. with:
  46. filters: |
  47. nrfconnect:
  48. - '**/nrfconnect/**'
  49. - '**/Zephyr/**'
  50. - '**/zephyr/**'
  51. tests:
  52. - '**/tests/**'
  53. shell:
  54. - 'examples/shell/nrfconnect/**'
  55. - name: Set up environment for size reports
  56. uses: ./.github/actions/setup-size-reports
  57. if: ${{ !env.ACT }}
  58. with:
  59. gh-context: ${{ toJson(github) }}
  60. - name: Check nRF Connect SDK revision.
  61. run: scripts/run_in_build_env.sh "python3 scripts/setup/nrfconnect/update_ncs.py --check"
  62. - name: Run unit tests of factory data generation script
  63. run: |
  64. scripts/run_in_build_env.sh 'pip3 install -r scripts/setup/requirements.nrfconnect.txt'
  65. scripts/run_in_build_env.sh "./scripts/tools/nrfconnect/tests/test_generate_factory_data.py"
  66. - name: Build example nRF Connect SDK Lock App on nRF52840 DK
  67. if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
  68. run: |
  69. scripts/examples/nrfconnect_example.sh lock-app nrf52840dk_nrf52840
  70. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  71. nrfconnect nrf52840dk_nrf52840 lock-app \
  72. examples/lock-app/nrfconnect/build/zephyr/zephyr.elf \
  73. /tmp/bloat_reports/
  74. - name: Build example nRF Connect SDK Lighting App on nRF52840 Dongle
  75. if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
  76. run: |
  77. scripts/examples/nrfconnect_example.sh lighting-app nrf52840dongle_nrf52840 -DCONF_FILE=prj_no_dfu.conf -DCONFIG_CHIP_ROTATING_DEVICE_ID=y
  78. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  79. nrfconnect nrf52840dongle_nrf52840 lighting-app \
  80. examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \
  81. /tmp/bloat_reports/
  82. - name: Build example nRF Connect SDK Lighting App on nRF52840 DK with RPC
  83. if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
  84. run: |
  85. scripts/examples/nrfconnect_example.sh lighting-app nrf52840dk_nrf52840 -DOVERLAY_CONFIG=rpc.overlay
  86. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  87. nrfconnect nrf52840dk_nrf52840+rpc lighting-app \
  88. examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \
  89. /tmp/bloat_reports/
  90. - name: Build example nRF Connect SDK Light Switch App on nRF52840 DK
  91. if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
  92. run: |
  93. scripts/examples/nrfconnect_example.sh light-switch-app nrf52840dk_nrf52840
  94. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  95. nrfconnect nrf52840dk_nrf52840 light-switch-app \
  96. examples/light-switch-app/nrfconnect/build/zephyr/zephyr.elf \
  97. /tmp/bloat_reports/
  98. - name: Build example nRF Connect SDK Shell on nRF52840 DK
  99. if: github.event_name == 'push' || steps.changed_paths.outputs.shell == 'true'
  100. run: |
  101. scripts/examples/nrfconnect_example.sh shell nrf52840dk_nrf52840
  102. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  103. nrfconnect nrf52840dk_nrf52840 shell \
  104. examples/shell/nrfconnect/build/zephyr/zephyr.elf \
  105. /tmp/bloat_reports/
  106. - name: Build example nRF Connect SDK Pump App on nRF52840 DK
  107. if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
  108. run: |
  109. scripts/examples/nrfconnect_example.sh pump-app nrf52840dk_nrf52840
  110. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  111. nrfconnect nrf52840dk_nrf52840 pump-app \
  112. examples/pump-app/nrfconnect/build/zephyr/zephyr.elf \
  113. /tmp/bloat_reports/
  114. - name: Build example nRF Connect SDK Pump Controller App on nRF52840 DK
  115. if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
  116. run: |
  117. scripts/examples/nrfconnect_example.sh pump-controller-app nrf52840dk_nrf52840
  118. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  119. nrfconnect nrf52840dk_nrf52840 pump-controller-app \
  120. examples/pump-controller-app/nrfconnect/build/zephyr/zephyr.elf \
  121. /tmp/bloat_reports/
  122. - name: Build example nRF Connect SDK All Clusters App on nRF52840 DK
  123. run: |
  124. scripts/examples/nrfconnect_example.sh all-clusters-app nrf52840dk_nrf52840
  125. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  126. nrfconnect nrf52840dk_nrf52840 all-clusters-app \
  127. examples/all-clusters-app/nrfconnect/build/zephyr/zephyr.elf \
  128. /tmp/bloat_reports/
  129. - name: Build example nRF Connect SDK All Clusters Minimal App on nRF52840 DK
  130. run: |
  131. scripts/examples/nrfconnect_example.sh all-clusters-minimal-app nrf52840dk_nrf52840 -DCONF_FILE=prj_dfu.conf
  132. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  133. nrfconnect nrf52840dk_nrf52840 all-clusters-minimal-app \
  134. examples/all-clusters-minimal-app/nrfconnect/build/zephyr/zephyr.elf \
  135. /tmp/bloat_reports/
  136. - name: Build example nRF Connect SDK Lock App on nRF5340 DK
  137. if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
  138. run: |
  139. scripts/examples/nrfconnect_example.sh lock-app nrf5340dk_nrf5340_cpuapp
  140. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  141. nrfconnect nrf5340dk_nrf5340_cpuapp lock-app \
  142. examples/lock-app/nrfconnect/build/zephyr/zephyr.elf \
  143. /tmp/bloat_reports/
  144. - name: Build example nRF Connect SDK Lighting App on nRF5340 DK
  145. if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
  146. run: |
  147. scripts/examples/nrfconnect_example.sh lighting-app nrf5340dk_nrf5340_cpuapp
  148. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  149. nrfconnect nrf5340dk_nrf5340_cpuapp lighting-app \
  150. examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \
  151. /tmp/bloat_reports/
  152. - name: Build example nRF Connect SDK Lock App on nRF7002 PDK
  153. if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
  154. run: |
  155. scripts/examples/nrfconnect_example.sh lock-app nrf7002dk_nrf5340_cpuapp
  156. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  157. nrfconnect nrf7002dk_nrf5340_cpuapp lock-app \
  158. examples/lock-app/nrfconnect/build/zephyr/zephyr.elf \
  159. /tmp/bloat_reports/
  160. - name: Build example nRF Connect SDK Light Switch App on nRF7002 PDK
  161. if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
  162. run: |
  163. scripts/examples/nrfconnect_example.sh light-switch-app nrf7002dk_nrf5340_cpuapp
  164. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  165. nrfconnect nrf7002dk_nrf5340_cpuapp light-switch-app \
  166. examples/light-switch-app/nrfconnect/build/zephyr/zephyr.elf \
  167. /tmp/bloat_reports/
  168. - name: Build example nRF Connect SDK Lighting App on nRF7002 PDK
  169. if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
  170. run: |
  171. scripts/examples/nrfconnect_example.sh lighting-app nrf7002dk_nrf5340_cpuapp
  172. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  173. nrfconnect nrf7002dk_nrf5340_cpuapp lighting-app \
  174. examples/light-switch-app/nrfconnect/build/zephyr/zephyr.elf \
  175. /tmp/bloat_reports/
  176. - name: Build example nRF Connect SDK All Clusters App on nRF7002 PDK
  177. run: |
  178. scripts/examples/nrfconnect_example.sh all-clusters-app nrf7002dk_nrf5340_cpuapp -DCONF_FILE=prj_release.conf
  179. .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
  180. nrfconnect nrf7002dk_nrf5340_cpuapp all-clusters-app \
  181. examples/all-clusters-app/nrfconnect/build/zephyr/zephyr.elf \
  182. /tmp/bloat_reports/
  183. - name: Run unit tests for Zephyr native_posix_64 platform
  184. if: github.event_name == 'push' || steps.changed_paths.outputs.tests == 'true' || steps.changed_paths.outputs.nrfconnect == 'true'
  185. run: |
  186. scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target nrf-native-posix-64-tests build"
  187. - name: Uploading Failed Test Logs
  188. uses: actions/upload-artifact@v3
  189. if: ${{ failure() && !env.ACT }}
  190. with:
  191. name: test-log
  192. path: |
  193. src/test_driver/nrfconnect/build/Testing/Temporary/LastTest.log
  194. - name: Uploading Size Reports
  195. uses: ./.github/actions/upload-size-reports
  196. if: ${{ !env.ACT }}
  197. with:
  198. platform-name: nRFConnect