@@ -268,6 +268,17 @@ build_aarch64-apple-darwin:
268
268
variables :
269
269
CONF_HOST : " aarch64-apple-darwin21.1"
270
270
271
+ .unpack_distro : &unpack_distro |
272
+ pushd ${DIST_DIR}
273
+ ls -l
274
+ DISTRO_PACK_FILE=$(cat dist_name_${CONF_HOST})
275
+ echo "DISTRO_PACK_FILE=${DISTRO_PACK_FILE}"
276
+ ${UNPACK_TOOL} ${DISTRO_PACK_FILE}
277
+ DISTRO_PACK_DIR=$(tar tJf ${DISTRO_PACK_FILE} | sed -e 's@/.*@@' | uniq)
278
+ ls -l $PWD/${DISTRO_PACK_DIR}/lib/clang-runtimes/
279
+ echo "DISTRO_PACK_DIR=${DISTRO_PACK_DIR}"
280
+ rm -f ${DISTRO_PACK_FILE}
281
+
271
282
.pack_template :
272
283
stage : pack
273
284
tags : [ "amd64", "build" ]
@@ -282,15 +293,7 @@ build_aarch64-apple-darwin:
282
293
script :
283
294
- *get_toolchain_build_scripts
284
295
# update distro
285
- - pushd ${DIST_DIR}
286
- - ls -l
287
- - DISTRO_PACK_FILE=$(cat dist_name_${CONF_HOST})
288
- - echo "DISTRO_PACK_FILE=${DISTRO_PACK_FILE}"
289
- - ${UNPACK_TOOL} ${DISTRO_PACK_FILE}
290
- - DISTRO_PACK_DIR=$(tar tJf ${DISTRO_PACK_FILE} | sed -e 's@/.*@@' | uniq)
291
- - ls -l $PWD/${DISTRO_PACK_DIR}/lib/clang-runtimes/
292
- - echo "DISTRO_PACK_DIR=${DISTRO_PACK_DIR}"
293
- - rm -f ${DISTRO_PACK_FILE}
296
+ - *unpack_distro
294
297
- TARGET_LIBS_PACK_FILE=$(cat target_libs_arch_name)
295
298
- rm -f target_libs_arch_name
296
299
- echo "TARGET_LIBS_PACK_FILE=${TARGET_LIBS_PACK_FILE}"
@@ -391,6 +394,66 @@ sign_aarch64-apple-darwin:
391
394
needs :
392
395
- pack_aarch64-apple-darwin
393
396
397
+ .prepare_test_app_build : &prepare_test_app_build |
398
+ if [ -z "${TEST_APP_IDF_CUSTOM_BRANCH:-}" ]; then
399
+ # Use the same idf branch name if exists
400
+ git ls-remote https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/espressif/esp-idf.git | grep "refs/heads/$CI_COMMIT_REF_NAME"
401
+ test $? -eq 0 && echo "Use IDF branch \"$CI_COMMIT_REF_NAME\"" && TEST_APP_IDF_CUSTOM_BRANCH=$CI_COMMIT_REF_NAME
402
+ fi
403
+
404
+ # Use custom idf in case custom branch is present
405
+ if [ -n "${TEST_APP_IDF_CUSTOM_BRANCH:-}" ]; then
406
+ echo "TEST_APP_IDF_CUSTOM_BRANCH=$TEST_APP_IDF_CUSTOM_BRANCH"
407
+ # pushd $BUILD_TEST_APP_DIR
408
+ # Clone esp-idf
409
+ git clone --shallow-submodules --recursive --single-branch --branch $TEST_APP_IDF_CUSTOM_BRANCH -- https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/espressif/esp-idf.git esp-idf
410
+ export IDF_PATH=$PWD/esp-idf
411
+ # Activate pyenv
412
+ if [ $(command -v pyenv) ]; then
413
+ source /opt/pyenv/activate
414
+ pyenv global $(pyenv versions --bare)
415
+ fi
416
+ # cannot exec '. ${IDF_PATH}/export.sh' here because not all tools distros are presented
417
+ # in the image and `export.sh` fails w/o adding tools to $PATH
418
+ idf_exports=$(${IDF_PATH}/tools/idf_tools.py export) || true
419
+ eval "${idf_exports}"
420
+ # popd
421
+ fi
422
+ idf.py --version || true
423
+ pushd $IDF_PATH/components
424
+ git clone --shallow-submodules --recursive --single-branch --branch $TEST_APP_ESP_DSP_CUSTOM_BRANCH -- https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/idf/esp-dsp.git esp-dsp
425
+ pushd $PWD/esp-dsp/test_app
426
+
427
+ test_esp_dsp :
428
+ image : espressif/idf:latest
429
+ tags : [ "amd64", "build" ]
430
+ allow_failure : true
431
+ artifacts :
432
+ paths :
433
+ - ${BUILD_DIR}/*.log
434
+ when : always
435
+ expire_in : 1 day
436
+ parallel :
437
+ matrix :
438
+ - CHIP : esp32p4
439
+ needs :
440
+ - job : " pack_x86_64-linux-gnu"
441
+ variables :
442
+ TEST_APP_IDF_CUSTOM_BRANCH : " master"
443
+ TEST_APP_ESP_DSP_CUSTOM_BRANCH : " master"
444
+ CONF_HOST : " x86_64-linux-gnu"
445
+ UNPACK_TOOL : " tar xJf"
446
+ script :
447
+ - mkdir -p $PWD/${BUILD_DIR}
448
+ - export BUILD_LOG=$PWD/${BUILD_DIR}/build.log
449
+ - *unpack_distro
450
+ - export PATH=$PWD/${DISTRO_PACK_DIR}/bin:${PATH}
451
+ - which clang
452
+ - *prepare_test_app_build
453
+ - export IDF_TOOLCHAIN=clang
454
+ - idf.py set-target ${CHIP} 2>&1 | tee ${BUILD_LOG}
455
+ - idf.py build 2>&1 | tee -a ${BUILD_LOG}
456
+
394
457
upload_to_http :
395
458
stage : private_deploy
396
459
when : manual
0 commit comments