forked from espressif/esp-adf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
662 lines (618 loc) · 23.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
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
stages:
- build
- build_ut
- assign_test
- target_test
# - example_test
- deploy
variables:
# System environment
# Common parameters for the 'make' during CI tests
MAKEFLAGS: "-j5 --no-keep-going"
# more attempts for more robust
GET_SOURCES_ATTEMPTS: "10"
ARTIFACT_DOWNLOAD_ATTEMPTS: "10"
# We use get_sources.sh script to fetch the submodules and/or re-fetch the repo
# if it was corrupted (if submodule update fails this can happen)
GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: none
ADF_PATH: "$CI_PROJECT_DIR"
IDF_PATH: "$CI_PROJECT_DIR/esp-idf"
CI_TARGET_UT_TEST_CONFIG_FILE: "$CI_PROJECT_DIR/tools/ci/target-ut-test.yml"
.setup_tools_unless_target_test: &setup_tools_unless_target_test |
if [[ "$SETUP_TOOLS" == "1" || "$CI_JOB_STAGE" != "target_test" ]]; then
$IDF_PATH/tools/idf_tools.py --non-interactive install && eval "$($IDF_PATH/tools/idf_tools.py --non-interactive export)" || exit 1
fi
.set_idf_version_and_update: &set_idf_version_and_update
$ADF_PATH/tools/ci/set_idf.sh ${IDF_VERSION}
before_script:
# 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
# replace submodule esp-idf to internal repository to speedup cloning
- sed -i "s%https://github.com/espressif/esp-idf%${GITLAB_SSH_SERVER}/idf/esp-idf.git%" .gitmodules
# replace submodule esp-adf-libs to internal repository to speedup cloning
- sed -i "s%https://github.com/espressif/esp-adf-libs%${GITLAB_SSH_SERVER}/adf/esp-adf-libs.git%" .gitmodules
# - sed -i "s%https://github.com/espressif/esp-sr.git%${GITLAB_SSH_SERVER}/speech-recognition-internal/esp_sr_public.git%" .gitmodules
- git config --global http.postBuffer 524288000
- git submodule update --init
- echo "current path:"$(pwd)
- cd $ADF_PATH/..
- if [[ ! -d "$ADF_PATH/../adf-libs-ut/" ]]; then git clone ssh://[email protected]:27227/adf/adf-libs-ut.git;else echo "adf-libs-ut folder already exists";fi
- cd -
- if [ -e $ADF_UT/tools/CreateSectionTable.pyc ]; then rm -f $ADF_UT/tools/CreateSectionTable.pyc; fi
# To disable set -e for automatic error detection, due to the switch_branch.sh use $? check return value
- set +e +o pipefail
- source $ADF_PATH/tools/ut/switch_branch.sh
- set -e -o pipefail
- if [ "$IDF_VERSION" = "release/v4.4" ];then cd $IDF_PATH; git checkout $IDF_VERSION; $IDF_PATH/tools/idf_tools.py --non-interactive install && eval "$($IDF_PATH/tools/idf_tools.py --non-interactive export)";fi
# - cd $IDF_PATH
# - git checkout $IDF_VERSION
# - $IDF_PATH/tools/idf_tools.py --non-interactive install && eval "$($IDF_PATH/tools/idf_tools.py --non-interactive export)"
- source $IDF_PATH/tools/ci/setup_python.sh
- if [ "$IDF_VERSION" != "release/v4.4" ];then source esp-idf/tools/ci/configure_ci_environment.sh;fi
# (the same regular expressions are used to set these are used in 'only:' sections below
# - source esp-idf/tools/ci/configure_ci_environment.sh
# fetch the submodules (& if necessary re-fetch repo) from gitlab
.add_gitlab_key_before:
before_script: &add_gitlab_key_before
- echo "Not fetching submodules"
- source $IDF_PATH/tools/ci/configure_ci_environment.sh
# add gitlab ssh key
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -n $AUTO_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
.add_gitlab_key_before_ut:
before_script: &add_gitlab_key_before_ut
- echo "Not fetching submodules"
- 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
- source $IDF_PATH/tools/ci/setup_python.sh
- source $IDF_PATH/tools/ci/configure_ci_environment.sh
.build_template: &build_template
stage: build
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
tags:
- build
variables:
BATCH_BUILD: "1"
V: "0"
.build_template_v44: &build_template_v44
stage: build
image: $CI_DOCKER_REGISTRY/esp-env:v4.4-1
tags:
- build
variables:
BATCH_BUILD: "1"
V: "0"
.build_examples_make: &build_examples_make
<<: *build_template
parallel: 8
# This is a workaround for a rarely encountered issue with building examples in CI.
# Probably related to building of Kconfig in 'make clean' stage
retry: 1
artifacts:
when: always
paths:
- build_examples/*/*/*/build/*.bin
- build_examples/*/*/*/sdkconfig
- build_examples/*/*/*/build/*.elf
- build_examples/*/*/*/build/*.map
- build_examples/*/*/*/build/download.config
- build_examples/*/*/*/build/bootloader/*.bin
- build_examples/*/*/*/*/build/partition_table/*.bin
- $LOG_PATH
expire_in: 4 days
variables:
IDF_CI_BUILD: "1"
LOG_PATH: "$CI_PROJECT_DIR/log_examples_make"
script:
# it's not possible to build 100% out-of-tree and have the "artifacts"
# mechanism work, but this is the next best thing
- cd ${ADF_PATH}
- rm -rf build_examples
- mkdir build_examples
- cd build_examples
- mkdir -p ${LOG_PATH}
- echo "The IDF branch is v3.3(722043f734)"
- $ADF_PATH/tools/ci/set_idf.sh "722043f734"
# enable pedantic flags for compilation
- export PEDANTIC_CFLAGS="-Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function"
- export EXTRA_CFLAGS=${PEDANTIC_CFLAGS} && export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
- ${ADF_PATH}/tools/ci/build_examples.sh
# Check if the tests demand Make built binaries. If not, delete them
- if [ "$EXAMPLE_TEST_BUILD_SYSTEM" == "make" ]; then exit 0; fi
- cd ..
- rm -rf build_examples
# same as above, but for CMake
.build_examples_cmake: &build_examples_cmake
extends: .build_template
parallel: 8
artifacts:
when: always
paths:
- build_examples/list.json
- build_examples/list_job_*.json
- build_examples/*/*/*/sdkconfig
- build_examples/*/*/*/build/*.bin
- build_examples/*/*/*/build/*.elf
- build_examples/*/*/*/build/*.map
- build_examples/*/*/*/build/flasher_args.json
- build_examples/*/*/*/build/bootloader/*.bin
- build_examples/*/*/*/build/partition_table/*.bin
- $LOG_PATH
expire_in: 4 days
variables:
LOG_PATH: "$CI_PROJECT_DIR/log_examples"
BUILD_PATH: "$CI_PROJECT_DIR/build_examples"
only:
variables:
- $BOT_TRIGGER_WITH_LABEL == null
- $BOT_LABEL_BUILD
- $BOT_LABEL_EXAMPLE_TEST
- $BOT_LABEL_REGULAR_TEST
- $BOT_LABEL_WEEKEND_TEST
script:
# it's not possible to build 100% out-of-tree and have the "artifacts"
# mechanism work, but this is the next best thing
- mkdir -p ${BUILD_PATH}
- mkdir -p ${LOG_PATH}
- echo "The IDF branch is "${IDF_VERSION}
- $ADF_PATH/tools/ci/set_idf.sh ${IDF_VERSION}
- *setup_tools_unless_target_test
- export PEDANTIC_CFLAGS="-Werror -Wno-implicit-fallthrough"
- export EXTRA_CFLAGS=${PEDANTIC_CFLAGS} && export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
- ${ADF_PATH}/tools/ci/build_examples_cmake.sh
# Check if the tests demand CMake built binaries. If not, delete them
- if [ "$EXAMPLE_TEST_BUILD_SYSTEM" == "cmake" ]; then exit 0; fi
- cd ..
- rm -rf build_examples
# same as above, but for v4.4
.build_examples_cmake_v44: &build_examples_cmake_v44
<<: *build_template_v44
parallel: 8
artifacts:
when: always
paths:
- build_examples/list.json
- build_examples/list_job_*.json
- build_examples/*/*/*/sdkconfig
- build_examples/*/*/*/build/*.bin
- build_examples/*/*/*/build/*.elf
- build_examples/*/*/*/build/*.map
- build_examples/*/*/*/build/flasher_args.json
- build_examples/*/*/*/build/bootloader/*.bin
- build_examples/*/*/*/build/partition_table/*.bin
- $LOG_PATH
- $EXAMPLE_TEST_OUTPUT_DIR
expire_in: 4 days
before_script:
# - source $IDF_PATH/tools/ci/configure_ci_environment.sh
variables:
SIZE_INFO_LOCATION: "$CI_PROJECT_DIR/size_info.txt"
LOG_PATH: "$CI_PROJECT_DIR/log_examples"
BUILD_PATH: "$CI_PROJECT_DIR/build_examples"
EXAMPLE_TEST_OUTPUT_DIR: ${CI_PROJECT_DIR}/examples/test_configs
CI_SCAN_TESTS_PY: ${CI_PROJECT_DIR}/esp-idf/tools/ci/python_packages/ttfw_idf/CIScanTests.py
EXAMPLE_TEST_DIR: ${CI_PROJECT_DIR}/examples
TEST_PREFIX: examples
TEST_RELATIVE_DIR: examples
TEST_TYPE: example_test
SCAN_TEST_JSON: ${CI_PROJECT_DIR}/${TEST_RELATIVE_DIR}/test_configs/scan_${IDF_TARGET}_${BUILD_SYSTEM}.json
PYTHON_VER: 3
# TEST_CONFIG_FILE: ${CI_PROJECT_DIR}/esp-idf/tools/ci/config/target-test.yml
# TEST_CONFIG_FILE: "$CI_PROJECT_DIR/esp-idf/.gitlab/ci/target-test.yml"
only:
variables:
- $BOT_TRIGGER_WITH_LABEL == null
- $BOT_LABEL_BUILD
- $BOT_LABEL_EXAMPLE_TEST
- $BOT_LABEL_REGULAR_TEST
- $BOT_LABEL_WEEKEND_TEST
script:
# it's not possible to build 100% out-of-tree and have the "artifacts"
# mechanism work, but this is the next best thing
- mkdir -p ${BUILD_PATH}
- mkdir -p ${LOG_PATH}
- echo "The IDF branch is "${IDF_VERSION}
- $ADF_PATH/tools/ci/set_idf.sh ${IDF_VERSION}
- source $IDF_PATH/tools/ci/configure_ci_environment.sh
- *setup_tools_unless_target_test
- pip3 install junit_xml
- pip3 install netifaces
- export PYTHONPATH=$IDF_PATH/tools/ci/python_packages:$IDF_PATH/tools
- echo "Ready to scan the examples"
- python $CI_SCAN_TESTS_PY example_test $EXAMPLE_TEST_DIR -b cmake --exclude $ADF_PATH/examples/korvo_du1906 -c $TEST_CONFIG_FILE -o $EXAMPLE_TEST_OUTPUT_DIR
- export PEDANTIC_CFLAGS="-Werror -Wno-implicit-fallthrough"
- export EXTRA_CFLAGS=${PEDANTIC_CFLAGS} && export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
# - ${ADF_PATH}/tools/ci/build_examples_cmake.sh
- ${IDF_PATH}/tools/ci/find_apps_build_apps.sh
# Check if the tests demand CMake built binaries. If not, delete them
- if [ "$EXAMPLE_TEST_BUILD_SYSTEM" == "cmake" ]; then exit 0; fi
- cd ..
- rm -rf build_examples
.build_ut_template: &build_ut_template
stage: build_ut
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
tags:
- adf_build
variables:
BATCH_BUILD: "1"
V: "0"
.build_esp_adf_unit_test_template: &build_esp_adf_unit_test_template
<<: *build_ut_template
only:
variables:
- $BOT_TRIGGER_WITH_LABEL == null
- $BOT_LABEL_BUILD
- $BOT_LABEL_UNIT_TEST
- $BOT_LABEL_REGULAR_TEST
.build_esp_adf_unit_test_v44_template: &build_esp_adf_unit_test_v44_template
stage: build_ut
image: $CI_DOCKER_REGISTRY/esp-env:v4.4-1
tags:
- adf_build
variables:
BATCH_BUILD: "1"
V: "0"
only:
variables:
- $BOT_TRIGGER_WITH_LABEL == null
- $BOT_LABEL_BUILD
- $BOT_LABEL_UNIT_TEST
- $BOT_LABEL_REGULAR_TEST
.add_adf_components_to_ut_make_build: &add_adf_components_to_ut_make_build
- cd $ADF_PATH/../adf-libs-ut
- export ADF_UT=$(pwd)
- cd $ADF_PATH
- sed -i '/EXTRA_COMPONENT_DIRS += \$(ADF_PATH)\/components\//a\EXTRA_COMPONENT_DIRS += $(ADF_UT)/esp_audio' project.mk
- git log -2
- cd $IDF_PATH
- $ADF_PATH/tools/ci/set_idf.sh ${IDF_VERSION}
# - if [[ "$SETUP_TOOLS" == "1" || "$CI_JOB_STAGE" != "target_test" ]]; then
# $IDF_PATH/tools/idf_tools.py --non-interactive install && eval "$($IDF_PATH/tools/idf_tools.py --non-interactive export)" || exit 1
# fi
- source $IDF_PATH/tools/ci/configure_ci_environment.sh
- git apply $ADF_PATH/idf_patches/idf_v3.3_freertos.patch
- git apply $ADF_PATH/idf_patches/idf_v3.3_esp_http_client.patch
- cd -
- cd $IDF_PATH/tools/unit-test-app
- cp $ADF_UT/sdkconfig.defaults ./
- rm -rf $IDF_PATH/tools/ci
- cp -rf $ADF_UT/ci $IDF_PATH/tools
- sed -i "s%CRITICAL_LEAK_THRESHOLD = 4096%CRITICAL_LEAK_THRESHOLD = 26240%" $IDF_PATH/tools/unit-test-app/components/test_utils/test_runner.c
- sed -i "s%include \$(IDF_PATH)\/make\/project.mk%include \$(ADF_PATH)\/project.mk%g" Makefile
.add_adf_components_to_ut_v44_make_build: &add_adf_components_to_ut_v44_make_build
- cd $ADF_PATH/../adf-libs-ut
- export ADF_UT=$(pwd)
- cd $ADF_PATH
- sed -i '/EXTRA_COMPONENT_DIRS += \$(ADF_PATH)\/components\//a\EXTRA_COMPONENT_DIRS += $(ADF_UT)/esp_audio' project.mk
- git log -2
- cd $IDF_PATH
- $ADF_PATH/tools/ci/set_idf.sh ${IDF_VERSION}
# - if [[ "$SETUP_TOOLS" == "1" || "$CI_JOB_STAGE" != "target_test" ]]; then
# $IDF_PATH/tools/idf_tools.py --non-interactive install && eval "$($IDF_PATH/tools/idf_tools.py --non-interactive export)" || exit 1
# fi
- source $IDF_PATH/tools/ci/configure_ci_environment.sh
- git apply $ADF_PATH/idf_patches/idf_v4.4_freertos.patch
- cd -
- cd $IDF_PATH/tools/unit-test-app
- cp $ADF_UT/sdkconfig_v44.defaults ./sdkconfig.defaults
- rm -rf $IDF_PATH/tools/ci
- cp -rf $ADF_UT/ci $IDF_PATH/tools
- sed -i "s%include \$(IDF_PATH)\/make\/project.mk%include \$(ADF_PATH)\/project.mk%g" Makefile
.build_esp_adf_tests_make:
<<: *build_esp_adf_unit_test_template
artifacts:
paths:
- $IDF_PATH/components/idf_test/unit_test/TestCaseAll.yml
- $IDF_PATH/tools/unit-test-app/
- $IDF_PATH/tools/unit-test-app/output
- $IDF_PATH/tools/unit-test-app/build/*.elf
- $IDF_PATH/tools/unit-test-app/build/*.map
- $IDF_PATH/tools/unit-test-app/build/*.bin
- $IDF_PATH/tools/unit-test-app/build/download.config
- $IDF_PATH/tools/unit-test-app/build/bootloader/*
- $IDF_PATH/tools/tiny-test-fw/
- $IDF_PATH/tools/ci
- $IDF_PATH/components/esptool_py/esptool/
- $IDF_PATH/components/partition_table/
# when: always
expire_in: 4 days
dependencies: []
variables:
LOG_PATH: "$CI_PROJECT_DIR/log_ut_make"
OUTPUT_PATH: ${IDF_PATH}/tools/unit-test-app/output
script:
- echo $PATH
- xtensa-esp32-elf-gcc -v
# - *set_idf_version_and_update
- *add_adf_components_to_ut_make_build
- MAKEFLAGS= make help # make sure kconfig tools are built in single process
- make clean
- make -j8 TEST_COMPONENTS="$ADF_UT/esp_audio"
- make print_flash_cmd > build/download.config
- mkdir adf_configs
- mkdir output
- mkdir output/default
- mkdir $IDF_PATH/components/idf_test/unit_test
- python --version
- pyenv global 2.7.15
- cp configs/default adf_configs/
- cp sdkconfig output/default/
- cp -ar build/*.bin output/default
- cp -ar build/*.elf output/default
- cp -ar build/*.map output/default
- cp -ar build/bootloader output/default
- cd $ADF_UT
- python tools/UnitTestParser.py
.build_esp_adf_tests_v44_make:
<<: *build_esp_adf_unit_test_v44_template
artifacts:
paths:
- $IDF_PATH/components/idf_test/unit_test/TestCaseAll.yml
- $IDF_PATH/tools/unit-test-app/
- $IDF_PATH/tools/unit-test-app/output
- $IDF_PATH/tools/unit-test-app/build/*.elf
- $IDF_PATH/tools/unit-test-app/build/*.map
- $IDF_PATH/tools/unit-test-app/build/*.bin
- $IDF_PATH/tools/unit-test-app/build/download.config
- $IDF_PATH/tools/unit-test-app/build/bootloader/*
- $IDF_PATH/tools/tiny-test-fw/
- $IDF_PATH/tools/ci
- $IDF_PATH/components/esptool_py/esptool/
- $IDF_PATH/components/partition_table/
# when: always
expire_in: 4 days
dependencies: []
variables:
LOG_PATH: "$CI_PROJECT_DIR/log_ut_make"
OUTPUT_PATH: ${IDF_PATH}/tools/unit-test-app/output
script:
- echo $PATH
- xtensa-esp32-elf-gcc -v
- *add_adf_components_to_ut_v44_make_build
- MAKEFLAGS= make help # make sure kconfig tools are built in single process
- make clean
- make -j8 TEST_COMPONENTS="$ADF_UT/esp_audio"
- make print_flash_cmd > build/download.config
- mkdir adf_configs
- mkdir output
- mkdir output/default
- mkdir $IDF_PATH/components/idf_test/unit_test
- cp configs/default adf_configs/
- cp -ar adf_configs $ADF_UT
- find / -name $ADF_UT/adf_configs
- cp sdkconfig output/default/
- cp -ar build/*.bin output/default
- cp -ar build/*.elf output/default
- cp -ar build/*.map output/default
- cp -ar build/bootloader output/default
- cp -r build $CI_PROJECT_DIR
- cd $IDF_PATH
- git checkout .
- git checkout -- $IDF_PATH/components/freertos/include/freertos/task.h $IDF_PATH/components/freertos/tasks.c $IDF_PATH/tools/unit-test-app/Makefile $IDF_PATH/tools/unit-test-app/components/test_utils/test_runner.c $IDF_PATH/tools/unit-test-app/sdkconfig.defaults
- rm -rf tools/ci/apply_bot_filter.py tools/ci/build_examples.sh tools/ci/build_examples_cmake.sh tools/ci/check-executable.sh tools/ci/check-line-endings.sh tools/ci/check_examples_cmake_make.sh
# use the 'tools/UnitTestParser.py' of release/v3.3 in order to generate 'idf_test/unit_test/TestCaseAll.yml'
- git checkout 722043f734
- git submodule update --init --recursive
- cd -
- pyenv install 2.7.15
- pyenv global 2.7.15
- pyenv rehash
- cd $IDF_PATH
- ./install.sh
- . ./export.sh
- cd -
- cp $CI_PROJECT_DIR/build $IDF_PATH/tools/unit-test-app -r
- cp -ar $ADF_UT/adf_configs $IDF_PATH/tools/unit-test-app
- cd $ADF_UT
- pip install netifaces
- pip install pyyaml
- pip install junit_xml
- python tools/UnitTestParser.py
- sed -i "23i\ - V44" $IDF_PATH/components/idf_test/unit_test/TestCaseAll.yml
adf_ut_make_v33:
extends: .build_esp_adf_tests_make
variables:
IDF_VERSION: 722043f734
IDF_TARGET: esp32
adf_ut_make_v44:
extends: .build_esp_adf_tests_v44_make
variables:
IDF_VERSION: release/v4.4
IDF_TARGET: esp32
build_examples_v41_cmake:
extends: .build_examples_cmake
variables:
IDF_TARGET: esp32
IDF_VERSION: release/v4.1
IDF_FIND_APP_PATH_ARG: ""
build_examples_v42_cmake:
extends: .build_examples_cmake
variables:
IDF_TARGET: esp32
IDF_VERSION: release/v4.2
IDF_FIND_APP_PATH_ARG: ""
build_examples_v43_cmake:
extends: .build_examples_cmake_v44
variables:
IDF_TARGET: esp32
IDF_VERSION: release/v4.3
BUILD_SYSTEM: cmake
IDF_FIND_APP_PATH_ARG: "-p"
TEST_CONFIG_FILE: ${CI_PROJECT_DIR}/esp-idf/tools/ci/config/target-test.yml
build_examples_v44_cmake:
extends: .build_examples_cmake_v44
variables:
IDF_TARGET: esp32
IDF_VERSION: release/v4.4
BUILD_SYSTEM: cmake
IDF_FIND_APP_PATH_ARG: "-p"
TEST_CONFIG_FILE: "$CI_PROJECT_DIR/esp-idf/.gitlab/ci/target-test.yml"
.build_examples_cmake_s2:
extends: .build_examples_cmake
variables:
IDF_TARGET: esp32s2beta
IDF_VERSION: release/v4.1
IDF_FIND_APP_PATH_ARG: "-p"
build_examples_v33_make:
<<: *build_examples_make
.build_adf_test:
<<: *build_template
artifacts:
when: always
paths:
- adf-cli/build/*.bin
- adf-cli/build/*.elf
- adf-cli/build/*.map
- adf-cli/build/download.config
- adf-cli/build/bootloader/*.bin
- $IDF_PATH/tools/ci
- $IDF_PATH/components/esptool_py
- $IDF_PATH/components/partition_table
expire_in: 1 month
script:
- cd ${IDF_PATH}
- git submodule update --init --recursive
- cd ${ADF_PATH}/components/esp-adf-libs
- git log -2
- cd ${ADF_PATH}
- git clone ${ADF_TEST_CLI_REPO}
- cd adf-cli
- git checkout ${CI_COMMIT_REF_NAME} || echo "Using adf-cli default branch..."
- make defconfig
- make
- make print_flash_cmd > build/download.config
build_docs:
stage: build
image: $CI_DOCKER_REGISTRY/esp-idf-doc-env:v7
tags:
- build_docs
artifacts:
when: always
paths:
# English version of documentation
- docs/en/doxygen-warning-log.txt
- docs/en/sphinx-warning-log.txt
- docs/en/sphinx-warning-log-sanitized.txt
- docs/en/_build/html
# Chinese version of documentation
- docs/zh_CN/doxygen-warning-log.txt
- docs/zh_CN/sphinx-warning-log.txt
- docs/zh_CN/sphinx-warning-log-sanitized.txt
- docs/zh_CN/_build/html
expire_in: 1 mos
script:
- source /opt/pyenv/activate && pyenv global 3.6.10
- /opt/pyenv/pyenv-1.2.16/versions/3.6.10/bin/python -m pip install --user -r docs/requirements.txt
- cd docs
- ./check_lang_folder_sync.sh
- cd en
- make gh-linkcheck
- make html
- ../check_doc_warnings.sh
- cd ../zh_CN
- make gh-linkcheck
- make html
- ../check_doc_warnings.sh
.assign_test_template: &assign_test_template
tags:
- adf_assign_test
# image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
image: $CI_DOCKER_REGISTRY/ubuntu-test-env:old1 # just a temporary solution
stage: assign_test
artifacts:
paths:
- $IDF_PATH/components/idf_test/*/CIConfigs
- $IDF_PATH/components/idf_test/*/TC.sqlite
when: always
expire_in: 1 week
only:
variables:
- $BOT_TRIGGER_WITH_LABEL == null
- $BOT_LABEL_UNIT_TEST
- $BOT_LABEL_INTEGRATION_TEST
- $BOT_LABEL_EXAMPLE_TEST
before_script: *add_gitlab_key_before_ut
script:
- ls
- pwd
- python $UNIT_ASSIGN_SCRIPT $IDF_PATH/components/idf_test/unit_test/TestCaseAll.yml $CI_TARGET_UT_TEST_CONFIG_FILE $IDF_PATH/components/idf_test/unit_test/CIConfigs
assign_test_v33:
<<: *assign_test_template
dependencies:
- adf_ut_make_v33
variables:
# UNIT_ASSIGN_SCRIPT: "esp-adf-internal/esp-idf/tools/tiny-test-fw/CIAssignUnitTest.py"
UNIT_ASSIGN_SCRIPT: "esp-idf/tools/tiny-test-fw/CIAssignUnitTest.py"
PYTHON_VER: 3.7.7
assign_test_v44:
<<: *assign_test_template
dependencies:
- adf_ut_make_v44
variables:
UNIT_ASSIGN_SCRIPT: "esp-idf/tools/tiny-test-fw/CIAssignUnitTest.py"
PYTHON_VER: 3.7.7
.assign_test:
tags:
- assign_test
image: $CI_DOCKER_REGISTRY/audio_test_env$BOT_DOCKER_IMAGE_TAG
stage: assign_test
# gitlab ci do not support match job with RegEx or wildcard now in dependencies.
# we have a lot build example jobs. now we don't use dependencies, just download all artificats of build stage.
dependencies:
- build_examples_v44_cmake
- build_examples_v33_make
variables:
TEST_FW_PATH: "$CI_PROJECT_DIR/general-test-framework"
EXAMPLE_CONFIG_OUTPUT_PATH: "$CI_PROJECT_DIR/examples/test_configs"
AUTO_TEST_PATH: "$CI_PROJECT_DIR/audio_auto_test"
artifacts:
paths:
- $TEST_FW_PATH
- $EXAMPLE_CONFIG_OUTPUT_PATH
- $AUTO_TEST_PATH
expire_in: 1 mos
before_script: *add_gitlab_key_before
script:
- source /opt/pyenv/activate
- pyenv global 3.5.5
- git clone ${AUDIO_AUTO_REPO}
- git clone ${TEST_FW_REPO}
# assign example tests
- python $TEST_FW_PATH/CIAssignExampleTest.py $CI_PROJECT_DIR/examples $CI_PROJECT_DIR/.gitlab-ci.yml $EXAMPLE_CONFIG_OUTPUT_PATH
push_to_github:
stage: deploy
only:
- master
- /^release\/v/
# when: on_success
image: $CI_DOCKER_REGISTRY/esp32-ci-env
variables:
GIT_STRATEGY: clone
before_script:
- echo "skip default before_script"
script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -n $GH_PUSH_KEY >> ~/.ssh/id_rsa_base64
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- git remote remove github &>/dev/null || true
- git remote add github [email protected]:espressif/esp-adf.git
- tools/ci/push_to_github.sh
include:
- 'tools/ci/target-ut-test.yml'