2019-06-28 16:39:21 +00:00
.build_template :
stage : build
image : $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
tags :
- build
variables :
2020-07-21 08:00:05 +00:00
SIZE_INFO_LOCATION : "$CI_PROJECT_DIR/size_info.txt"
2020-11-19 07:08:53 +00:00
dependencies : [ ]
2019-06-28 16:39:21 +00:00
2020-09-27 03:20:53 +00:00
.build_template_app_template :
2021-02-09 04:31:38 +00:00
extends : .build_template
2020-09-27 03:20:53 +00:00
variables :
LOG_PATH : "${CI_PROJECT_DIR}/log_template_app"
BUILD_PATH : "${CI_PROJECT_DIR}/build_template_app"
BUILD_DIR : "@t/@w"
BUILD_LOG_MAKE : "${LOG_PATH}/make_@t_@w.txt"
BUILD_LOG_CMAKE : "${LOG_PATH}/cmake_@t_@w.txt"
BUILD_COMMAND_ARGS : ""
artifacts :
when : always
paths :
- log_template_app/*
- size_info.txt
- build_template_app/**/size.json
script :
# Set the variable for 'esp-idf-template' testing
- ESP_IDF_TEMPLATE_GIT=${ESP_IDF_TEMPLATE_GIT:-"https://github.com/espressif/esp-idf-template.git"}
2020-09-28 06:27:10 +00:00
- retry_failed git clone ${ESP_IDF_TEMPLATE_GIT}
2020-09-27 03:20:53 +00:00
# Try to use the same branch name for esp-idf-template that we're
# using on esp-idf. If it doesn't exist then just stick to the default branch
- python $CHECKOUT_REF_SCRIPT esp-idf-template esp-idf-template
- export PATH="$IDF_PATH/tools:$PATH"
- export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
- export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS}
# Only do the default cmake build for each target, remaining part are done in the build_template_app job
- tools/ci/build_template_app.sh ${BUILD_COMMAND_ARGS}
# Check if there are any stray printf/ets_printf references in WiFi libs
- cd components/esp_wifi/lib
- for dir in esp32 esp32s2; do test $(xtensa-esp32-elf-nm $dir/*.a | grep -w printf | wc -l) -eq 0; done;
- for dir in esp32 esp32s2; do test $(xtensa-esp32-elf-nm $dir/*.a | grep -w ets_printf | wc -l) -eq 0; done;
# build-related-pre-check-jobs ------------------------------------------------
# Build at least one project for each target at earliest stage to reduce build cost for obvious failing commits
fast_template_app :
2020-11-10 09:48:35 +00:00
extends :
- .build_template_app_template
2021-02-22 08:53:37 +00:00
- .rules:build:target_test
2020-09-27 03:20:53 +00:00
stage : pre_check
variables :
BUILD_COMMAND_ARGS : "-p"
#------------------------------------------------------------------------------
2019-12-20 02:52:33 +00:00
.build_ssc_template :
2020-09-27 03:20:53 +00:00
extends :
- .build_template
2021-02-09 04:31:38 +00:00
- .rules:build:integration_test
2019-06-28 16:39:21 +00:00
artifacts :
paths :
- SSC/ssc_bin
expire_in : 1 week
script :
2020-09-28 06:27:10 +00:00
- retry_failed git clone $SSC_REPOSITORY
2019-06-28 16:39:21 +00:00
- python $CHECKOUT_REF_SCRIPT SSC SSC
- cd SSC
2019-12-20 02:52:33 +00:00
- MAKEFLAGS= ./ci_build_ssc.sh $TARGET_NAME
build_ssc_esp32 :
extends : .build_ssc_template
2020-09-27 03:20:53 +00:00
parallel : 3
2019-12-20 02:52:33 +00:00
variables :
TARGET_NAME : "ESP32"
2020-01-17 03:47:08 +00:00
build_ssc_esp32s2 :
2019-12-20 02:52:33 +00:00
extends : .build_ssc_template
parallel : 2
variables :
TARGET_NAME : "ESP32S2"
2019-06-28 16:39:21 +00:00
2021-01-14 11:59:02 +00:00
build_ssc_esp32c3 :
extends : .build_ssc_template
parallel : 3
variables :
TARGET_NAME : "ESP32C3"
2021-02-09 04:31:38 +00:00
.build_esp_idf_tests_cmake_template :
extends : .build_template
2020-11-27 11:11:59 +00:00
dependencies : # set dependencies to null to avoid missing artifacts issue
2020-11-10 09:48:35 +00:00
needs :
- job : fast_template_app
artifacts : false
- scan_tests
2020-04-29 02:38:05 +00:00
artifacts :
paths :
- tools/unit-test-app/output/${IDF_TARGET}
2020-07-21 08:59:31 +00:00
- tools/unit-test-app/builds/*.json
2020-07-21 08:00:05 +00:00
- tools/unit-test-app/builds/${IDF_TARGET}/*/size.json
2020-04-29 02:38:05 +00:00
- components/idf_test/unit_test/*.yml
2020-07-21 08:00:05 +00:00
- $LOG_PATH
- $SIZE_INFO_LOCATION
2020-04-29 02:38:05 +00:00
when : always
expire_in : 4 days
variables :
LOG_PATH : "$CI_PROJECT_DIR/log_ut_cmake"
2020-07-21 08:00:05 +00:00
BUILD_PATH : ${CI_PROJECT_DIR}/tools/unit-test-app/builds
OUTPUT_PATH : ${CI_PROJECT_DIR}/tools/unit-test-app/output
BUILD_SYSTEM : "cmake"
TEST_TYPE : "unit_test"
2020-11-04 22:32:40 +00:00
PYTHON_VER : 3
2021-01-13 12:05:57 +00:00
LDGEN_CHECK_MAPPING : 1
2019-06-28 16:39:21 +00:00
script :
2020-07-21 08:00:05 +00:00
- ${IDF_PATH}/tools/ci/find_apps_build_apps.sh
2019-06-28 16:39:21 +00:00
- cd $CI_PROJECT_DIR/tools/unit-test-app
2021-03-15 06:17:43 +00:00
- python tools/UnitTestParser.py ${BUILD_PATH} ${CI_NODE_INDEX:-1}
2019-06-28 16:39:21 +00:00
2020-04-29 02:38:05 +00:00
build_esp_idf_tests_cmake_esp32 :
2021-02-09 04:31:38 +00:00
extends :
- .build_esp_idf_tests_cmake_template
- .rules:build:unit_test-esp32
2021-02-25 10:01:29 +00:00
parallel : 2
2020-04-29 02:38:05 +00:00
variables :
IDF_TARGET : esp32
build_esp_idf_tests_cmake_esp32s2 :
2021-02-09 04:31:38 +00:00
extends :
- .build_esp_idf_tests_cmake_template
- .rules:build:unit_test-esp32s2
2021-02-25 10:01:29 +00:00
parallel : 2
2020-04-29 02:38:05 +00:00
variables :
IDF_TARGET : esp32s2
2019-06-28 16:39:21 +00:00
2020-08-20 04:22:36 +00:00
build_esp_idf_tests_cmake_esp32s3 :
2021-02-09 04:31:38 +00:00
extends :
- .build_esp_idf_tests_cmake_template
- .rules:build:unit_test-esp32s3
2020-08-20 04:22:36 +00:00
variables :
IDF_TARGET : esp32s3
2020-12-30 08:10:37 +00:00
build_esp_idf_tests_cmake_esp32c3 :
2021-02-09 04:31:38 +00:00
extends :
- .build_esp_idf_tests_cmake_template
- .rules:build:unit_test-esp32c3
2020-12-30 08:10:37 +00:00
variables :
IDF_TARGET : esp32c3
2020-04-22 06:49:05 +00:00
.build_examples_template :
2021-02-09 04:31:38 +00:00
extends : .build_template
2020-11-27 11:11:59 +00:00
dependencies : # set dependencies to null to avoid missing artifacts issue
2020-11-10 09:48:35 +00:00
needs :
- job : fast_template_app
artifacts : false
- scan_tests
2020-07-21 08:00:05 +00:00
variables :
2020-08-21 06:42:25 +00:00
TEST_PREFIX : examples
TEST_RELATIVE_DIR : examples
SCAN_TEST_JSON : ${CI_PROJECT_DIR}/${TEST_RELATIVE_DIR}/test_configs/scan_${IDF_TARGET}_${BUILD_SYSTEM}.json
TEST_TYPE : example_test
LOG_PATH : ${CI_PROJECT_DIR}/log_${TEST_PREFIX}
BUILD_PATH : ${CI_PROJECT_DIR}/build_${TEST_PREFIX}
2020-11-04 22:32:40 +00:00
PYTHON_VER : 3
2021-01-13 12:05:57 +00:00
LDGEN_CHECK_MAPPING : 1
2019-06-28 16:39:21 +00:00
script :
# it's not possible to build 100% out-of-tree and have the "artifacts"
# mechanism work, but this is the next best thing
2020-07-21 08:00:05 +00:00
- ${IDF_PATH}/tools/ci/find_apps_build_apps.sh
2020-04-22 06:49:05 +00:00
build_examples_make :
2020-09-27 03:20:53 +00:00
extends :
- .build_examples_template
2021-02-09 04:31:38 +00:00
- .rules:build:example_test-esp32
2020-04-22 06:49:05 +00:00
# This is a workaround for a rarely encountered issue with building examples in CI.
# Probably related to building of Kconfig in 'make clean' stage
retry : 1
2020-08-21 06:42:25 +00:00
parallel : 8
2020-04-22 06:49:05 +00:00
artifacts :
paths :
- $LOG_PATH
2020-08-21 06:42:25 +00:00
- build_${TEST_PREFIX}/*/*/*/build/size.json
2020-07-21 08:00:05 +00:00
- $SIZE_INFO_LOCATION
2020-09-27 03:20:53 +00:00
when : always
expire_in : 4 days
2020-04-22 06:49:05 +00:00
variables :
2020-08-21 06:42:25 +00:00
BUILD_SYSTEM : make
IDF_TARGET : esp32 # currently we only support esp32
2019-06-28 16:39:21 +00:00
# same as above, but for CMake
2021-02-09 04:31:38 +00:00
.build_examples_cmake_template :
2020-04-22 06:49:05 +00:00
extends : .build_examples_template
2019-06-28 16:39:21 +00:00
artifacts :
paths :
2020-08-21 06:42:25 +00:00
- build_${TEST_PREFIX}/list.json
- build_${TEST_PREFIX}/list_job_*.json
- build_${TEST_PREFIX}/*/*/*/sdkconfig
- build_${TEST_PREFIX}/*/*/*/build/size.json
- build_${TEST_PREFIX}/*/*/*/build/*.bin
- build_${TEST_PREFIX}/*/*/*/build/*.elf
- build_${TEST_PREFIX}/*/*/*/build/*.map
- build_${TEST_PREFIX}/*/*/*/build/flasher_args.json
- build_${TEST_PREFIX}/*/*/*/build/bootloader/*.bin
- build_${TEST_PREFIX}/*/*/*/build/partition_table/*.bin
2019-06-28 16:39:21 +00:00
- $LOG_PATH
2020-07-21 08:00:05 +00:00
- $SIZE_INFO_LOCATION
2020-11-18 09:26:33 +00:00
when : always
expire_in : 4 days
2019-06-28 16:39:21 +00:00
variables :
2020-08-21 06:42:25 +00:00
BUILD_SYSTEM : cmake
2020-04-20 06:30:31 +00:00
2019-06-27 11:11:15 +00:00
build_examples_cmake_esp32 :
2021-02-09 04:31:38 +00:00
extends :
- .build_examples_cmake_template
- .rules:build:example_test-esp32
2020-07-24 02:29:48 +00:00
parallel : 10
2019-06-27 11:11:15 +00:00
variables :
IDF_TARGET : esp32
2019-08-08 03:44:24 +00:00
build_examples_cmake_esp32s2 :
2021-02-09 04:31:38 +00:00
extends :
- .build_examples_cmake_template
- .rules:build:example_test-esp32s2
2020-08-21 06:42:25 +00:00
parallel : 8
2019-08-08 03:44:24 +00:00
variables :
2020-01-17 03:47:08 +00:00
IDF_TARGET : esp32s2
2019-08-08 03:44:24 +00:00
2020-12-15 03:00:02 +00:00
build_examples_cmake_esp32c3 :
2021-02-09 04:31:38 +00:00
extends :
- .build_examples_cmake_template
- .rules:build:example_test-esp32c3
2020-12-15 03:00:02 +00:00
parallel : 8
variables :
IDF_TARGET : esp32c3
2021-02-09 04:31:38 +00:00
.build_test_apps_template :
extends : .build_examples_cmake_template
2019-10-20 18:55:11 +00:00
variables :
2020-08-21 06:42:25 +00:00
TEST_PREFIX : test_apps
TEST_RELATIVE_DIR : tools/test_apps
2020-07-21 08:00:05 +00:00
TEST_TYPE : custom_test
2019-10-20 18:55:11 +00:00
script :
2020-07-21 08:00:05 +00:00
- ${IDF_PATH}/tools/ci/find_apps_build_apps.sh
2019-10-20 18:55:11 +00:00
build_test_apps_esp32 :
2021-02-09 04:31:38 +00:00
extends :
- .build_test_apps_template
- .rules:build:custom_test-esp32
2020-08-21 06:42:25 +00:00
parallel : 8
2019-10-20 18:55:11 +00:00
variables :
IDF_TARGET : esp32
build_test_apps_esp32s2 :
2021-02-09 04:31:38 +00:00
extends :
- .build_test_apps_template
- .rules:build:custom_test-esp32s2
2020-08-21 06:42:25 +00:00
parallel : 8
2019-10-20 18:55:11 +00:00
variables :
2020-01-27 11:12:49 +00:00
IDF_TARGET : esp32s2
2019-10-20 18:55:11 +00:00
2020-10-20 10:08:15 +00:00
build_test_apps_esp32s3 :
2021-02-09 04:31:38 +00:00
extends :
- .build_test_apps_template
- .rules:build:custom_test-esp32s3
2020-10-20 10:08:15 +00:00
parallel : 8
variables :
IDF_TARGET : esp32s3
2020-12-30 08:10:37 +00:00
build_test_apps_esp32c3 :
2021-02-09 04:31:38 +00:00
extends :
- .build_test_apps_template
- .rules:build:custom_test-esp32c3
2020-12-30 08:10:37 +00:00
parallel : 8
variables :
IDF_TARGET : esp32c3
2021-02-09 04:31:38 +00:00
.build_component_ut_template :
extends : .build_test_apps_template
2020-08-21 06:42:25 +00:00
variables :
TEST_PREFIX : component_ut
TEST_RELATIVE_DIR : component_ut
build_component_ut_esp32 :
2021-02-09 04:31:38 +00:00
extends :
- .build_component_ut_template
- .rules:build:component_ut-esp32
2020-08-21 06:42:25 +00:00
variables :
IDF_TARGET : esp32
build_component_ut_esp32s2 :
2021-02-09 04:31:38 +00:00
extends :
- .build_component_ut_template
- .rules:build:component_ut-esp32s2
2020-08-21 06:42:25 +00:00
variables :
IDF_TARGET : esp32s2
2019-10-20 18:55:11 +00:00
2021-06-07 10:17:13 +00:00
build_component_ut_esp32s3 :
extends :
- .build_component_ut_template
- .rules:build:component_ut-esp32s3
variables :
IDF_TARGET : esp32s3
2020-12-30 08:10:37 +00:00
build_component_ut_esp32c3 :
2021-02-09 04:31:38 +00:00
extends :
- .build_component_ut_template
- .rules:build:component_ut-esp32c3
2020-12-30 08:10:37 +00:00
variables :
IDF_TARGET : esp32c3
2020-09-27 03:20:53 +00:00
.test_build_system_template :
extends :
- .build_template
2021-02-09 04:31:38 +00:00
- .rules:build
2020-11-10 09:48:35 +00:00
needs :
- job : fast_template_app
artifacts : false
2019-06-28 16:39:21 +00:00
script :
- ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
- rm -rf test_build_system
- mkdir test_build_system
- cd test_build_system
2020-09-27 03:20:53 +00:00
- ${IDF_PATH}/tools/ci/${SHELL_TEST_SCRIPT}
test_build_system :
extends : .test_build_system_template
variables :
SHELL_TEST_SCRIPT : test_build_system.sh
2019-06-28 16:39:21 +00:00
test_build_system_cmake :
2020-09-27 03:20:53 +00:00
extends : .test_build_system_template
variables :
SHELL_TEST_SCRIPT : test_build_system_cmake.sh
2019-07-08 16:42:46 +00:00
2019-10-30 14:00:18 +00:00
test_build_system_cmake_macos :
2020-09-27 03:20:53 +00:00
extends :
- .test_build_system_template
- .before_script_macos
2021-02-09 04:31:38 +00:00
- .rules:build:macos
2020-09-27 03:20:53 +00:00
tags :
- macos_shell
2020-10-29 02:42:37 +00:00
variables :
SHELL_TEST_SCRIPT : test_build_system_cmake.sh
2019-10-30 14:00:18 +00:00
2019-07-08 16:42:46 +00:00
build_docker :
2020-09-27 03:20:53 +00:00
extends :
2021-02-09 04:31:38 +00:00
- .before_script_minimal
- .rules:build:docker
2019-07-08 16:42:46 +00:00
stage : build
image : espressif/docker-builder:1
tags :
- build_docker_amd64_brno
variables :
DOCKER_TMP_IMAGE_NAME : "idf_tmp_image"
script :
2020-09-11 14:14:15 +00:00
- export LOCAL_CI_REPOSITORY_URL=$CI_REPOSITORY_URL
- if [ -n "$LOCAL_GITLAB_HTTPS_HOST" ]; then export LOCAL_CI_REPOSITORY_URL="https://gitlab-ci-token:${CI_JOB_TOKEN}@${LOCAL_GITLAB_HTTPS_HOST}/${CI_PROJECT_PATH}"; fi
- echo "Using repository at $LOCAL_CI_REPOSITORY_URL"
- export DOCKER_BUILD_ARGS="--build-arg IDF_CLONE_URL=${LOCAL_CI_REPOSITORY_URL} --build-arg IDF_CLONE_BRANCH_OR_TAG=${CI_COMMIT_REF_NAME} --build-arg IDF_CHECKOUT_REF=${CI_COMMIT_TAG:-$CI_COMMIT_SHA}"
2019-07-08 16:42:46 +00:00
# Build
- docker build --tag ${DOCKER_TMP_IMAGE_NAME} ${DOCKER_BUILD_ARGS} tools/docker/
# We can't mount $PWD/examples/get-started/blink into the container, see https://gitlab.com/gitlab-org/gitlab-ce/issues/41227.
# The workaround mentioned there works, but leaves around directories which need to be cleaned up manually.
# Therefore, build a copy of the example located inside the container.
- docker run --rm --workdir /opt/esp/idf/examples/get-started/blink ${DOCKER_TMP_IMAGE_NAME} idf.py build
2019-07-18 15:34:36 +00:00
2020-09-27 03:20:53 +00:00
.test-on-windows :
2020-09-28 06:27:10 +00:00
extends :
2021-02-09 04:31:38 +00:00
- .before_script_minimal
- .rules:build:windows
2019-07-18 15:34:36 +00:00
stage : build
image : $CI_DOCKER_REGISTRY/esp32-toolchain-win-cross
tags :
- build
script :
2020-09-27 03:20:53 +00:00
- cd $TEST_DIR
2019-07-18 15:34:36 +00:00
- mkdir build
- cd build
- cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain-i686-w64-mingw32.cmake -DCMAKE_BUILD_TYPE=Release ..
- cmake --build .
2020-09-27 03:20:53 +00:00
build_idf_exe :
extends : .test-on-windows
artifacts :
paths :
- tools/windows/idf_exe/build/idf-exe-v*.zip
expire_in : 4 days
variables :
TEST_DIR : tools/windows/idf_exe
2019-07-18 15:34:36 +00:00
build_cmdlinerunner :
2020-09-27 03:20:53 +00:00
extends : .test-on-windows
2019-07-18 15:34:36 +00:00
artifacts :
paths :
- tools/windows/tool_setup/cmdlinerunner/build/cmdlinerunner.dll
2019-12-11 22:38:04 +00:00
expire_in : 4 days
2020-09-27 03:20:53 +00:00
variables :
TEST_DIR : tools/windows/tool_setup/cmdlinerunner
2019-07-18 15:34:36 +00:00
build_installer :
2021-02-09 04:31:38 +00:00
extends : .test-on-windows
2019-07-18 15:34:36 +00:00
# using a different stage here to be able to use artifacts from build_cmdlinerunner job
stage : host_test
2020-08-28 10:33:48 +00:00
image : $CI_DOCKER_REGISTRY/wine-innosetup:2
2020-11-27 11:11:59 +00:00
dependencies : # set dependencies to null to avoid missing artifacts issue
2020-09-27 03:20:53 +00:00
needs :
2019-07-18 15:34:36 +00:00
- build_cmdlinerunner
script :
- cd tools/windows/tool_setup/
2019-09-23 03:42:01 +00:00
- ./build_installer.sh
2020-07-15 16:18:33 +00:00
# This job builds template app with permutations of targets and optimization levels
build_template_app :
2021-02-09 04:31:38 +00:00
extends :
- .build_template_app_template
- .rules:build
2020-11-10 09:48:35 +00:00
needs :
- job : fast_template_app
artifacts : false