2016-08-22 10:19:08 +00:00
|
|
|
stages:
|
|
|
|
- build
|
2017-05-05 12:20:31 +00:00
|
|
|
- assign_test
|
2018-06-25 02:33:59 +00:00
|
|
|
- host_test
|
2018-11-26 08:40:32 +00:00
|
|
|
- target_test
|
2018-08-13 02:35:11 +00:00
|
|
|
- check
|
2016-08-22 10:19:08 +00:00
|
|
|
- deploy
|
2018-09-29 06:51:43 +00:00
|
|
|
- post_check
|
2016-08-22 10:19:08 +00:00
|
|
|
|
2017-06-07 01:58:35 +00:00
|
|
|
variables:
|
2017-06-12 07:22:09 +00:00
|
|
|
# System environment
|
|
|
|
|
2017-06-07 07:42:36 +00:00
|
|
|
# Common parameters for the 'make' during CI tests
|
|
|
|
MAKEFLAGS: "-j5 --no-keep-going"
|
|
|
|
|
2017-06-12 07:22:09 +00:00
|
|
|
# GitLab-CI environment
|
|
|
|
|
|
|
|
# more attempts for more robust
|
|
|
|
GET_SOURCES_ATTEMPTS: "10"
|
|
|
|
ARTIFACT_DOWNLOAD_ATTEMPTS: "10"
|
|
|
|
|
2019-05-29 18:39:02 +00:00
|
|
|
# GIT_STRATEGY is not defined here.
|
|
|
|
# Use an option from "CI / CD Settings" - "General pipelines".
|
|
|
|
|
|
|
|
# "normal" strategy for fetching only top-level submodules since nothing requires the sub-submodules code for building IDF.
|
|
|
|
# If the "recursive" strategy is used we have a problem with using relative URLs for sub-submodules.
|
|
|
|
GIT_SUBMODULE_STRATEGY: normal
|
2017-06-14 07:52:33 +00:00
|
|
|
|
2018-08-27 02:48:16 +00:00
|
|
|
UNIT_TEST_BUILD_SYSTEM: make
|
2017-06-07 07:42:36 +00:00
|
|
|
# IDF environment
|
2017-06-12 07:22:09 +00:00
|
|
|
|
2017-06-07 01:58:35 +00:00
|
|
|
IDF_PATH: "$CI_PROJECT_DIR"
|
2018-03-27 05:13:35 +00:00
|
|
|
BATCH_BUILD: "1"
|
|
|
|
V: "0"
|
2017-10-18 11:53:10 +00:00
|
|
|
APPLY_BOT_FILTER_SCRIPT: "$CI_PROJECT_DIR/tools/ci/apply_bot_filter.py"
|
|
|
|
CHECKOUT_REF_SCRIPT: "$CI_PROJECT_DIR/tools/ci/checkout_project_ref.py"
|
2019-03-20 05:48:44 +00:00
|
|
|
CUSTOM_TOOLCHAIN_PATH: "/opt/xtensa-custom"
|
2017-10-18 11:53:10 +00:00
|
|
|
|
2018-08-03 08:28:33 +00:00
|
|
|
# Docker images
|
|
|
|
BOT_DOCKER_IMAGE_TAG: ":latest"
|
2019-06-28 16:39:21 +00:00
|
|
|
# target test config file, used by assign test job
|
|
|
|
CI_TARGET_TEST_CONFIG_FILE: "$CI_PROJECT_DIR/tools/ci/config/target-test.yml"
|
|
|
|
|
2018-08-03 08:28:33 +00:00
|
|
|
|
2017-10-18 11:53:10 +00:00
|
|
|
# before each job, we need to check if this job is filtered by bot stage/job filter
|
|
|
|
.apply_bot_filter: &apply_bot_filter
|
|
|
|
python $APPLY_BOT_FILTER_SCRIPT || exit 0
|
2017-06-07 01:58:35 +00:00
|
|
|
|
2019-03-20 05:48:44 +00:00
|
|
|
.setup_custom_toolchain: &setup_custom_toolchain |
|
|
|
|
if [ "$IDF_XTENSA_TOOLCHAIN_URL" ] ; then
|
|
|
|
echo "Use a custom toolchain: ${IDF_XTENSA_TOOLCHAIN_URL:-Unknown}"
|
|
|
|
rm -rf "$CUSTOM_TOOLCHAIN_PATH" &&
|
|
|
|
mkdir -p -v "$CUSTOM_TOOLCHAIN_PATH" &&
|
|
|
|
pushd "$CUSTOM_TOOLCHAIN_PATH" &&
|
|
|
|
curl -sSL -o xtensa-custom.xxx "$IDF_XTENSA_TOOLCHAIN_URL" &&
|
|
|
|
ls -l xtensa-custom.xxx &&
|
|
|
|
tar xf xtensa-custom.xxx --strip-components 1 &&
|
|
|
|
ls -l . &&
|
|
|
|
popd
|
|
|
|
PATH=$CUSTOM_TOOLCHAIN_PATH/bin:$PATH
|
|
|
|
export PATH
|
|
|
|
fi
|
|
|
|
|
|
|
|
.cleanup_custom_toolchain: &cleanup_custom_toolchain |
|
|
|
|
echo "Cleaning up $CUSTOM_TOOLCHAIN_PATH"
|
|
|
|
rm -rf "$CUSTOM_TOOLCHAIN_PATH"
|
|
|
|
|
2019-06-06 17:17:29 +00:00
|
|
|
.setup_tools_unless_target_test: &setup_tools_unless_target_test |
|
2019-07-22 14:04:03 +00:00
|
|
|
if [[ "$SETUP_TOOLS" == "1" || "$CI_JOB_STAGE" != "target_test" ]]; then
|
2019-06-05 07:16:19 +00:00
|
|
|
tools/idf_tools.py --non-interactive install && eval "$(tools/idf_tools.py --non-interactive export)" || exit 1
|
2019-06-06 17:17:29 +00:00
|
|
|
fi
|
2019-05-24 04:35:43 +00:00
|
|
|
|
2019-05-29 18:39:02 +00:00
|
|
|
.show_submodule_urls: &show_submodule_urls |
|
|
|
|
git config --get-regexp '^submodule\..*\.url$' || true
|
|
|
|
|
2016-09-01 07:13:15 +00:00
|
|
|
before_script:
|
2019-05-29 18:39:02 +00:00
|
|
|
- echo "Running common script"
|
|
|
|
- *show_submodule_urls
|
2018-09-25 12:43:07 +00:00
|
|
|
- source tools/ci/setup_python.sh
|
2017-10-18 11:53:10 +00:00
|
|
|
# apply bot filter in before script
|
|
|
|
- *apply_bot_filter
|
2016-09-13 01:34:28 +00:00
|
|
|
# add gitlab ssh key
|
|
|
|
- mkdir -p ~/.ssh
|
|
|
|
- chmod 700 ~/.ssh
|
2016-09-13 13:24:57 +00:00
|
|
|
- echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
|
2016-09-13 01:34:28 +00:00
|
|
|
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
|
|
|
|
- chmod 600 ~/.ssh/id_rsa
|
|
|
|
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
|
2019-05-30 06:12:36 +00:00
|
|
|
# Set some options and environment for CI
|
2017-06-16 04:38:32 +00:00
|
|
|
- source tools/ci/configure_ci_environment.sh
|
2017-03-22 10:39:28 +00:00
|
|
|
|
2019-06-06 17:17:29 +00:00
|
|
|
- *setup_tools_unless_target_test
|
2019-05-24 04:35:43 +00:00
|
|
|
|
2019-03-20 05:48:44 +00:00
|
|
|
- *setup_custom_toolchain
|
|
|
|
|
2018-08-13 02:35:11 +00:00
|
|
|
# used for check scripts which we want to run unconditionally
|
2019-06-28 16:39:21 +00:00
|
|
|
.before_script_lesser_nofilter:
|
2019-05-29 18:39:02 +00:00
|
|
|
variables:
|
|
|
|
GIT_SUBMODULE_STRATEGY: none
|
|
|
|
before_script:
|
|
|
|
- echo "Not setting up GitLab key, not fetching submodules, not applying bot filter"
|
2018-09-25 12:43:07 +00:00
|
|
|
- source tools/ci/setup_python.sh
|
2019-05-29 18:39:02 +00:00
|
|
|
- source tools/ci/configure_ci_environment.sh
|
2019-03-20 05:48:44 +00:00
|
|
|
- *setup_custom_toolchain
|
2018-08-13 02:35:11 +00:00
|
|
|
|
|
|
|
# used for everything else where we want to do no prep, except for bot filter
|
2019-06-28 16:39:21 +00:00
|
|
|
.before_script_lesser:
|
2019-05-29 18:39:02 +00:00
|
|
|
variables:
|
|
|
|
GIT_SUBMODULE_STRATEGY: none
|
|
|
|
before_script:
|
2017-06-26 10:42:28 +00:00
|
|
|
- echo "Not setting up GitLab key, not fetching submodules"
|
2018-09-25 12:43:07 +00:00
|
|
|
- source tools/ci/setup_python.sh
|
2017-10-18 11:53:10 +00:00
|
|
|
# apply bot filter in before script
|
|
|
|
- *apply_bot_filter
|
2017-06-26 10:42:28 +00:00
|
|
|
- source tools/ci/configure_ci_environment.sh
|
2019-03-20 05:48:44 +00:00
|
|
|
- *setup_custom_toolchain
|
2017-06-26 10:42:28 +00:00
|
|
|
|
2019-03-20 05:48:44 +00:00
|
|
|
after_script:
|
|
|
|
- *cleanup_custom_toolchain
|
|
|
|
|
2019-06-28 16:39:21 +00:00
|
|
|
.check_job_template:
|
2018-11-27 08:31:37 +00:00
|
|
|
stage: check
|
|
|
|
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
|
|
|
|
tags:
|
|
|
|
- host_test
|
|
|
|
dependencies: []
|
2019-06-28 16:39:21 +00:00
|
|
|
extends: .before_script_lesser_nofilter
|
2018-07-27 07:26:51 +00:00
|
|
|
|
2019-06-28 16:39:21 +00:00
|
|
|
.check_job_template_with_filter:
|
2018-08-27 02:48:16 +00:00
|
|
|
stage: check
|
|
|
|
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
|
|
|
|
tags:
|
2019-06-28 16:39:21 +00:00
|
|
|
- host_test
|
2018-08-27 02:48:16 +00:00
|
|
|
dependencies: []
|
2019-06-28 16:39:21 +00:00
|
|
|
extends: .before_script_lesser_nofilter
|
|
|
|
|
|
|
|
include:
|
|
|
|
- '/tools/ci/config/build.yml'
|
|
|
|
- '/tools/ci/config/assign-test.yml'
|
|
|
|
- '/tools/ci/config/host-test.yml'
|
|
|
|
- '/tools/ci/config/target-test.yml'
|
|
|
|
- '/tools/ci/config/check.yml'
|
|
|
|
- '/tools/ci/config/deploy.yml'
|