Skip to content

Commit 9eb0f25

Browse files
gerekonsstefan1
authored andcommitted
esp/ci: Add esp-dsp build test job
1 parent 2478507 commit 9eb0f25

File tree

1 file changed

+72
-9
lines changed

1 file changed

+72
-9
lines changed

.gitlab-ci.yml

Lines changed: 72 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,17 @@ build_aarch64-apple-darwin:
268268
variables:
269269
CONF_HOST: "aarch64-apple-darwin21.1"
270270

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+
271282
.pack_template:
272283
stage: pack
273284
tags: [ "amd64", "build" ]
@@ -282,15 +293,7 @@ build_aarch64-apple-darwin:
282293
script:
283294
- *get_toolchain_build_scripts
284295
# 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
294297
- TARGET_LIBS_PACK_FILE=$(cat target_libs_arch_name)
295298
- rm -f target_libs_arch_name
296299
- echo "TARGET_LIBS_PACK_FILE=${TARGET_LIBS_PACK_FILE}"
@@ -391,6 +394,66 @@ sign_aarch64-apple-darwin:
391394
needs:
392395
- pack_aarch64-apple-darwin
393396

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+
394457
upload_to_http:
395458
stage: private_deploy
396459
when: manual

0 commit comments

Comments
 (0)