Skip to content

Commit

Permalink
esp/ci: Add esp-dsp build test job
Browse files Browse the repository at this point in the history
  • Loading branch information
gerekon committed Aug 29, 2024
1 parent 4cbf336 commit 8728786
Showing 1 changed file with 72 additions and 9 deletions.
81 changes: 72 additions & 9 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,17 @@ build_aarch64-apple-darwin:
variables:
CONF_HOST: "aarch64-apple-darwin21.1"

.unpack_distro: &unpack_distro |
pushd ${DIST_DIR}
ls -l
DISTRO_PACK_FILE=$(cat dist_name_${CONF_HOST})
echo "DISTRO_PACK_FILE=${DISTRO_PACK_FILE}"
${UNPACK_TOOL} ${DISTRO_PACK_FILE}
DISTRO_PACK_DIR=$(tar tJf ${DISTRO_PACK_FILE} | sed -e 's@/.*@@' | uniq)
ls -l $PWD/${DISTRO_PACK_DIR}/lib/clang-runtimes/
echo "DISTRO_PACK_DIR=${DISTRO_PACK_DIR}"
rm -f ${DISTRO_PACK_FILE}

.pack_template:
stage: pack
tags: [ "amd64", "build" ]
Expand All @@ -302,15 +313,7 @@ build_aarch64-apple-darwin:
script:
- *get_toolchain_build_scripts
# update distro
- pushd ${DIST_DIR}
- ls -l
- DISTRO_PACK_FILE=$(cat dist_name_${CONF_HOST})
- echo "DISTRO_PACK_FILE=${DISTRO_PACK_FILE}"
- ${UNPACK_TOOL} ${DISTRO_PACK_FILE}
- DISTRO_PACK_DIR=$(tar tJf ${DISTRO_PACK_FILE} | sed -e 's@/.*@@' | uniq)
- ls -l $PWD/${DISTRO_PACK_DIR}/lib/clang-runtimes/
- echo "DISTRO_PACK_DIR=${DISTRO_PACK_DIR}"
- rm -f ${DISTRO_PACK_FILE}
- *unpack_distro
- TARGET_LIBS_PACK_FILE=$(cat target_libs_arch_name)
- rm -f target_libs_arch_name
- echo "TARGET_LIBS_PACK_FILE=${TARGET_LIBS_PACK_FILE}"
Expand Down Expand Up @@ -411,6 +414,66 @@ sign_aarch64-apple-darwin:
needs:
- pack_aarch64-apple-darwin

.prepare_test_app_build: &prepare_test_app_build |
if [ -z "${TEST_APP_IDF_CUSTOM_BRANCH:-}" ]; then
# Use the same idf branch name if exists
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"
test $? -eq 0 && echo "Use IDF branch \"$CI_COMMIT_REF_NAME\"" && TEST_APP_IDF_CUSTOM_BRANCH=$CI_COMMIT_REF_NAME
fi

# Use custom idf in case custom branch is present
if [ -n "${TEST_APP_IDF_CUSTOM_BRANCH:-}" ]; then
echo "TEST_APP_IDF_CUSTOM_BRANCH=$TEST_APP_IDF_CUSTOM_BRANCH"
#pushd $BUILD_TEST_APP_DIR
# Clone esp-idf
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
export IDF_PATH=$PWD/esp-idf
# Activate pyenv
if [ $(command -v pyenv) ]; then
source /opt/pyenv/activate
pyenv global $(pyenv versions --bare)
fi
# cannot exec '. ${IDF_PATH}/export.sh' here because not all tools distros are presented
# in the image and `export.sh` fails w/o adding tools to $PATH
idf_exports=$(${IDF_PATH}/tools/idf_tools.py export) || true
eval "${idf_exports}"
#popd
fi
idf.py --version || true
pushd $IDF_PATH/components
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
pushd $PWD/esp-dsp/test_app

test_esp_dsp:
image: espressif/idf:latest
tags: [ "amd64", "build" ]
allow_failure: true
artifacts:
paths:
- ${BUILD_DIR}/*.log
when: always
expire_in: 1 day
parallel:
matrix:
- CHIP: esp32p4
needs:
- job: "pack_x86_64-linux-gnu"
variables:
TEST_APP_IDF_CUSTOM_BRANCH: "master"
TEST_APP_ESP_DSP_CUSTOM_BRANCH: "master"
CONF_HOST: "x86_64-linux-gnu"
UNPACK_TOOL: "tar xJf"
script:
- mkdir -p $PWD/${BUILD_DIR}
- export BUILD_LOG=$PWD/${BUILD_DIR}/build.log
- *unpack_distro
- export PATH=$PWD/${DISTRO_PACK_DIR}/bin:${PATH}
- which clang
- *prepare_test_app_build
- export IDF_TOOLCHAIN=clang
- idf.py set-target ${CHIP} 2>&1 | tee ${BUILD_LOG}
- idf.py build 2>&1 | tee -a ${BUILD_LOG}

upload_to_http:
stage: private_deploy
when: manual
Expand Down

0 comments on commit 8728786

Please sign in to comment.