-
Notifications
You must be signed in to change notification settings - Fork 166
/
.gitlab-ci.yml
577 lines (534 loc) · 20.5 KB
/
.gitlab-ci.yml
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
stages:
- docker_build
- build
- target_test
- docs
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
variables:
ESP_MATTER_PATH: "$CI_PROJECT_DIR"
BR_PATH: "$CI_PROJECT_DIR/esp-thread-br"
IDF_GITHUB_ASSETS: "dl.espressif.com/github_assets"
GIT_STRATEGY: fetch
GIT_SUBMODULE_STRATEGY: none
IDF_SKIP_CHECK_SUBMODULES: 1
# This folder was on the runner host
MATTER_CACHE_DIR: /cache/matter_build
# This variable represents the latest idf version supported for the target branch.
# Note: Do change this variable in case of idf version change MR.
IDF_CHECKOUT_REF: "v5.2.3"
# This variable represents the short hash of the connectedhomeip submodule.
# Note: Do change this short hash on submodule update MRs.
CHIP_SHORT_HASH: "43aa98c2d3"
DOCKER_IMAGE_NAME: "espressif/chip-idf"
.add_gitlab_ssh_key: &add_gitlab_ssh_key |
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo -n $GITLAB_KEY >> ~/.ssh/id_rsa_base64
base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
.get_build_caches: &get_build_caches
- |
if [ -d ${MATTER_CACHE_DIR}/ ]; then
echo "get matter_build cache ..."
mkdir -p .git/modules/
mkdir -p ~/.cache/pip/
mkdir -p ~/.cipd-cache-dir/
mkdir -p ~/.espressif/dist/
time rsync -a ${MATTER_CACHE_DIR}/git_modules/ .git/modules/ || true
time rsync -a ${MATTER_CACHE_DIR}/cache_pip/ ~/.cache/pip/ || true
time rsync -a ${MATTER_CACHE_DIR}/cipd_cache_dir/ ~/.cipd-cache-dir/ || true
time rsync -a ${MATTER_CACHE_DIR}/espressif_dist/ ~/.espressif/dist/ || true
fi
.update_build_caches: &update_build_caches
- |
if [ -d ${MATTER_CACHE_DIR}/ ]; then
echo "update matter_build cache ..."
time rsync -a .git/modules/ ${MATTER_CACHE_DIR}/git_modules/ || true
time rsync -a ~/.cache/pip/ ${MATTER_CACHE_DIR}/cache_pip/ || true
time rsync -a ~/.cipd-cache-dir/ ${MATTER_CACHE_DIR}/cipd_cache_dir/ || true
time rsync -a ~/.espressif/dist/ ${MATTER_CACHE_DIR}/espressif_dist/ || true
fi
.setup_ot_br: &setup_ot_br
- cd ${CI_PROJECT_DIR}
- apt-get install -y openssh-client
- git clone ${ESP_THREAD_BR_REPO_URL}
- cd ${BR_PATH}/examples/basic_thread_border_router
- git checkout v1.1
- idf.py set-target esp32s3
- idf.py build
.setup_ot_rcp: &setup_ot_rcp
- cd ${IDF_PATH}
- ./install.sh
- . ./export.sh
# fetch submodules
- export PYTHONPATH=${IDF_PATH}/tools/ci/python_packages/:${PYTHONPATH}
- pip install python-gitlab
- cd examples/openthread/ot_rcp
- idf.py set-target esp32h2
- idf.py build
.setup_idf: &setup_idf
- source ${IDF_PATH}/export.sh
- export PYTHONPATH=${IDF_PATH}/tools/ci/python_packages/:${PYTHONPATH}
- pip install python-gitlab
- cd ${IDF_PATH}
.setup_matter: &setup_matter
- cd ${ESP_MATTER_PATH}
- ./install.sh --no-host-tool --no-bootstrap
- rm -rf connectedhomeip/connectedhomeip # Remove submodule directory
- ln -s ${CHIP_SUBMODULE_PATH} connectedhomeip/connectedhomeip # Create symlink to specified CHIP_SUBMODULE_PATH
- cd ${ESP_MATTER_PATH}
- . ./export.sh
.build_matter_examples: &build_matter_examples
- export MATTER_EXAMPLES_PATH=$ESP_MATTER_PATH/connectedhomeip/connectedhomeip/examples
- cd $MATTER_EXAMPLES_PATH/all-clusters-app/esp32
- idf.py build
- cd $MATTER_EXAMPLES_PATH/temperature-measurement-app/esp32
- idf.py build
- cd $MATTER_EXAMPLES_PATH/lock-app/esp32
- idf.py build
- cd $MATTER_EXAMPLES_PATH/pigweed-app/esp32
- idf.py build
- cd $MATTER_EXAMPLES_PATH/persistent-storage/esp32
- idf.py build
.build_external_platform_example: &build_external_platform_example
- rm -rf ${ESP_MATTER_PATH}/../platform
- mkdir -p ${ESP_MATTER_PATH}/../platform
- cp -r ${CHIP_SUBMODULE_PATH}/src/platform/ESP32 $ESP_MATTER_PATH/../platform/ESP32_custom
- cp ${ESP_MATTER_PATH}/examples/common/external_platform/BUILD.gn $ESP_MATTER_PATH/../platform/ESP32_custom
- cd ${ESP_MATTER_PATH}/examples/light
- cp sdkconfig.defaults sdkconfig.defaults.backup
- cp sdkconfig.defaults.ext_plat_ci sdkconfig.defaults
- idf.py set-target esp32
- idf.py build
- cp sdkconfig.defaults.backup sdkconfig.defaults
.build_esp32c6_thread_example: &build_esp32c6_thread_example
- cd $ESP_MATTER_PATH/examples/light
- cp sdkconfig.defaults.esp32c6 sdkconfig.defaults.c6_backup
- cp sdkconfig.defaults.c6_thread sdkconfig.defaults.esp32c6
- idf.py set-target esp32c6
- idf.py build
- cp sdkconfig.defaults.c6_backup sdkconfig.defaults.esp32c6
.build_esp32c6_wifi_thread_example: &build_esp32c6_wifi_thread_example
- cd $ESP_MATTER_PATH/examples/light
- cp sdkconfig.defaults.esp32c6 sdkconfig.defaults.c6_backup
- cp sdkconfig.defaults.c6_wifi_thread sdkconfig.defaults.esp32c6
- idf.py set-target esp32c6
- idf.py build
- cp sdkconfig.defaults.c6_backup sdkconfig.defaults.esp32c6
.build_controller_otbr_example: &build_controller_otbr_example
- cd $ESP_MATTER_PATH/examples/controller
- idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.otbr" set-target esp32s3 build
build_image:
stage: docker_build
image: espressif/dind:1
tags:
- amd64
- dind
- internet
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH == "main"
before_script:
- mkdir -p $HOME/.docker
- echo $DOCKER_AUTH_CONFIG > $HOME/.docker/config.json
script:
- cd ${ESP_MATTER_PATH}
- chip_head_commit=$(git rev-parse HEAD:connectedhomeip/connectedhomeip)
- chip_head_in_readme=$(awk -F'[][]' '/commit \[.* of connectedhomeip/{print $2}' README.md)
# Check both conditions and collect errors
- commit_validation_error=0
- |
if echo "$chip_head_commit" | grep -q "^${chip_head_in_readme}"; then
echo "README.md is not in sync with the connectedhomeip submodule"
else
echo "Please update the README.md file with the latest commit hash of the connectedhomeip submodule"
commit_validation_error=1
fi
- |
if echo "${chip_head_commit}" | grep -q "^${CHIP_SHORT_HASH}"; then
echo "The CHIP_SHORT_HASH variable is set to correct value. Matches with current head commit"
else
echo "The CHIP_SHORT_HASH seems to be incorrect or you have updated the submodule but not the CHIP_SHORT_HASH variable above"
commit_validation_error=1
fi
# Exit with collected error status
- if [ $commit_validation_error -ne 0 ]; then exit 1; fi
- TAG="chip_${CHIP_SHORT_HASH}_idf_${IDF_VERSION}"
- echo $TAG
- |
url="https://hub.docker.com/v2/repositories/${DOCKER_IMAGE_NAME}/tags/${TAG}"
if wget -q --spider "$url"; then
echo "No Differences detected. The docker image with ${TAG} is present in docker hub. Skipping docker build "
else
echo "Differences detected. The docker image with ${TAG} is not present on docker hub. Triggering docker build due to submdoule update or idf version change in CI."
cd ${ESP_MATTER_PATH}/tools/docker/chip_idf
docker build --build-arg CHIP_CHECKOUT_REF=${chip_head_commit} --build-arg IDF_CHECKOUT_REF=${IDF_VERSION} --tag ${DOCKER_IMAGE_NAME}:${TAG} .
docker push ${DOCKER_IMAGE_NAME}:${TAG}
fi
parallel:
matrix:
# Change the idf version here in case of idf version change MR.
- IDF_VERSION:
- "v4.4.3"
- "v5.2.3"
.build_examples_template:
stage: build
image: ${DOCKER_IMAGE_NAME}:chip_${CHIP_SHORT_HASH}_idf_${IDF_CHECKOUT_REF}
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" || $CI_COMMIT_BRANCH == "main"
tags:
- build
# runner: `sudo mkdir -p /cache/matter_build/`
# gitlab-runner config: `volumes = ["/cache:/cache:rw"]`
- matter_cache
before_script:
- *add_gitlab_ssh_key
- *get_build_caches
- *setup_idf
- cd ${ESP_MATTER_PATH}
- mkdir -p ${REPOS_PATH}
- *setup_matter
# update caches only when setup succeed
- *update_build_caches
variables:
REPOS_PATH: "$CI_PROJECT_DIR/repos"
IDF_CCACHE_ENABLE: 1
.build_managed_component_light_example:
stage: build
image: ${DOCKER_IMAGE_NAME}:chip_${CHIP_SHORT_HASH}_idf_${IDF_CHECKOUT_REF}
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" || $CI_COMMIT_BRANCH == "main"
tags:
- build
- matter_cache
before_script:
- *add_gitlab_ssh_key
- *get_build_caches
- *setup_idf
- pip install 'idf-component-manager~=1.4.0'
- cd ${ESP_MATTER_PATH}
- mkdir -p ${REPOS_PATH}
- *update_build_caches
variables:
REPOS_PATH: "$CI_PROJECT_DIR/repos"
IDF_CCACHE_ENABLE: 1
build_esp_matter_examples_pytest_C6_idf_v5_1:
extends:
- .build_examples_template
needs:
- job: build_image
optional: true
artifacts:
paths:
- "examples/**/build*/size.json"
- "examples/**/build*/build_log.txt"
- "examples/**/build*/*.bin"
- "examples/**/build*/flasher_args.json"
- "examples/**/build*/config/sdkconfig.json"
- "examples/**/build*/bootloader/*.bin"
- "examples/**/build*/partition_table/*.bin"
when: always
expire_in: 4 days
script:
- cd ${ESP_MATTER_PATH}
- pip install -r tools/ci/requirements-build.txt
- python tools/ci/build_apps.py ./examples --pytest_c6
build_esp_matter_examples_pytest_H2_idf_v5_1:
extends:
- .build_examples_template
needs:
- job: build_image
optional: true
artifacts:
paths:
- "examples/**/build*/size.json"
- "examples/**/build*/build_log.txt"
- "examples/**/build*/*.bin"
- "examples/**/build*/flasher_args.json"
- "examples/**/build*/config/sdkconfig.json"
- "examples/**/build*/bootloader/*.bin"
- "examples/**/build*/partition_table/*.bin"
- "${IDF_PATH}/examples/openthread/ot_rcp/build/*.bin"
- "${IDF_PATH}/examples/openthread/ot_rcp/build/partition_table/*.bin"
- "${IDF_PATH}/examples/openthread/ot_rcp/build/bootloader/*.bin"
- "${IDF_PATH}/examples/openthread/ot_rcp/build/config/sdkconfig.json"
- "${IDF_PATH}/examples/openthread/ot_rcp/build/flasher_args.json"
- "${BR_PATH}/examples/basic_thread_border_router/build/*.bin"
- "${BR_PATH}/examples/basic_thread_border_router/build/partition_table/*.bin"
- "${BR_PATH}/examples/basic_thread_border_router/build/bootloader/*.bin"
- "${BR_PATH}/examples/basic_thread_border_router/build/config/sdkconfig.json"
- "${BR_PATH}/examples/basic_thread_border_router/build/flasher_args.json"
when: always
expire_in: 4 days
script:
- *setup_ot_rcp
- *setup_ot_br
- cd ${ESP_MATTER_PATH}
- pip install -r tools/ci/requirements-build.txt
- python tools/ci/build_apps.py ./examples --pytest_h2
build_esp_matter_examples_pytest_C2_idf_v5_1:
extends:
- .build_examples_template
needs:
- job: build_image
optional: true
artifacts:
paths:
- "examples/**/build*/size.json"
- "examples/**/build*/build_log.txt"
- "examples/**/build*/*.bin"
- "examples/**/build*/flasher_args.json"
- "examples/**/build*/config/sdkconfig.json"
- "examples/**/build*/bootloader/*.bin"
- "examples/**/build*/partition_table/*.bin"
when: always
expire_in: 4 days
script:
- cd ${ESP_MATTER_PATH}
- pip install -r tools/ci/requirements-build.txt
- python tools/ci/build_apps.py ./examples --pytest_c2
build_ext_plat_c6_thread_controller_examples:
extends:
- .build_examples_template
needs:
- job: build_image
optional: true
script:
- *build_external_platform_example
- *build_esp32c6_thread_example
- *build_esp32c6_wifi_thread_example
- *build_controller_otbr_example
build_esp_matter_examples:
extends:
- .build_examples_template
needs:
- job: build_image
optional: true
artifacts:
paths:
- "examples/**/build*/size.json"
- "examples/**/build*/build_log.txt"
- "examples/**/build*/*.bin"
- "examples/**/build*/flasher_args.json"
- "examples/**/build*/config/sdkconfig.json"
- "examples/**/build*/bootloader/*.bin"
- "examples/**/build*/partition_table/*.bin"
when: always
expire_in: 4 days
script:
# mfg_test_app needs an secure boot signing key, generating one here
- cd ${ESP_MATTER_PATH}/examples/mfg_test_app
- openssl genrsa -out secure_boot_signing_key.pem 3072
# steps for external platform build for blemesh_bridge app
- cd ${ESP_MATTER_PATH}/examples/bridge_apps/blemesh_bridge
- cp sdkconfig.defaults sdkconfig.defaults.backup
- cp sdkconfig.defaults.ext_plat_ci sdkconfig.defaults
# steps for external platform build for light_wifi_prov app
- cd ${ESP_MATTER_PATH}/examples/light_wifi_prov
- cp sdkconfig.defaults.esp32s3 sdkconfig.defaults.esp32s3.backup
- cp sdkconfig.defaults.esp32s3.ext_plat_ci sdkconfig.defaults.esp32s3
- cp sdkconfig.defaults.esp32c3 sdkconfig.defaults.esp32c3.backup
- cp sdkconfig.defaults.esp32c3.ext_plat_ci sdkconfig.defaults.esp32c3
- cd ${ESP_MATTER_PATH}
- pip install -r tools/ci/requirements-build.txt
- python tools/ci/build_apps.py ./examples --no_pytest
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
parallel: 2
build_nopytest_remaining_examples_manual:
extends:
- .build_examples_template
rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_SOURCE == "push"
when: on_success
- if: $CI_COMMIT_BRANCH != "main"
when: manual
allow_failure: true
needs:
- job: build_image
optional: true
artifacts:
paths:
- "examples/**/build*/size.json"
- "examples/**/build*/build_log.txt"
- "examples/**/build*/*.bin"
- "examples/**/build*/flasher_args.json"
- "examples/**/build*/config/sdkconfig.json"
- "examples/**/build*/bootloader/*.bin"
- "examples/**/build*/partition_table/*.bin"
when: always
expire_in: 4 days
script:
- cd ${ESP_MATTER_PATH}
- pip install -r tools/ci/requirements-build.txt
- python tools/ci/build_apps.py ./examples --no_pytest_remaining
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
parallel: 2
build_esp_matter_examples_pytest_C3_idf_v4_4:
extends:
- .build_examples_template
image: ${DOCKER_IMAGE_NAME}:chip_${CHIP_SHORT_HASH}_idf_${IDF_CHECKOUT_REF}
needs:
- job: build_image
optional: true
artifacts:
paths:
- "examples/**/build*/size.json"
- "examples/**/build*/build_log.txt"
- "examples/**/build*/*.bin"
- "examples/**/build*/flasher_args.json"
- "examples/**/build*/config/sdkconfig.json"
- "examples/**/build*/bootloader/*.bin"
- "examples/**/build*/partition_table/*.bin"
when: always
expire_in: 4 days
script:
- cd ${ESP_MATTER_PATH}
# idf v4.4 requires jinja < 3.1 so lets install the dependencies for idf v4.4
- pip install -r requirements_idf_v4.4.txt
- pip install -r tools/ci/requirements-build.txt
- python tools/ci/build_apps.py ./examples --pytest_c3
variables:
IDF_CHECKOUT_REF: "v4.4.3"
pytest_esp32c3_esp_matter_dut:
stage: target_test
image: ${DOCKER_IMAGE_NAME}:chip_${CHIP_SHORT_HASH}_idf_${IDF_CHECKOUT_REF}
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH == "main" || $CI_PIPELINE_SOURCE == "push"
needs:
- build_esp_matter_examples_pytest_C3_idf_v4_4
script:
- cd ${ESP_MATTER_PATH}
- rm -rf connectedhomeip/connectedhomeip
- ln -s ${CHIP_SUBMODULE_PATH} connectedhomeip/connectedhomeip
- pip install -r tools/ci/requirements-pytest.txt
- pytest examples/ --target esp32c3 -m esp_matter_dut --junitxml=XUNIT_RESULT.xml
tags: ["esp32c3", "esp_matter_dut"]
variables:
IDF_CHECKOUT_REF: "v4.4.3"
pytest_esp32c6_esp_matter_dut:
stage: target_test
image: ${DOCKER_IMAGE_NAME}:chip_${CHIP_SHORT_HASH}_idf_${IDF_CHECKOUT_REF}
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_BRANCH == "main" || $CI_PIPELINE_SOURCE == "push"
needs:
- build_esp_matter_examples_pytest_C6_idf_v5_1
script:
- cd ${ESP_MATTER_PATH}
- rm -rf connectedhomeip/connectedhomeip
- ln -s ${CHIP_SUBMODULE_PATH} connectedhomeip/connectedhomeip
- pip install -r tools/ci/requirements-pytest.txt
- pytest examples/ --target esp32c6 -m esp_matter_dut --junitxml=XUNIT_RESULT.xml
tags: ["esp32c6", "esp_matter_dut"]
pytest_esp32c2_esp_matter_dut:
stage: target_test
image: ${DOCKER_IMAGE_NAME}:chip_${CHIP_SHORT_HASH}_idf_${IDF_CHECKOUT_REF}
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_BRANCH == "main" || $CI_PIPELINE_SOURCE == "push"
needs:
- build_esp_matter_examples_pytest_C2_idf_v5_1
script:
- cd ${ESP_MATTER_PATH}
- rm -rf connectedhomeip/connectedhomeip
- ln -s ${CHIP_SUBMODULE_PATH} connectedhomeip/connectedhomeip
- pip install -r tools/ci/requirements-pytest.txt
- pytest examples/ --target esp32c2 -m esp_matter_dut --junitxml=XUNIT_RESULT.xml --baud 74880
tags: ["esp32c2", "esp_matter_dut"]
pytest_esp32h2_esp_matter_dut:
stage: target_test
image: ${DOCKER_IMAGE_NAME}:chip_${CHIP_SHORT_HASH}_idf_${IDF_CHECKOUT_REF}
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH == "main" || $CI_PIPELINE_SOURCE == "push"
needs:
- build_esp_matter_examples_pytest_H2_idf_v5_1
script:
- cd ${ESP_MATTER_PATH}
- rm -rf connectedhomeip/connectedhomeip
- ln -s ${CHIP_SUBMODULE_PATH} connectedhomeip/connectedhomeip
- pip install -r tools/ci/requirements-pytest.txt
- pytest examples/ --target esp32h2 -m esp_matter_dut --junitxml=XUNIT_RESULT.xml
tags: ["esp32h2", "esp_matter_dut"]
build_upstream_examples:
extends:
- .build_examples_template
when: manual
script:
- *build_matter_examples
build_managed_component_light:
extends:
- .build_managed_component_light_example
needs:
- job: build_image
optional: true
script:
- cd ${ESP_MATTER_PATH}/examples/managed_component_light
- idf.py set-target esp32c3
- idf.py build
build_docs:
stage: build
image: $CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.1:1-1
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH == "main" || $CI_PIPELINE_SOURCE == "push"
tags:
- build
variables:
ESP_DOCS_LATEST_BRANCH_NAME: "main"
artifacts:
when: always
paths:
- docs/_build/*/*/*.txt
- docs/_build/*/*/html/*
expire_in: 1 days
script:
- cd docs
- pip install -r requirements.txt
- build-docs -t esp32 esp32s3 esp32c2 esp32c3 esp32c6 esp32h2 esp32p4 -l en
.deploy_docs_template:
stage: docs
image: $CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.1:1-1
tags:
- docs
needs:
- build_docs
variables:
ESP_DOCS_LATEST_BRANCH_NAME: "main"
script:
- source ${CI_PROJECT_DIR}/docs/utils.sh
- add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
- export GIT_VER=$(git describe --always)
- pip install -r ${CI_PROJECT_DIR}/docs/requirements.txt
- deploy-docs
deploy_docs_preview:
extends:
- .deploy_docs_template
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH == "main" || $CI_PIPELINE_SOURCE == "push"
variables:
TYPE: "preview"
DOCS_BUILD_DIR: "${CI_PROJECT_DIR}/docs/_build/"
DOCS_DEPLOY_PRIVATEKEY: "$DOCS_PREVIEW_DEPLOY_KEY"
DOCS_DEPLOY_SERVER: "$DOCS_PREVIEW_SERVER"
DOCS_DEPLOY_SERVER_USER: "$DOCS_PREVIEW_SERVER_USER"
DOCS_DEPLOY_PATH: "$DOCS_PREVIEW_PATH"
DOCS_DEPLOY_URL_BASE: "https://$DOCS_PREVIEW_SERVER_URL/$DOCS_PREVIEW_PATH"
deploy_docs_production:
extends:
- .deploy_docs_template
only:
refs:
- main
- /^release\/v.*$/
variables:
TYPE: "preview"
DOCS_BUILD_DIR: "${CI_PROJECT_DIR}/docs/_build/"
DOCS_DEPLOY_PRIVATEKEY: "$DOCS_PROD_DEPLOY_KEY"
DOCS_DEPLOY_SERVER: "$DOCS_PROD_SERVER"
DOCS_DEPLOY_SERVER_USER: "$DOCS_PROD_SERVER_USER"
DOCS_DEPLOY_PATH: "$DOCS_PROD_PATH"
DOCS_DEPLOY_URL_BASE: "https://$DOCS_PROD_SERVER/$DOCS_PROD_PATH"