@@ -288,6 +288,17 @@ build_aarch64-apple-darwin:
288288 variables :
289289 CONF_HOST : " aarch64-apple-darwin21.1"
290290
291+ .unpack_distro : &unpack_distro |
292+ pushd ${DIST_DIR}
293+ ls -l
294+ DISTRO_PACK_FILE=$(cat dist_name_${CONF_HOST})
295+ echo "DISTRO_PACK_FILE=${DISTRO_PACK_FILE}"
296+ ${UNPACK_TOOL} ${DISTRO_PACK_FILE}
297+ DISTRO_PACK_DIR=$(tar tJf ${DISTRO_PACK_FILE} | sed -e 's@/.*@@' | uniq)
298+ ls -l $PWD/${DISTRO_PACK_DIR}/lib/clang-runtimes/
299+ echo "DISTRO_PACK_DIR=${DISTRO_PACK_DIR}"
300+ rm -f ${DISTRO_PACK_FILE}
301+
291302.pack_template :
292303 stage : pack
293304 tags : [ "amd64", "build" ]
@@ -302,15 +313,7 @@ build_aarch64-apple-darwin:
302313 script :
303314 - *get_toolchain_build_scripts
304315 # update distro
305- - pushd ${DIST_DIR}
306- - ls -l
307- - DISTRO_PACK_FILE=$(cat dist_name_${CONF_HOST})
308- - echo "DISTRO_PACK_FILE=${DISTRO_PACK_FILE}"
309- - ${UNPACK_TOOL} ${DISTRO_PACK_FILE}
310- - DISTRO_PACK_DIR=$(tar tJf ${DISTRO_PACK_FILE} | sed -e 's@/.*@@' | uniq)
311- - ls -l $PWD/${DISTRO_PACK_DIR}/lib/clang-runtimes/
312- - echo "DISTRO_PACK_DIR=${DISTRO_PACK_DIR}"
313- - rm -f ${DISTRO_PACK_FILE}
316+ - *unpack_distro
314317 - TARGET_LIBS_PACK_FILE=$(cat target_libs_arch_name)
315318 - rm -f target_libs_arch_name
316319 - echo "TARGET_LIBS_PACK_FILE=${TARGET_LIBS_PACK_FILE}"
@@ -411,6 +414,66 @@ sign_aarch64-apple-darwin:
411414 needs :
412415 - pack_aarch64-apple-darwin
413416
417+ .prepare_test_app_build : &prepare_test_app_build |
418+ if [ -z "${TEST_APP_IDF_CUSTOM_BRANCH:-}" ]; then
419+ # Use the same idf branch name if exists
420+ 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"
421+ test $? -eq 0 && echo "Use IDF branch \"$CI_COMMIT_REF_NAME\"" && TEST_APP_IDF_CUSTOM_BRANCH=$CI_COMMIT_REF_NAME
422+ fi
423+
424+ # Use custom idf in case custom branch is present
425+ if [ -n "${TEST_APP_IDF_CUSTOM_BRANCH:-}" ]; then
426+ echo "TEST_APP_IDF_CUSTOM_BRANCH=$TEST_APP_IDF_CUSTOM_BRANCH"
427+ # pushd $BUILD_TEST_APP_DIR
428+ # Clone esp-idf
429+ 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
430+ export IDF_PATH=$PWD/esp-idf
431+ # Activate pyenv
432+ if [ $(command -v pyenv) ]; then
433+ source /opt/pyenv/activate
434+ pyenv global $(pyenv versions --bare)
435+ fi
436+ # cannot exec '. ${IDF_PATH}/export.sh' here because not all tools distros are presented
437+ # in the image and `export.sh` fails w/o adding tools to $PATH
438+ idf_exports=$(${IDF_PATH}/tools/idf_tools.py export) || true
439+ eval "${idf_exports}"
440+ # popd
441+ fi
442+ idf.py --version || true
443+ pushd $IDF_PATH/components
444+ 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
445+ pushd $PWD/esp-dsp/test_app
446+
447+ test_esp_dsp :
448+ image : espressif/idf:latest
449+ tags : [ "amd64", "build" ]
450+ allow_failure : true
451+ artifacts :
452+ paths :
453+ - ${BUILD_DIR}/*.log
454+ when : always
455+ expire_in : 1 day
456+ parallel :
457+ matrix :
458+ - CHIP : esp32p4
459+ needs :
460+ - job : " pack_x86_64-linux-gnu"
461+ variables :
462+ TEST_APP_IDF_CUSTOM_BRANCH : " master"
463+ TEST_APP_ESP_DSP_CUSTOM_BRANCH : " master"
464+ CONF_HOST : " x86_64-linux-gnu"
465+ UNPACK_TOOL : " tar xJf"
466+ script :
467+ - mkdir -p $PWD/${BUILD_DIR}
468+ - export BUILD_LOG=$PWD/${BUILD_DIR}/build.log
469+ - *unpack_distro
470+ - export PATH=$PWD/${DISTRO_PACK_DIR}/bin:${PATH}
471+ - which clang
472+ - *prepare_test_app_build
473+ - export IDF_TOOLCHAIN=clang
474+ - idf.py set-target ${CHIP} 2>&1 | tee ${BUILD_LOG}
475+ - idf.py build 2>&1 | tee -a ${BUILD_LOG}
476+
414477upload_to_http :
415478 stage : private_deploy
416479 when : manual
0 commit comments