代码拉取完成,页面将自动刷新
riscv32-esp-elf-gdb
for ARM
stages:
- build
- test
- sanitizer_tests
- sanitizer_checks
- deploy
- private_deploy
- pre_release
- release_stage1
- release_submit
image: $CI_DOCKER_REGISTRY/esp32-toolchain
variables:
#
# System environment
# Common parameters for the 'make' during CI tests
MAKEFLAGS: "-j4 --no-keep-going"
# OpenOCD configuration options
OPENOCD_CONFIGURE_OPTS: "--disable-doxygen-html --disable-doxygen-pdf --enable-ftdi --enable-jlink --enable-ulink"
# GitHub Tool options
GITHUB_USER: "${GH_USER}"
GITHUB_REPO: "${GH_REPO}"
GITHUB_TOKEN: "${GH_TOKEN}"
#
# CI settings
# GIT_STRATEGY is not defined here, an option from "CI / CD Settings"- "General pipelines" is used.
GIT_SUBMODULE_STRATEGY: none
#
# Customization of jobs
DIST_ART_DIR: "dist"
DIST_INSTALLED_DIR: "${CI_PROJECT_NAME}"
ARCHIVE_TOOL: "tar czf"
# UNARCHIVE_TOOL: "tar xvf"
ARCHIVE_EXT: "tar.gz"
GH_TOOL_NAME: github-release
GH_TOOL: "./${DIST_ART_DIR}/${GH_TOOL_NAME}"
RELEASE_DESC: "New release"
#
# default variables
ESP_TOOLCHAIN: "${ESP_TOOLCHAIN_VER}"
TOOLCHAIN_PREFIX: "xtensa-esp32"
CHIP_NAME: "esp32"
TEST_APP_IDF_TAG: $CI_COMMIT_REF_NAME
.submodules_mirror_update: &submodules_mirror_update |
# Gitlab doesn't clean submodule contents
git submodule foreach "git clean -d -x -f" || true
# Use local mirror for submodules
git config submodule.tools/git2cl.url https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/idf/git2cl.git
git config submodule.jimtcl.url https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/idf/jimtcl.git
git config submodule.src/jtag/drivers/libjaylink.url https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/idf/libjaylink.git
git submodule update --init
.get_release_name: &get_release_name |
PREFX=${CI_PROJECT_NAME}
tmpVER=$( tmpTAG=$(git describe --tags | grep -E "^v[0-9]") && ( echo $tmpTAG | sed -n -r "s|^v(.*)|\1|gp" ) || echo "" )
if [ ! $tmpVER ]; then
tmpVER=$( tmpTAG=$(git describe --tags | grep -E "^${PREFX}-") && ( echo $tmpTAG | sed -n -r "s|^${PREFX}-(.*)|\1|gp" ) || echo "" )
if [ ! $tmpVER ]; then
echo "There is not a correct tag"; exit 1
fi
fi
REL_VERSION=$tmpVER
REL_NAME=${CI_PROJECT_NAME}-${PLATFORM_NAME}-${REL_VERSION}
ARCHIVE_NAME=${REL_NAME}.${ARCHIVE_EXT}
echo "PLATFORM_NAME: $PLATFORM_NAME"
echo "REL_VERSION: $REL_VERSION"
echo "REL_NAME: $REL_NAME"
echo "ARCHIVE_NAME: $ARCHIVE_NAME"
.dist_archive: &dist_archive |
${ARCHIVE_TOOL} ${ARCHIVE_NAME} ${DIST_INSTALLED_DIR}
mkdir -p ${DIST_ART_DIR}
mv ${ARCHIVE_NAME} ${DIST_ART_DIR}
echo "${ARCHIVE_NAME}" > ${DIST_ART_DIR}/dist_name_${PLATFORM_NAME}
.add_gitlab_key: &add_gitlab_key |
command -v ssh-agent >/dev/null || exit 1
eval $(ssh-agent -s)
printf '%s\n' "${GITLAB_KEY}" | tr -d '\r' | ssh-add - > /dev/null
mkdir -p ~/.ssh && chmod 700 ~/.ssh
[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config || true
.add_gh_key_remote: &add_gh_key_remote |
command -v ssh-agent >/dev/null || exit 1
eval $(ssh-agent -s)
printf '%s\n' "${GH_PUSH_KEY}" | tr -d '\r' | ssh-add - > /dev/null
mkdir -p ~/.ssh && chmod 700 ~/.ssh
[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config || ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
git remote remove github || true
git remote add github ${GH_PUSH_REPO}
.gh_getting_tool: &gh_getting_tool |
# do not download if it was installed locally
LOCAL_TOOL_PATH=$(command -v ${GH_TOOL_NAME}) && cp ${LOCAL_TOOL_PATH} . || wget --no-verbose -O $GH_TOOL_NAME $GH_TOOL_URL
chmod +x ./$GH_TOOL_NAME
.gh_upload_archive: &gh_upload_archive |
ARCHIVE_NAME=$(cat ${DIST_ART_DIR}/dist_name_${PLATFORM_NAME})
echo Release ${GH_REL_TAG}, file ${ARCHIVE_NAME}
${GH_TOOL} upload -s ${GITHUB_TOKEN} --tag ${GH_REL_TAG} -f ${DIST_ART_DIR}/${ARCHIVE_NAME} -n ${ARCHIVE_NAME}
# prefix should be like a $CI_PROJECT_NAME, but we cannot use variable here
.release_tag_filter: &release_tag_filter
only:
- /^v[0-9].*$/
- /^openocd-esp32-.*$/
.release_submit_action: &release_submit_action
when: manual
allow_failure: true
.prepare_espytrace_package: &prepare_espytrace_package |
IDF_ESPYTRACE_DIR=$IDF_PATH/tools/esp_app_trace/espytrace
if [ -d "$IDF_ESPYTRACE_DIR" ]; then
cp -rv $IDF_ESPYTRACE_DIR $BUILD_TEST_APP_DIR/
else
cp -rv testing/esp/extra/espytrace $BUILD_TEST_APP_DIR/
fi
.get_esptool: &get_esptool |
IDF_ESPTOOL_PATH=$IDF_PATH/components/esptool_py/esptool/esptool.py
mkdir -p $BUILD_TEST_APP_DIR/esptool
cp -v $IDF_ESPTOOL_PATH $BUILD_TEST_APP_DIR/esptool/
.prepare_test_app_build: &prepare_test_app_build |
mkdir -p $BUILD_TEST_APP_DIR
cp -rv testing/esp/test_apps/gen_ut_app $BUILD_TEST_APP_DIR/
pushd $BUILD_TEST_APP_DIR
git clone https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/espressif/esp-idf.git
pushd esp-idf
git checkout $TEST_APP_IDF_TAG || true
tools/ci/mirror-submodule-update.sh
export IDF_PATH=$PWD
export BATCH_BUILD=1
export V=0
popd
pushd gen_ut_app
.finish_test_app_build: &finish_test_app_build |
export UT_APP_DIR=$PWD
mkdir -p $UT_APP_DIR/gcov_data
if [ -d "$UT_APP_DIR/builds/apptrace_gcov_dual" ]; then
pushd $UT_APP_DIR/builds/apptrace_gcov_dual
find . -type d -exec mkdir -p $UT_APP_DIR/gcov_data/apptrace_gcov_dual/\{\} \;
popd
fi
if [ -d "$UT_APP_DIR/builds/apptrace_gcov_single" ]; then
pushd $UT_APP_DIR/builds/apptrace_gcov_single
find . -type d -exec mkdir -p $UT_APP_DIR/gcov_data/apptrace_gcov_single/\{\} \;
popd
fi
echo "export OPENOCD_GCOV_PREFIX=$UT_APP_DIR/gcov_data" > $UT_APP_DIR/gcov_data/gcov_env.sh
export PREFIX_STRIP=$(awk -F"/" '{print NF-1}' <<< $UT_APP_DIR/builds)
echo "export OPENOCD_GCOV_PREFIX_STRIP=$PREFIX_STRIP" >> $UT_APP_DIR/gcov_data/gcov_env.sh
popd
popd
.build_legacy_test_app_template: &build_legacy_test_app_template
stage: build
image: $CI_DOCKER_REGISTRY/esp32-ci-env
tags:
- build
artifacts:
paths:
- $BUILD_TEST_APP_DIR/gen_ut_app/output/*/gen_ut_app.elf
- $BUILD_TEST_APP_DIR/gen_ut_app/output/*/gen_ut_app.bin
- $BUILD_TEST_APP_DIR/gen_ut_app/output/*/partitions_singleapp.bin
- $BUILD_TEST_APP_DIR/gen_ut_app/output/multi_app_images/partitions_multi_apps.bin
- $BUILD_TEST_APP_DIR/gen_ut_app/output/*/bootloader/bootloader.bin
# Needed to run tests
- $BUILD_TEST_APP_DIR/gen_ut_app/main/gcov_tests.gcda.gcov
- $BUILD_TEST_APP_DIR/gen_ut_app/main/helper_funcs.gcda.gcov
- $BUILD_TEST_APP_DIR/gen_ut_app/gcov_data/apptrace_gcov_dual
- $BUILD_TEST_APP_DIR/gen_ut_app/gcov_data/apptrace_gcov_single
- $BUILD_TEST_APP_DIR/gen_ut_app/gcov_data/gcov_env.sh
- $BUILD_TEST_APP_DIR/espytrace
- $BUILD_TEST_APP_DIR/esptool
expire_in: 2 weeks
script:
- *add_gitlab_key
- *prepare_test_app_build
- make defconfig && make ut-build-all-configs
- *finish_test_app_build
- *prepare_espytrace_package
- *get_esptool
.do_build_test_app: &do_build_test_app |
if [ -z "$TEST_APP_CONFIGS" ]; then
echo "Build ALL"
IDF_TARGET=${CHIP_NAME} $IDF_PATH/tools/idf.py ut-build-all-configs
else
for cfg_name in $TEST_APP_CONFIGS
do
echo "Build <${cfg_name}>"
IDF_TARGET=${CHIP_NAME} $IDF_PATH/tools/idf.py ut-apply-config-$cfg_name
IDF_TARGET=${CHIP_NAME} $IDF_PATH/tools/idf.py ut-build-$cfg_name
done
fi
.build_test_app_template: &build_test_app_template
stage: build
image: $CI_DOCKER_REGISTRY/esp-env:${ESP_ENV_DOCKER_IMG_TAG}
tags:
- build
artifacts:
paths:
- $BUILD_TEST_APP_DIR/gen_ut_app/output/*/gen_ut_app.elf
- $BUILD_TEST_APP_DIR/gen_ut_app/output/*/gen_ut_app.bin
- $BUILD_TEST_APP_DIR/gen_ut_app/output/*/partition_table/partition-table.bin
- $BUILD_TEST_APP_DIR/gen_ut_app/output/*/bootloader/bootloader.bin
- $BUILD_TEST_APP_DIR/gen_ut_app/output/*/flasher_args.json
# Needed to run tests
- $BUILD_TEST_APP_DIR/gen_ut_app/main/gcov_tests.gcda.gcov
- $BUILD_TEST_APP_DIR/gen_ut_app/main/helper_funcs.gcda.gcov
- $BUILD_TEST_APP_DIR/gen_ut_app/gcov_data/apptrace_gcov_dual
- $BUILD_TEST_APP_DIR/gen_ut_app/gcov_data/apptrace_gcov_single
- $BUILD_TEST_APP_DIR/gen_ut_app/gcov_data/gcov_env.sh
- $BUILD_TEST_APP_DIR/espytrace
- $BUILD_TEST_APP_DIR/esptool
expire_in: 2 weeks
script:
- *add_gitlab_key
- *prepare_test_app_build
- source /opt/pyenv/activate
- pyenv global $(pyenv versions --bare)
- ${IDF_PATH}/tools/idf_tools.py install-python-env
- ${IDF_PATH}/tools/idf_tools.py install ${TOOLCHAIN_PREFIX}-elf
# 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}"
- *do_build_test_app
- *finish_test_app_build
- *prepare_espytrace_package
- *get_esptool
.run_tests_linux: &run_tests_linux |
ARCHIVE_NAME=$(cat ${DIST_ART_DIR}/dist_name_${PLATFORM_NAME})
tar -C ${TEST_RUN_DIR} -x -f ${DIST_ART_DIR}/${ARCHIVE_NAME}
export DIST_DIR=${PWD}/${TEST_RUN_DIR}/${DIST_INSTALLED_DIR}
export PATH=$PWD/${TEST_RUN_DIR}/esptool:$PATH
export PYTHONPATH=$PWD/${TEST_RUN_DIR}:$PWD/testing/esp/py_debug_backend
. $PWD/${TEST_RUN_DIR}/gen_ut_app/gcov_data/gcov_env.sh
testing/esp/run_tests.py -o $DIST_DIR/bin/openocd -s $DIST_DIR/share/openocd/scripts -a $PWD/$TEST_RUN_DIR -t ${TOOLCHAIN_PREFIX}-elf- -d 4 -l $PWD/$TEST_RUN_DIR/debug_backend_tests.log -to $PWD/$TEST_RUN_DIR/results $TEST_RUN_EXTRA_OPTS
.tests_linux_template: &tests_linux_template
stage: test
image: $CI_DOCKER_REGISTRY/esp32-ci-env
artifacts:
paths:
- $TEST_RUN_DIR/debug_backend_tests.log
reports:
junit:
- $TEST_RUN_DIR/results/*
when: always
expire_in: 1 week
script:
- *add_gitlab_key
- *submodules_mirror_update
- *run_tests_linux
.export_toolchain: &export_toolchain |
export PATH=${HOME}/.espressif/tools/${TOOLCHAIN_PREFIX}-elf/${ESP_TOOLCHAIN}/${TOOLCHAIN_PREFIX}-elf/bin:${PATH}
source /opt/pyenv/activate && pyenv global ${TEST_IMAGE_PYTHON_VER}
.tests_armel_template: &tests_armel_template
stage: test
image: $CI_DOCKER_REGISTRY/rpi-test-env
artifacts:
paths:
- $TEST_RUN_DIR/debug_backend_tests.log
reports:
junit:
- $TEST_RUN_DIR/results/*
when: always
expire_in: 1 week
script:
- *add_gitlab_key
- *submodules_mirror_update
- *export_toolchain
- *run_tests_linux
before_script:
- set -o errexit; set -o pipefail; set -o nounset
- test "${DEBUG_SHELL:-''}" = "1" && set -x
build_linux:
stage: build
image: $CI_DOCKER_REGISTRY/esp32-toolchain
tags:
- build
artifacts:
paths:
- ${DIST_ART_DIR}
expire_in: 2 weeks
variables:
PLATFORM_NAME: "linux64"
script:
- *get_release_name
- *add_gitlab_key
- *submodules_mirror_update
- ./bootstrap
- mkdir _build
- pushd _build/
- ../configure --prefix=$PWD/../$DIST_INSTALLED_DIR $OPENOCD_CONFIGURE_OPTS
- make
- src/openocd --version 2>&1 | { ! grep 'dirty'; }
- MAKEFLAGS= make install-strip
- popd
- *dist_archive
.build_linux_armel_template: &build_linux_armel_template
stage: build
image: $CI_DOCKER_REGISTRY/esp32-toolchain-arm-cross
tags:
- build
artifacts:
paths:
- ${DIST_ART_DIR}
reports:
junit:
- _build/*.log
when: always
expire_in: 2 weeks
script:
- *get_release_name
- *add_gitlab_key
- *submodules_mirror_update
- ./bootstrap
- mkdir _build
- pushd _build/
- ../configure CFLAGS="${TEST_CFLAGS}" --prefix=$PWD/../$DIST_INSTALLED_DIR --host=${CONF_HOST} $OPENOCD_CONFIGURE_OPTS
- make
- MAKEFLAGS= make install-strip
- popd
- *dist_archive
build_linux_armel:
<<: *build_linux_armel_template
variables:
CONF_HOST: "arm-linux-gnueabi"
PLATFORM_NAME: "armel"
TEST_CFLAGS: ""
build_linux_armel_test:
<<: *build_linux_armel_template
only:
refs:
- schedules
variables:
- $SCHEDULE_TYPE == "build_sanitizer_test"
variables:
CONF_HOST: "arm-linux-gnueabi"
PLATFORM_NAME: "armel-test"
TEST_CFLAGS: "-Wl,--no-as-needed -ldl -fsanitize=address -fsanitize=undefined -fsanitize-recover=address -ggdb3"
build_windows:
stage: build
image: $CI_DOCKER_REGISTRY/esp32-toolchain-win-cross
tags:
- build
artifacts:
paths:
- ${DIST_ART_DIR}
expire_in: 2 weeks
variables:
CONF_HOST: "i686-w64-mingw32"
PLATFORM_NAME: "win32"
ARCHIVE_TOOL: "zip -r"
ARCHIVE_EXT: "zip"
script:
- *get_release_name
- *add_gitlab_key
- *submodules_mirror_update
# Build libusb-1.0
- export LIBUSB_VER=libusb-1.0.21
- wget https://dl.espressif.com/dl/$LIBUSB_VER.tar.gz -O $LIBUSB_VER.tar.gz
- tar xzf $LIBUSB_VER.tar.gz && rm $LIBUSB_VER.tar.gz
- pushd $LIBUSB_VER
- ./bootstrap.sh
- ./configure --prefix=$PWD/dist --host=${CONF_HOST} --enable-shared=no --enable-static=yes
- make
- make install-strip
- export PKG_CONFIG_PATH=$PWD/dist/lib/pkgconfig
- popd
# Build zlib-1.2.11
- export ZLIB_VER=zlib-1.2.11
- wget https://dl.espressif.com/dl/$ZLIB_VER.tar.xz -O $ZLIB_VER.tar.xz
- tar xf $ZLIB_VER.tar.xz && rm $ZLIB_VER.tar.xz
- pushd $ZLIB_VER
- mkdir _build
- INSTALLDIR=_build
- make -f win32/Makefile.gcc BINARY_PATH=$INSTALLDIR/bin INCLUDE_PATH=$INSTALLDIR/include LIBRARY_PATH=$INSTALLDIR/lib SHARED_MODE=1 PREFIX=${CONF_HOST}- install
- export CPPFLAGS="-I$PWD/$INSTALLDIR/include"
- export LDFLAGS="-L$PWD/$INSTALLDIR/lib"
- export ZLIB_DIR=$PWD/$INSTALLDIR/bin
- popd
# Build OpenOCD
- git submodule update --init
- ./bootstrap
- mkdir _build
- pushd _build/
- ../configure --prefix=$PWD/../$DIST_INSTALLED_DIR --host=${CONF_HOST} $OPENOCD_CONFIGURE_OPTS
- make
- MAKEFLAGS= make install-strip
- popd
- cp /usr/${CONF_HOST}/lib/libwinpthread-1.dll $DIST_INSTALLED_DIR/bin/
- cp ${ZLIB_DIR}/zlib1.dll $DIST_INSTALLED_DIR/bin/
- *dist_archive
build_macos:
stage: build
image: $CI_DOCKER_REGISTRY/esp32-toolchain-macos-cross:2
tags:
- build
artifacts:
paths:
- ${DIST_ART_DIR}
expire_in: 2 weeks
variables:
PLATFORM_NAME: "macos"
CONF_HOST: "x86_64-apple-darwin14"
script:
- *get_release_name
- *add_gitlab_key
- *submodules_mirror_update
# Osxcross comes with a no-op symlink for pkg-confg,
# remove it and install pkg-config.
# TODO: prepare a Docker image which would have it included.
- rm -f `which ${CONF_HOST}-pkg-config`
- wget https://dl.espressif.com/dl/pkg-config_0.28-1_amd64.deb
- dpkg -i ./pkg-config_0.28-1_amd64.deb
# Build bootstrap tcl interpreter.
# TODO: include 'tcl' package into the docker image instead
- cp -r jimtcl jimtcl-bootstarp
- pushd jimtcl-bootstarp/
- ./configure --prefix=$PWD/local
- make
- make install
- popd
# Cross-compile libusb-1.0 for OSX
- export LIBUSB_VER=libusb-1.0.21
- wget https://dl.espressif.com/dl/$LIBUSB_VER.tar.gz -O $LIBUSB_VER.tar.gz
- tar xzf $LIBUSB_VER.tar.gz && rm $LIBUSB_VER.tar.gz
- pushd $LIBUSB_VER
- ./bootstrap.sh
- ./configure --prefix=$PWD/dist --host=${CONF_HOST} --enable-shared=no --enable-static=yes CC=${CONF_HOST}-cc
- make
- make install
- popd
# Finally, cross-compile OpenOCD
- export PKG_CONFIG_PATH=$PWD/$LIBUSB_VER/dist/lib/pkgconfig
- ./bootstrap
- mkdir _build
- pushd _build/
- ../configure --prefix=$PWD/../$DIST_INSTALLED_DIR --host=${CONF_HOST} $OPENOCD_CONFIGURE_OPTS LDFLAGS="-Wl,-framework,CoreFoundation -Wl,-framework,IOKit" CC=${CONF_HOST}-cc
- make
- MAKEFLAGS= make install-strip
- popd
- *dist_archive
build_test_app_esp32:
<<: *build_test_app_template
variables:
BUILD_TEST_APP_DIR: "build_test_app_esp32"
TEST_APP_CONFIGS: ""
UT_GET_IDF_VER: "0"
build_test_app_esp32s2:
<<: *build_test_app_template
variables:
CHIP_NAME: "esp32s2"
TOOLCHAIN_PREFIX: "xtensa-esp32s2"
BUILD_TEST_APP_DIR: "build_test_app_esp32s2"
TEST_APP_CONFIGS: ""
UT_GET_IDF_VER: "0"
build_test_app_esp32_legacy_idf_rel:
<<: *build_legacy_test_app_template
variables:
BUILD_TEST_APP_DIR: "build_test_app_esp32_legacy_idf_rel"
TEST_APP_CONFIGS: ""
TEST_APP_IDF_TAG: "${TEST_APP_LEGACY_IDF_RELEASE_BRANCH}"
UT_GET_IDF_VER: "1"
build_test_app_esp32_custom_idf_rel:
<<: *build_test_app_template
variables:
BUILD_TEST_APP_DIR: "build_test_app_esp32_custom_idf_rel"
TEST_APP_CONFIGS: "default single_core"
TEST_APP_IDF_TAG: "${TEST_APP_CUSTOM_IDF_RELEASE_BRANCH}"
UT_GET_IDF_VER: "1"
build_test_app_esp32_flash_encrypted:
<<: *build_test_app_template
variables:
BUILD_TEST_APP_DIR: "build_test_app_esp32_flash_encrypted"
TEST_APP_CONFIGS: "default_encrypted single_core_encrypted"
UT_GET_IDF_VER: "0"
build_test_app_esp32s2_flash_encrypted:
<<: *build_test_app_template
variables:
CHIP_NAME: "esp32s2"
TOOLCHAIN_PREFIX: "xtensa-esp32s2"
BUILD_TEST_APP_DIR: "build_test_app_esp32s2_flash_encrypted"
TEST_APP_CONFIGS: "single_core_encrypted"
UT_GET_IDF_VER: "0"
build_test_app_esp32c3:
<<: *build_test_app_template
variables:
CHIP_NAME: "esp32c3"
TOOLCHAIN_PREFIX: "riscv32-esp"
BUILD_TEST_APP_DIR: "build_test_app_esp32c3"
TEST_APP_CONFIGS: "single_core svtrace_single"
UT_GET_IDF_VER: "0"
build_test_app_esp32c3_flash_encrypted:
<<: *build_test_app_template
variables:
CHIP_NAME: "esp32c3"
TOOLCHAIN_PREFIX: "riscv32-esp"
BUILD_TEST_APP_DIR: "build_test_app_esp32c3_flash_encrypted"
TEST_APP_CONFIGS: "single_core_encrypted"
UT_GET_IDF_VER: "0"
.get_fixed_riscv32_esp_elf_gdb: &get_fixed_riscv32_esp_elf_gdb
- pushd $TEST_RUN_DIR
- git clone https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/alexey/temp_binary_storage.git
- export PATH=$PWD/temp_binary_storage/riscv32-esp-elf:$PATH
- popd
.tests_armel_esp32c3_fixed:
extends: .tests_armel_template
script:
- *add_gitlab_key
- *submodules_mirror_update
- *export_toolchain
- *get_fixed_riscv32_esp_elf_gdb
- *run_tests_linux
tests_armel_esp32c3:
extends: .tests_armel_esp32c3_fixed
tags:
- arm
- test_jtag_arm_esp32c3
dependencies:
- build_test_app_esp32c3
- build_linux_armel
variables:
CHIP_NAME: "esp32c3"
TOOLCHAIN_PREFIX: "riscv32-esp"
ESP_TOOLCHAIN: "${ESP_RISCV_TOOLCHAIN_VER}"
PLATFORM_NAME: "armel"
TEST_RUN_DIR: "build_test_app_esp32c3"
TEST_RUN_EXTRA_OPTS: "-i latest -b esp32c3-ftdi -p test_*.*Single"
tests_armel_esp32_solo:
<<: *tests_armel_template
tags:
- arm
- test_jtag_solo
dependencies:
- build_test_app_esp32
- build_linux_armel
variables:
PLATFORM_NAME: "armel"
TEST_RUN_DIR: "build_test_app_esp32"
TEST_RUN_EXTRA_OPTS: "-i latest -b esp32-solo-devkitj -p test_*.*Single"
tests_armel_esp32_legacy_idf_rel:
<<: *tests_armel_template
tags:
- test_jtag_arm
dependencies:
- build_test_app_esp32_legacy_idf_rel
- build_linux_armel
variables:
PLATFORM_NAME: "armel"
TEST_RUN_DIR: "build_test_app_esp32_legacy_idf_rel"
TEST_RUN_EXTRA_OPTS: "-i $TEST_APP_LEGACY_IDF_RELEASE_TAG -b esp32-wrover-kit-3.3v -e *.*Encrypted"
tests_armel_esp32_custom_idf_rel:
<<: *tests_armel_template
tags:
- test_jtag_arm
dependencies:
- build_test_app_esp32_custom_idf_rel
- build_linux_armel
variables:
PLATFORM_NAME: "armel"
TEST_RUN_DIR: "build_test_app_esp32_custom_idf_rel"
# currently we need to run semihost test on IDF with old semihost driver
TEST_RUN_EXTRA_OPTS: "-i $TEST_APP_CUSTOM_IDF_RELEASE_TAG -b esp32-wrover-kit-3.3v -p test_semihost -e *.*Encrypted"
tests_armel_esp32:
<<: *tests_armel_template
tags:
- test_jtag_arm
dependencies:
- build_test_app_esp32
- build_linux_armel
variables:
PLATFORM_NAME: "armel"
TEST_RUN_DIR: "build_test_app_esp32"
TEST_RUN_EXTRA_OPTS: "-i latest -b esp32-wrover-kit-3.3v -e *.*Encrypted"
tests_armel_esp32_flash_encrypted:
<<: *tests_armel_template
tags:
- test_jtag_arm_flash_encryption
dependencies:
- build_test_app_esp32_flash_encrypted
- build_linux_armel
variables:
PLATFORM_NAME: "armel"
TEST_RUN_DIR: "build_test_app_esp32_flash_encrypted"
TEST_RUN_EXTRA_OPTS: "-i latest -b esp32-wrover-kit-3.3v -p test_*.*Encrypted"
tests_armel_esp32s2:
<<: *tests_armel_template
tags:
- test_jtag_arm_esp32s2
dependencies:
- build_test_app_esp32s2
- build_linux_armel
variables:
CHIP_NAME: "esp32s2"
TOOLCHAIN_PREFIX: "xtensa-esp32s2"
PLATFORM_NAME: "armel"
TEST_RUN_DIR: "build_test_app_esp32s2"
TEST_RUN_EXTRA_OPTS: "-i latest -b esp32s2-devkitj -p test_*.*Single"
tests_armel_esp32s2_flash_encrypted:
<<: *tests_armel_template
tags:
- test_jtag_arm_flash_encryption_esp32s2
dependencies:
- build_test_app_esp32s2_flash_encrypted
- build_linux_armel
variables:
CHIP_NAME: "esp32s2"
TOOLCHAIN_PREFIX: "xtensa-esp32s2"
PLATFORM_NAME: "armel"
TEST_RUN_DIR: "build_test_app_esp32s2_flash_encrypted"
TEST_RUN_EXTRA_OPTS: "-i latest -b esp32s2-devkitj -p test_*.*SingleEncrypted"
tests_armel_esp32c3_flash_encrypted:
extends: .tests_armel_esp32c3_fixed
tags:
- test_jtag_arm_flash_encryption_esp32c3
dependencies:
- build_test_app_esp32c3_flash_encrypted
- build_linux_armel
variables:
CHIP_NAME: "esp32c3"
TOOLCHAIN_PREFIX: "riscv32-esp"
ESP_TOOLCHAIN: "${ESP_RISCV_TOOLCHAIN_VER}"
PLATFORM_NAME: "armel"
TEST_RUN_DIR: "build_test_app_esp32c3_flash_encrypted"
TEST_RUN_EXTRA_OPTS: "-i latest -b esp32c3-ftdi -p test_*.*SingleEncrypted"
tests_win_simple_esp32:
stage: test
tags:
- test_jtag_win
dependencies:
- build_windows
variables:
# actually we don't need the project sources, but we need the `git clean` gitlab-runner's stage.
# It's possible only for `fetch` or `clone`.
GIT_STRATEGY: fetch
PLATFORM_NAME: "win32"
before_script: []
script:
- $ARCHIVE_NAME=$(cat "$DIST_ART_DIR/dist_name_$PLATFORM_NAME")
- Expand-Archive -DestinationPath . "$DIST_ART_DIR/$ARCHIVE_NAME"
- $OPENOCD_SCRIPTS="$PWD\openocd-esp32\share\openocd\scripts"
- .\openocd-esp32\bin\openocd --version
- echo $OPENOCD_SCRIPTS
- .\openocd-esp32\bin\openocd.exe -f board\esp32-ethernet-kit-3.3v.cfg -c "init; reset halt; sleep 5; exit"
style_check:
stage: build
image: $CI_DOCKER_REGISTRY/esp32-ci-env
tags:
- build
script:
- tools/check-line-endings.sh $PWD
- tools/format-esp.sh && git diff --exit-code
osx_code_sign:
stage: pre_release
<<: *release_tag_filter
when: on_success
tags:
- macos_shell
dependencies:
- build_macos
artifacts:
paths:
- ${DIST_ART_DIR}
script:
- ARCHIVE_NAME=$(cat ${DIST_ART_DIR}/dist_name_macos)
- tar -xzf ${DIST_ART_DIR}/$ARCHIVE_NAME -C ${DIST_ART_DIR} && rm ${DIST_ART_DIR}/$ARCHIVE_NAME
- export TARGET_BINARY="${DIST_ART_DIR}/openocd-esp32/bin/openocd"
- $PWD/tools/codesign.sh
- $PWD/tools/notarize.sh
- cd ${DIST_ART_DIR}
- ${ARCHIVE_TOOL} ${ARCHIVE_NAME} openocd-esp32/
- rm -r openocd-esp32/
push_master_to_github:
stage: deploy
image: $CI_DOCKER_REGISTRY/esp32-ci-env
only:
- master
when: on_success
dependencies: []
variables:
GIT_STRATEGY: clone
script:
- *add_gh_key_remote
- git push github HEAD:master
get_gh_tools:
stage: test
<<: *release_tag_filter
artifacts:
paths:
- ${DIST_ART_DIR}
variables:
GIT_STRATEGY: none
script:
- *gh_getting_tool
- mkdir -p ${DIST_ART_DIR}
- mv ${GH_TOOL_NAME} ${DIST_ART_DIR}/
release_tag_draft:
stage: release_stage1
<<: *release_tag_filter
when: on_success
script:
- *add_gh_key_remote
- git push github --force ${CI_COMMIT_TAG}
# release draft
- ${GH_TOOL} delete -s ${GITHUB_TOKEN} --tag ${CI_COMMIT_TAG} || true
- ${GH_TOOL} release -s ${GITHUB_TOKEN} --tag ${CI_COMMIT_TAG} --description "${RELEASE_DESC}" --draft
- GH_REL_TAG=${CI_COMMIT_TAG}
# Upload archives
- PLATFORM_NAME="linux64"
- *gh_upload_archive
- PLATFORM_NAME="armel"
- *gh_upload_archive
- PLATFORM_NAME="win32"
- *gh_upload_archive
- PLATFORM_NAME="macos"
- *gh_upload_archive
Release_tag_submit:
stage: release_submit
<<: *release_tag_filter
<<: *release_submit_action
dependencies:
- get_gh_tools
variables:
GIT_STRATEGY: none
script:
- ${GH_TOOL} edit -s ${GITHUB_TOKEN} --tag ${CI_COMMIT_TAG} --description "${RELEASE_DESC}"
Pre-Release_tag_submit:
stage: release_submit
<<: *release_tag_filter
<<: *release_submit_action
dependencies:
- get_gh_tools
variables:
GIT_STRATEGY: none
script:
- ${GH_TOOL} edit -s ${GITHUB_TOKEN} --tag ${CI_COMMIT_TAG} --description "${RELEASE_DESC}" --pre-release
Delete_tag_release:
stage: release_submit
<<: *release_tag_filter
<<: *release_submit_action
dependencies:
- get_gh_tools
variables:
GIT_STRATEGY: none
script:
- ${GH_TOOL} delete -s ${GITHUB_TOKEN} --tag ${CI_COMMIT_TAG} || true
build_nuttx_app:
stage: build
variables:
TRIGGER_JOB: "OPENOCD"
trigger:
project: idf/apache/esp-nuttx-apps
strategy: depend
.copy_nuttx_files: ©_nuttx_files |
cp testing/esp/test_apps/nuttx/gdbstartup $TEST_RUN_DIR/$NUTTX_APP_NAME
mv nuttx.bin $TEST_RUN_DIR/$NUTTX_APP_NAME/$NUTTX_APP_NAME.bin
mv nuttx $TEST_RUN_DIR/$NUTTX_APP_NAME/$NUTTX_APP_NAME.elf
mv bootloader.bin partition-table.bin $TEST_RUN_DIR/$NUTTX_APP_NAME/
.run_tests_nuttx: &run_tests_nuttx |
ARCHIVE_NAME=$(cat ${DIST_ART_DIR}/dist_name_${PLATFORM_NAME})
tar -C ${TEST_RUN_DIR} -x -f ${DIST_ART_DIR}/${ARCHIVE_NAME}
export DIST_DIR=${PWD}/${TEST_RUN_DIR}/${DIST_INSTALLED_DIR}
export PYTHONPATH=$PWD/${TEST_RUN_DIR}:$PWD/testing/esp/py_debug_backend
testing/esp/run_tests.py -o $DIST_DIR/bin/openocd -s $DIST_DIR/share/openocd/scripts -a $PWD/$TEST_RUN_DIR -t ${TOOLCHAIN_PREFIX}-elf- -d 4 -l $PWD/$TEST_RUN_DIR/debug_backend_tests.log $TEST_RUN_EXTRA_OPTS -c "${OOCD_CMDS}"
test_nuttx_esp32:
image: $CI_DOCKER_REGISTRY/rpi-test-env
stage: test
tags:
- test_jtag_arm
artifacts:
paths:
- $TEST_RUN_DIR/debug_backend_tests.log
reports:
junit:
- $TEST_RUN_DIR/results/*
when: always
expire_in: 1 week
variables:
PLATFORM_NAME: "armel"
TEST_RUN_DIR: "nuttx_test"
NUTTX_APP_NAME: "nuttx_openocd"
OOCD_CMDS: "set ESP_RTOS NuttX,set ESP32_ONLYCPU 1"
TEST_RUN_EXTRA_OPTS: "-i other -b esp32-wrover-kit-3.3v -p test_nuttx -e *.*Encrypted"
needs:
- job: build_linux_armel
artifacts: true
- job: build_nuttx_app
artifacts: false
- project: idf/apache/esp-nuttx-apps
job: build_esp32_openocd
ref: master
artifacts: true
script:
- *export_toolchain
- mkdir -p $TEST_RUN_DIR/$NUTTX_APP_NAME
- *copy_nuttx_files
- *run_tests_nuttx
.use_ci_tools: &use_ci_tools |
curl -sSL ${CIT_LOADER_URL} -o cit_loader.sh && sh cit_loader.sh
source citools/import_functions
upload_to_http:
stage: private_deploy
when: manual
tags: [ "deploy", "shiny" ]
only:
- master
allow_failure: true
dependencies:
- build_linux_armel
artifacts:
reports:
dotenv: build.env
before_script:
- *use_ci_tools
script:
- cit_add_ssh_key "${HTTP_UPLOAD_KEY}"
- ARCHIVE_NAME=$(cat ${DIST_ART_DIR}/dist_name_armel)
- pushd ${DIST_ART_DIR}
- scp ${ARCHIVE_NAME} ${HTTP_UPLOAD_DIR}/openocd/
- popd
- OOCD_DISTRO_URL=${HTTP_PUBLIC_DIR}/openocd/${ARCHIVE_NAME}
- echo "Archive was published there '${OOCD_DISTRO_URL}'"
- echo "NEW_OOCD_DISTRO_URL=${OOCD_DISTRO_URL}" >> build.env
test_idf_examples:
stage: pre_release
when: manual
only:
- master
allow_failure: true
variables:
OOCD_DISTRO_URL: ${NEW_OOCD_DISTRO_URL}
needs:
- job: upload_to_http
artifacts: true
trigger:
project: espressif/esp-idf
strategy: depend
.tests_sanitizers_template: &tests_sanitizers_template
stage: sanitizer_tests
image: $CI_DOCKER_REGISTRY/rpi-test-env
artifacts:
paths:
- $TEST_RUN_DIR/debug_backend_tests.log
reports:
junit:
- $TEST_RUN_DIR/results/*
when: always
expire_in: 1 week
only:
refs:
- schedules
variables:
- $SCHEDULE_TYPE == "build_sanitizer_test"
script:
- *add_gitlab_key
- *submodules_mirror_update
- *export_toolchain
- export ASAN_OPTIONS=detect_invalid_pointer_pairs=2:print_stacktrace=1:strict_string_checks=1:halt_on_error=0:allocator_may_return_null=1
- *run_tests_linux
tests_sanitizers_esp32_solo:
<<: *tests_sanitizers_template
tags:
- arm
- test_jtag_solo
dependencies:
- build_test_app_esp32
- build_linux_armel_test
variables:
PLATFORM_NAME: "armel-test"
TEST_RUN_DIR: "build_test_app_esp32"
TEST_RUN_EXTRA_OPTS: "-i latest -b esp32-solo-devkitj -p test_*.*Single"
tests_sanitizers_esp32_legacy_idf_rel:
<<: *tests_sanitizers_template
tags:
- test_jtag_arm
dependencies:
- build_test_app_esp32_legacy_idf_rel
- build_linux_armel_test
variables:
PLATFORM_NAME: "armel-test"
TEST_RUN_DIR: "build_test_app_esp32_legacy_idf_rel"
TEST_RUN_EXTRA_OPTS: "-i $TEST_APP_LEGACY_IDF_RELEASE_TAG -b esp32-wrover-kit-3.3v -e *.*Encrypted"
tests_sanitizers_esp32_custom_idf_rel:
<<: *tests_sanitizers_template
tags:
- test_jtag_arm
dependencies:
- build_test_app_esp32_custom_idf_rel
- build_linux_armel_test
variables:
PLATFORM_NAME: "armel-test"
TEST_RUN_DIR: "build_test_app_esp32_custom_idf_rel"
# currently we need to run semihost test on IDF with old semihost driver
TEST_RUN_EXTRA_OPTS: "-i $TEST_APP_CUSTOM_IDF_RELEASE_TAG -b esp32-wrover-kit-3.3v -p test_semihost -e *.*Encrypted"
tests_sanitizers_esp32:
<<: *tests_sanitizers_template
tags:
- test_jtag_arm
dependencies:
- build_test_app_esp32
- build_linux_armel_test
variables:
PLATFORM_NAME: "armel-test"
TEST_RUN_DIR: "build_test_app_esp32"
TEST_RUN_EXTRA_OPTS: "-i latest -b esp32-wrover-kit-3.3v -e *.*Encrypted"
tests_sanitizers_esp32s2:
<<: *tests_sanitizers_template
tags:
- test_jtag_arm_esp32s2
dependencies:
- build_test_app_esp32s2
- build_linux_armel_test
variables:
CHIP_NAME: "esp32s2"
TOOLCHAIN_PREFIX: "xtensa-esp32s2"
PLATFORM_NAME: "armel-test"
TEST_RUN_DIR: "build_test_app_esp32s2"
TEST_RUN_EXTRA_OPTS: "-i latest -b esp32s2-devkitj -p test_*.*Single"
tests_sanitizers_esp32c3:
<<: *tests_sanitizers_template
tags:
- arm
- test_jtag_arm_esp32c3
dependencies:
- build_test_app_esp32c3
- build_linux_armel_test
variables:
CHIP_NAME: "esp32c3"
TOOLCHAIN_PREFIX: "riscv32-esp"
ESP_TOOLCHAIN: "${ESP_RISCV_TOOLCHAIN_VER}"
PLATFORM_NAME: "armel-test"
TEST_RUN_DIR: "build_test_app_esp32c3"
TEST_RUN_EXTRA_OPTS: "-i latest -b esp32c3-ftdi -p test_*.*Single"
test_sanitizers_nuttx_esp32:
image: $CI_DOCKER_REGISTRY/rpi-test-env
stage: sanitizer_tests
tags:
- test_jtag_arm
variables:
PLATFORM_NAME: "armel-test"
TEST_RUN_DIR: "nuttx_test"
NUTTX_APP_NAME: "nuttx_openocd"
OOCD_CMDS: "set ESP_RTOS NuttX,set ESP32_ONLYCPU 1"
TEST_RUN_EXTRA_OPTS: "-i other -b esp32-wrover-kit-3.3v -p test_nuttx -e *.*Encrypted"
needs:
- job: build_linux_armel_test
artifacts: true
- job: build_nuttx_app
artifacts: false
- project: idf/apache/esp-nuttx-apps
job: build_esp32_openocd
ref: master
artifacts: true
only:
refs:
- schedules
variables:
- $SCHEDULE_TYPE == "build_sanitizer_test"
script:
- *export_toolchain
- mkdir -p $TEST_RUN_DIR/$NUTTX_APP_NAME
- *copy_nuttx_files
- export ASAN_OPTIONS=detect_invalid_pointer_pairs=2:print_stacktrace=1:strict_string_checks=1:halt_on_error=0:allocator_may_return_null=1
- *run_tests_nuttx
.sanitizer_check_armel: &sanitizer_check_armel
stage: sanitizer_checks
image: $CI_DOCKER_REGISTRY/rpi-test-env
tags:
- arm
allow_failure: true
artifacts:
paths:
- $TEST_RUN_DIR/sanitizer_errors.log
when: always
expire_in: 1 week
only:
refs:
- schedules
variables:
- $SCHEDULE_TYPE == "build_sanitizer_test"
script:
- grep -i -e".*sanitizer" -e"runtime error" ${TEST_RUN_DIR}/debug_backend_tests.log > ${TEST_RUN_DIR}/sanitizer_errors.log || true
# fail if `sanitizer_errors.log` is not empty
- "[[ ! -s ${TEST_RUN_DIR}/sanitizer_errors.log ]]"
sanitizer_check_armel_esp32_solo:
<<: *sanitizer_check_armel
dependencies:
- tests_sanitizers_esp32_solo
variables:
TEST_RUN_DIR: "build_test_app_esp32"
sanitizer_check_armel_esp32_legacy_idf_rel:
<<: *sanitizer_check_armel
dependencies:
- tests_sanitizers_esp32_legacy_idf_rel
variables:
TEST_RUN_DIR: "build_test_app_esp32_legacy_idf_rel"
sanitizer_check_armel_esp32_custom_idf_rel:
<<: *sanitizer_check_armel
dependencies:
- tests_sanitizers_esp32_custom_idf_rel
variables:
TEST_RUN_DIR: "build_test_app_esp32_custom_idf_rel"
sanitizer_check_armel_esp32:
<<: *sanitizer_check_armel
dependencies:
- tests_sanitizers_esp32
variables:
TEST_RUN_DIR: "build_test_app_esp32"
sanitizer_check_armel_esp32s2:
<<: *sanitizer_check_armel
dependencies:
- tests_sanitizers_esp32s2
variables:
TEST_RUN_DIR: "build_test_app_esp32s2"
sanitizer_check_armel_esp32c3:
<<: *sanitizer_check_armel
dependencies:
- tests_sanitizers_esp32c3
variables:
TEST_RUN_DIR: "build_test_app_esp32c3"
sanitizer_check_armel_nuttx_esp32:
<<: *sanitizer_check_armel
dependencies:
- test_sanitizers_nuttx_esp32
variables:
TEST_RUN_DIR: "nuttx_test"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。