2016-08-22 06:19:08 -04:00
|
|
|
stages:
|
2019-11-12 02:59:11 -05:00
|
|
|
- pre_check
|
2016-08-22 06:19:08 -04:00
|
|
|
- build
|
2017-05-05 08:20:31 -04:00
|
|
|
- assign_test
|
2018-06-24 22:33:59 -04:00
|
|
|
- host_test
|
2018-11-26 03:40:32 -05:00
|
|
|
- target_test
|
2020-06-09 23:32:43 -04:00
|
|
|
- test_deploy
|
2019-11-12 02:59:11 -05:00
|
|
|
- post_check
|
2016-08-22 06:19:08 -04:00
|
|
|
- deploy
|
2019-11-22 02:58:32 -05:00
|
|
|
- post_deploy
|
2016-08-22 06:19:08 -04:00
|
|
|
|
2020-09-25 04:14:05 -04: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-06 21:58:35 -04:00
|
|
|
variables:
|
2017-06-12 03:22:09 -04:00
|
|
|
# System environment
|
|
|
|
|
2017-06-07 03:42:36 -04:00
|
|
|
# Common parameters for the 'make' during CI tests
|
|
|
|
MAKEFLAGS: "-j5 --no-keep-going"
|
|
|
|
|
2017-06-12 03:22:09 -04:00
|
|
|
# GitLab-CI environment
|
|
|
|
|
2019-11-13 02:38:45 -05: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 03:22:09 -04:00
|
|
|
|
2019-05-29 14:39:02 -04:00
|
|
|
# GIT_STRATEGY is not defined here.
|
|
|
|
# Use an option from "CI / CD Settings" - "General pipelines".
|
|
|
|
|
2019-11-28 04:08:25 -05: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 00:36:31 -05:00
|
|
|
# tell build system do not check submodule update as we download archive instead of clone
|
|
|
|
IDF_SKIP_CHECK_SUBMODULES: 1
|
2017-06-14 03:52:33 -04:00
|
|
|
|
2017-06-06 21:58:35 -04:00
|
|
|
IDF_PATH: "$CI_PROJECT_DIR"
|
2018-03-27 01:13:35 -04:00
|
|
|
BATCH_BUILD: "1"
|
|
|
|
V: "0"
|
2017-10-18 07:53:10 -04:00
|
|
|
CHECKOUT_REF_SCRIPT: "$CI_PROJECT_DIR/tools/ci/checkout_project_ref.py"
|
|
|
|
|
2020-10-23 21:21:17 -04:00
|
|
|
# Docker images
|
2018-08-03 04:28:33 -04:00
|
|
|
BOT_DOCKER_IMAGE_TAG: ":latest"
|
2020-09-26 23:20:53 -04:00
|
|
|
|
2020-10-23 21:21:17 -04:00
|
|
|
# target test config file, used by assign test job
|
2019-06-28 12:39:21 -04:00
|
|
|
CI_TARGET_TEST_CONFIG_FILE: "$CI_PROJECT_DIR/tools/ci/config/target-test.yml"
|
2020-09-26 23:20:53 -04:00
|
|
|
|
2020-10-23 21:21:17 -04:00
|
|
|
# target test repo parameters
|
2020-10-29 19:59:12 -04:00
|
|
|
TEST_ENV_CONFIG_REPO: "https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/qa/ci-test-runner-configs.git"
|
|
|
|
CI_AUTO_TEST_SCRIPT_REPO_URL: "https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/qa/auto_test_script.git"
|
2021-07-21 23:24:11 -04:00
|
|
|
CI_AUTO_TEST_SCRIPT_REPO_BRANCH: "ci/v4.1"
|
2019-06-28 12:39:21 -04:00
|
|
|
|
2020-02-17 23:08:22 -05:00
|
|
|
# Versioned esp-idf-doc env image to use for all document building jobs
|
2021-04-26 02:57:17 -04:00
|
|
|
ESP_IDF_DOC_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-doc-env:v10"
|
2018-08-03 04:28:33 -04:00
|
|
|
|
2019-06-06 13:17:29 -04:00
|
|
|
.setup_tools_unless_target_test: &setup_tools_unless_target_test |
|
2019-11-22 02:58:32 -05:00
|
|
|
if [[ -n "$IDF_DONT_USE_MIRRORS" ]]; then
|
|
|
|
export IDF_MIRROR_PREFIX_MAP=
|
|
|
|
fi
|
2019-07-22 10:04:03 -04:00
|
|
|
if [[ "$SETUP_TOOLS" == "1" || "$CI_JOB_STAGE" != "target_test" ]]; then
|
2021-07-08 19:50:28 -04:00
|
|
|
tools/idf_tools.py --non-interactive install ${SETUP_TOOLS_LIST:-} && eval "$(tools/idf_tools.py --non-interactive export)" || exit 1
|
2019-06-06 13:17:29 -04:00
|
|
|
fi
|
2019-05-24 00:35:43 -04:00
|
|
|
|
2016-09-01 03:13:15 -04:00
|
|
|
before_script:
|
2020-09-26 23:20:53 -04:00
|
|
|
- source tools/ci/utils.sh
|
2018-09-25 08:43:07 -04:00
|
|
|
- source tools/ci/setup_python.sh
|
2020-09-26 23:20:53 -04:00
|
|
|
- apply_bot_filter
|
|
|
|
- add_gitlab_ssh_keys
|
2017-06-16 00:38:32 -04:00
|
|
|
- source tools/ci/configure_ci_environment.sh
|
2019-06-06 13:17:29 -04:00
|
|
|
- *setup_tools_unless_target_test
|
2020-09-26 23:20:53 -04:00
|
|
|
- fetch_submodules
|
2020-08-25 04:42:36 -04:00
|
|
|
|
2018-08-12 22:35:11 -04:00
|
|
|
# used for check scripts which we want to run unconditionally
|
2019-06-28 12:39:21 -04:00
|
|
|
.before_script_lesser_nofilter:
|
2019-05-29 14:39:02 -04:00
|
|
|
before_script:
|
|
|
|
- echo "Not setting up GitLab key, not fetching submodules, not applying bot filter"
|
2020-09-26 23:20:53 -04:00
|
|
|
- source tools/ci/utils.sh
|
2018-09-25 08:43:07 -04:00
|
|
|
- source tools/ci/setup_python.sh
|
2019-05-29 14:39:02 -04:00
|
|
|
- source tools/ci/configure_ci_environment.sh
|
2018-08-12 22:35:11 -04:00
|
|
|
|
|
|
|
# used for everything else where we want to do no prep, except for bot filter
|
2019-06-28 12:39:21 -04:00
|
|
|
.before_script_lesser:
|
2019-05-29 14:39:02 -04:00
|
|
|
before_script:
|
2017-06-26 06:42:28 -04:00
|
|
|
- echo "Not setting up GitLab key, not fetching submodules"
|
2020-09-26 23:20:53 -04:00
|
|
|
- source tools/ci/utils.sh
|
2018-09-25 08:43:07 -04:00
|
|
|
- source tools/ci/setup_python.sh
|
2020-09-26 23:20:53 -04:00
|
|
|
- apply_bot_filter
|
2017-06-26 06:42:28 -04:00
|
|
|
- source tools/ci/configure_ci_environment.sh
|
2019-03-20 01:48:44 -04:00
|
|
|
|
2020-09-26 23:20:53 -04:00
|
|
|
.before_script_slim:
|
|
|
|
before_script:
|
|
|
|
- echo "Only load utils.sh inside"
|
|
|
|
- source tools/ci/utils.sh
|
|
|
|
|
|
|
|
.before_script_macos:
|
2019-10-30 10:00:18 -04:00
|
|
|
before_script:
|
2020-09-26 23:20:53 -04:00
|
|
|
- source tools/ci/utils.sh
|
|
|
|
- apply_bot_filter
|
2021-06-23 07:34:01 -04:00
|
|
|
- export IDF_TOOLS_PATH="${HOME}/.espressif_runner_${CI_RUNNER_ID}_${CI_CONCURRENT_ID}"
|
2020-02-17 09:00:01 -05: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 10:00:18 -04:00
|
|
|
- *setup_tools_unless_target_test
|
2020-02-17 09:00:01 -05: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 10:00:18 -04:00
|
|
|
- source tools/ci/configure_ci_environment.sh
|
2020-02-17 09:00:01 -05: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"
|
2020-09-26 23:20:53 -04:00
|
|
|
- fetch_submodules
|
2020-07-15 12:18:33 -04:00
|
|
|
|
2021-10-26 06:34:55 -04:00
|
|
|
default:
|
|
|
|
retry:
|
|
|
|
max: 2
|
|
|
|
# In case of a runner failure we could hop to another one, or a network error could go away.
|
|
|
|
when: runner_system_failure
|
|
|
|
|
2019-06-28 12:39:21 -04:00
|
|
|
include:
|
2020-09-26 23:20:53 -04:00
|
|
|
- '/tools/ci/config/rules.yml'
|
2019-11-12 02:59:11 -05:00
|
|
|
- '/tools/ci/config/pre_check.yml'
|
2019-06-28 12:39:21 -04: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 02:59:11 -05:00
|
|
|
- '/tools/ci/config/post_check.yml'
|
2019-06-28 12:39:21 -04:00
|
|
|
- '/tools/ci/config/deploy.yml'
|
2019-11-22 02:58:32 -05:00
|
|
|
- '/tools/ci/config/post_deploy.yml'
|