2016-08-22 10:19:08 +00:00
|
|
|
stages:
|
2019-11-12 07:59:11 +00:00
|
|
|
- pre_check
|
2016-08-22 10:19:08 +00:00
|
|
|
- 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
|
2020-06-10 03:32:43 +00:00
|
|
|
- test_deploy
|
2019-11-12 07:59:11 +00:00
|
|
|
- post_check
|
2016-08-22 10:19:08 +00:00
|
|
|
- deploy
|
2019-11-22 07:58:32 +00:00
|
|
|
- post_deploy
|
2016-08-22 10:19:08 +00:00
|
|
|
|
2020-09-25 08:14:05 +00:00
|
|
|
# pipelines will not be created in such two cases:
|
|
|
|
# 1. MR push
|
|
|
|
# 2. push not on "master/release" branches, and not tagged
|
|
|
|
# This behavior could be changed after the `rules: changes` feature is implemented
|
|
|
|
workflow:
|
|
|
|
rules:
|
|
|
|
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
|
|
when: never
|
|
|
|
- if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_PIPELINE_SOURCE == "push"'
|
|
|
|
when: never
|
|
|
|
- when: always
|
|
|
|
|
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
|
|
|
|
|
2019-11-13 07:38:45 +00:00
|
|
|
# XXX_ATTEMPTS variables (https://docs.gitlab.com/ce/ci/yaml/README.html#job-stages-attempts) are not defined here.
|
|
|
|
# Use values from "CI / CD Settings" - "Variables".
|
2017-06-12 07:22:09 +00:00
|
|
|
|
2019-05-29 18:39:02 +00:00
|
|
|
# GIT_STRATEGY is not defined here.
|
|
|
|
# Use an option from "CI / CD Settings" - "General pipelines".
|
|
|
|
|
2019-11-28 09:08:25 +00:00
|
|
|
# we will download archive for each submodule instead of clone.
|
|
|
|
# we don't do "recursive" when fetch submodule as they're not used in CI now.
|
|
|
|
GIT_SUBMODULE_STRATEGY: none
|
|
|
|
SUBMODULE_FETCH_TOOL: "tools/ci/ci_fetch_submodule.py"
|
|
|
|
# by default we will fetch all submodules
|
|
|
|
# jobs can overwrite this variable to only fetch submodules they required
|
|
|
|
# set to "none" if don't need to fetch submodules
|
|
|
|
SUBMODULES_TO_FETCH: "all"
|
2019-11-30 05:36:31 +00:00
|
|
|
# tell build system do not check submodule update as we download archive instead of clone
|
|
|
|
IDF_SKIP_CHECK_SUBMODULES: 1
|
2017-06-14 07:52:33 +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"
|
|
|
|
|
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"
|
|
|
|
|
2020-02-18 04:08:22 +00:00
|
|
|
# Versioned esp-idf-doc env image to use for all document building jobs
|
2020-09-21 09:37:23 +00:00
|
|
|
ESP_IDF_DOC_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-doc-env:v7"
|
2018-08-03 08:28:33 +00:00
|
|
|
|
2019-11-28 09:08:25 +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-06-06 17:17:29 +00:00
|
|
|
.setup_tools_unless_target_test: &setup_tools_unless_target_test |
|
2019-11-22 07:58:32 +00:00
|
|
|
if [[ -n "$IDF_DONT_USE_MIRRORS" ]]; then
|
|
|
|
export IDF_MIRROR_PREFIX_MAP=
|
|
|
|
fi
|
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-11-28 09:08:25 +00:00
|
|
|
.fetch_submodules: &fetch_submodules |
|
|
|
|
python $SUBMODULE_FETCH_TOOL -s $SUBMODULES_TO_FETCH
|
2019-05-29 18:39:02 +00:00
|
|
|
|
2020-08-25 08:42:36 +00:00
|
|
|
.add_ssh_keys: &add_ssh_keys |
|
|
|
|
mkdir -p ~/.ssh
|
|
|
|
chmod 700 ~/.ssh
|
|
|
|
echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
|
|
|
|
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
|
|
|
|
|
2016-09-01 07:13:15 +00:00
|
|
|
before_script:
|
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
|
2020-08-25 08:42:36 +00:00
|
|
|
- *add_ssh_keys
|
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
|
2019-06-06 17:17:29 +00:00
|
|
|
- *setup_tools_unless_target_test
|
2019-11-28 09:08:25 +00:00
|
|
|
- *fetch_submodules
|
|
|
|
|
2020-08-25 08:42:36 +00:00
|
|
|
# used for component-based unit test apps
|
|
|
|
.before_script_for_component_ut:
|
|
|
|
variables:
|
|
|
|
COMPONENT_UT_EXCLUDE_LIST_FP: ${CI_PROJECT_DIR}/tools/ci/component_ut_excludes.txt
|
|
|
|
before_script:
|
|
|
|
- source tools/ci/setup_python.sh
|
|
|
|
- *apply_bot_filter
|
|
|
|
- *add_ssh_keys
|
|
|
|
- source tools/ci/configure_ci_environment.sh
|
|
|
|
- *setup_tools_unless_target_test
|
|
|
|
- *fetch_submodules
|
|
|
|
- export COMPONENT_UT_DIRS=`find components/ -name test_apps -type d`
|
|
|
|
- export COMPONENT_UT_EXCLUDES=`[ -r $COMPONENT_UT_EXCLUDE_LIST_FP ] && cat $COMPONENT_UT_EXCLUDE_LIST_FP | xargs`
|
|
|
|
|
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
|
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
|
|
|
|
2019-06-28 16:39:21 +00:00
|
|
|
.check_job_template:
|
2019-11-12 07:59:11 +00:00
|
|
|
stage: pre_check
|
2018-11-27 08:31:37 +00:00
|
|
|
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:
|
2019-11-12 07:59:11 +00:00
|
|
|
stage: pre_check
|
2018-08-27 02:48:16 +00:00
|
|
|
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-11-22 07:58:32 +00:00
|
|
|
extends: .before_script_lesser
|
2019-06-28 16:39:21 +00:00
|
|
|
|
2020-05-19 13:53:21 +00:00
|
|
|
.python_lint_template:
|
|
|
|
stage: pre_check
|
|
|
|
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
|
|
|
|
tags:
|
|
|
|
- host_test
|
|
|
|
dependencies: []
|
|
|
|
|
2019-10-30 14:00:18 +00:00
|
|
|
.macos_build_template:
|
|
|
|
stage: build
|
|
|
|
tags:
|
|
|
|
- macos_shell
|
|
|
|
dependencies: []
|
|
|
|
before_script:
|
|
|
|
- *apply_bot_filter
|
2020-02-17 14:00:01 +00:00
|
|
|
- $IDF_PATH/tools/idf_tools.py install-python-env
|
|
|
|
# On macOS, these tools need to be installed
|
|
|
|
- $IDF_PATH/tools/idf_tools.py --non-interactive install cmake ninja
|
|
|
|
# This adds tools (compilers) and the version-specific Python environment to PATH
|
2019-10-30 14:00:18 +00:00
|
|
|
- *setup_tools_unless_target_test
|
2020-02-17 14:00:01 +00:00
|
|
|
# Install packages required by CI scripts into IDF Python environment
|
|
|
|
- pip install -r $IDF_PATH/tools/ci/python_packages/ttfw_idf/requirements.txt
|
2019-10-30 14:00:18 +00:00
|
|
|
- source tools/ci/configure_ci_environment.sh
|
2020-02-17 14:00:01 +00:00
|
|
|
# Part of tools/ci/setup_python.sh; we don't use pyenv on macOS, so can't run the rest of the script.
|
|
|
|
- export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/ci/python_packages:$PYTHONPATH"
|
|
|
|
- *fetch_submodules
|
2019-10-30 14:00:18 +00:00
|
|
|
|
2020-07-15 16:18:33 +00:00
|
|
|
.build_template_app_template:
|
|
|
|
stage: build
|
|
|
|
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
|
|
|
|
tags:
|
|
|
|
- build
|
|
|
|
variables:
|
|
|
|
BATCH_BUILD: "1"
|
|
|
|
LOG_PATH: "${CI_PROJECT_DIR}/log_template_app"
|
|
|
|
BUILD_PATH: "${CI_PROJECT_DIR}/build_template_app"
|
|
|
|
SIZE_INFO_LOCATION: "$CI_PROJECT_DIR/size_info.txt"
|
|
|
|
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
|
|
|
|
only:
|
|
|
|
variables:
|
|
|
|
- $BOT_TRIGGER_WITH_LABEL == null
|
|
|
|
- $BOT_LABEL_BUILD
|
|
|
|
- $BOT_LABEL_REGULAR_TEST
|
|
|
|
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"}
|
|
|
|
- ./tools/ci/retry_failed.sh git clone ${ESP_IDF_TEMPLATE_GIT}
|
|
|
|
# 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;
|
|
|
|
|
2019-06-28 16:39:21 +00:00
|
|
|
include:
|
2019-11-12 07:59:11 +00:00
|
|
|
- '/tools/ci/config/pre_check.yml'
|
2019-06-28 16:39:21 +00:00
|
|
|
- '/tools/ci/config/build.yml'
|
|
|
|
- '/tools/ci/config/assign-test.yml'
|
|
|
|
- '/tools/ci/config/host-test.yml'
|
|
|
|
- '/tools/ci/config/target-test.yml'
|
2019-11-12 07:59:11 +00:00
|
|
|
- '/tools/ci/config/post_check.yml'
|
2019-06-28 16:39:21 +00:00
|
|
|
- '/tools/ci/config/deploy.yml'
|
2019-11-22 07:58:32 +00:00
|
|
|
- '/tools/ci/config/post_deploy.yml'
|