forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 0
220 lines (189 loc) · 10.8 KB
/
examples-openiotsdk.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# Copyright (c) 2021 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Build example - Open IoT SDK
on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:
merge_group:
workflow_dispatch:
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
cancel-in-progress: true
env:
CHIP_NO_LOG_TIMESTAMPS: true
jobs:
openiotsdk:
name: Open IoT SDK examples building
env:
TEST_NETWORK_NAME: OIStest
runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'
container:
image: ghcr.io/project-chip/chip-build-openiotsdk:54
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
options: --privileged
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout submodules & Bootstrap
uses: ./.github/actions/checkout-submodules-and-bootstrap
with:
platform: openiotsdk linux
extra-submodule-parameters: " --recursive"
- name: Set up environment for size reports
uses: ./.github/actions/setup-size-reports
if: ${{ !env.ACT }}
with:
gh-context: ${{ toJson(github) }}
- name: Build and install Python controller
run: |
scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv'
scripts/run_in_python_env.sh out/venv 'pip install -r scripts/setup/requirements.openiotsdk.txt'
- name: Build shell example
id: build_shell
run: |
scripts/examples/openiotsdk_example.sh shell
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
openiotsdk release shell \
examples/shell/openiotsdk/build/chip-openiotsdk-shell-example.elf \
/tmp/bloat_reports/
- name: "Test: shell example"
if: github.event_name == 'workflow_dispatch' && steps.build_shell.outcome == 'success'
run: |
scripts/run_in_python_env.sh out/venv \
'scripts/examples/openiotsdk_example.sh --no-activate -C test shell'
- name: Clean shell output
run: rm -rf examples/shell/openiotsdk/build
- name: Build lock-app example (mbedtls)
# Disabled being tracked here: https://github.com/project-chip/connectedhomeip/issues/28026
if: false
id: build_lock_app_mbedtls
run: |
scripts/examples/openiotsdk_example.sh -b mbedtls lock-app
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
openiotsdk release lock-app-mbedtls \
examples/lock-app/openiotsdk/build/chip-openiotsdk-lock-app-example.elf \
/tmp/bloat_reports/
- name: Build tv-app example
id: build_tv_app
timeout-minutes: 10
run: |
scripts/examples/openiotsdk_example.sh tv-app
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
openiotsdk release tv-app \
examples/tv-app/openiotsdk/build/chip-openiotsdk-tv-app-example.elf \
/tmp/bloat_reports/
- name: "Test: tv-app example"
if: github.event_name == 'workflow_dispatch' && steps.build_tv_app.outcome == 'success'
timeout-minutes: 10
run: |
scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up
scripts/run_in_python_env.sh out/venv \
'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'
scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down
- name: Clean tv-app output
run: rm -rf examples/tv-app/openiotsdk/build
- name: Build all-clusters-app example
id: build_all_clusters_app
timeout-minutes: 10
run: |
scripts/examples/openiotsdk_example.sh all-clusters-app
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
openiotsdk release all-clusters-app \
examples/all-clusters-app/openiotsdk/build/chip-openiotsdk-all-clusters-app-example.elf \
/tmp/bloat_reports/
- name: "Test: all-clusters-app example"
if: github.event_name == 'workflow_dispatch' && steps.build_all_clusters_app.outcome == 'success'
timeout-minutes: 5
run: |
scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up
scripts/run_in_python_env.sh out/venv \
'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'
scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down
- name: Clean all-clusters-app output
run: rm -rf examples/all-clusters-app/openiotsdk/build
- name: Build ota-requestor-app example
id: build_ota_requestor_app
timeout-minutes: 10
run: |
scripts/examples/openiotsdk_example.sh -v 1 -V 0.0.1 ota-requestor-app
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
openiotsdk release ota-requestor-app \
examples/ota-requestor-app/openiotsdk/build/chip-openiotsdk-ota-requestor-app-example.elf \
/tmp/bloat_reports/
- name: Build unit tests (mbedtls)
# Disabled being tracked here: https://github.com/project-chip/connectedhomeip/issues/28026
if: false
id: build_unit_tests_mbedtls
run: |
scripts/examples/openiotsdk_example.sh -b mbedtls unit-tests
- name: Build the OTA provider (Linux)
id: build_ota_provider_app
if: steps.build_ota_requestor_app.outcome == 'success'
timeout-minutes: 10
run: |
scripts/examples/gn_build_example.sh examples/ota-provider-app/linux/ out/ota-provider chip_config_network_layer_ble=false
- name: "Test: lock-app example (mbedtls)"
if: github.event_name == 'workflow_dispatch' && steps.build_lock_app_mbedtls.outcome == 'success'
run: |
scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up
scripts/run_in_python_env.sh out/venv \
'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'
scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down
- name: "Test: ota-requestor-app example"
if: github.event_name == 'workflow_dispatch' && steps.build_ota_requestor_app.outcome == 'success' && steps.build_ota_provider_app.outcome == 'success'
timeout-minutes: 30
run: |
mkdir out/binaries
cp examples/ota-requestor-app/openiotsdk/build/chip-openiotsdk-ota-requestor-app-example.elf out/binaries/
scripts/examples/openiotsdk_example.sh -c -v 2 -V 0.0.2 ota-requestor-app
cp examples/ota-requestor-app/openiotsdk/build/chip-openiotsdk-ota-requestor-app-example.ota out/binaries/
scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up
scripts/run_in_python_env.sh out/venv \
'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'
scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down
- name: "Test: unit-tests (mbedtls)"
if: github.event_name == 'workflow_dispatch' && steps.build_unit_tests_mbedtls.outcome == 'success'
run: |
scripts/run_in_python_env.sh out/venv \
'scripts/examples/openiotsdk_example.sh --no-activate -C test unit-tests'
- name: Build lock-app example (psa)
# Disabled being tracked here: https://github.com/project-chip/connectedhomeip/issues/28026
if: false
id: build_lock_app_psa
run: |
scripts/examples/openiotsdk_example.sh -c -b psa lock-app
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
openiotsdk release lock-app-psa \
examples/lock-app/openiotsdk/build/chip-openiotsdk-lock-app-example.elf \
/tmp/bloat_reports/
- name: "Test: lock-app example (psa)"
if: github.event_name == 'workflow_dispatch' && steps.build_lock_app_psa.outcome == 'success'
run: |
scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up
scripts/run_in_python_env.sh out/venv \
'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'
scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down
- name: Build unit tests (psa)
id: build_unit_tests_psa
run: |
scripts/examples/openiotsdk_example.sh -b psa unit-tests
- name: "Test: unit-tests (psa)"
if: github.event_name == 'workflow_dispatch' && steps.build_unit_tests_psa.outcome == 'success'
run: |
scripts/run_in_python_env.sh out/venv \
'scripts/examples/openiotsdk_example.sh --no-activate -C test unit-tests'