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
|
2021-02-09 04:51:28 +00:00
|
|
|
- build_doc
|
2018-11-26 08:40:32 +00:00
|
|
|
- target_test
|
2021-06-29 11:35:37 +00:00
|
|
|
- host_test
|
2020-06-10 03:32:43 +00:00
|
|
|
- test_deploy
|
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
|
|
|
workflow:
|
|
|
|
rules:
|
2020-11-04 07:12:22 +00:00
|
|
|
# Disable those non-protected push triggered pipelines
|
2023-09-08 12:39:12 +00:00
|
|
|
- if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_COMMIT_TAG !~ /^qa-test/ && $CI_PIPELINE_SOURCE == "push"'
|
2020-09-25 08:14:05 +00:00
|
|
|
when: never
|
2021-10-28 06:12:40 +00:00
|
|
|
# when running merged result pipelines, it would create a temp commit id. use $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA instead of $CI_COMMIT_SHA.
|
|
|
|
# Please use PIPELINE_COMMIT_SHA at all places that require a commit sha
|
|
|
|
- if: $CI_OPEN_MERGE_REQUESTS != null
|
|
|
|
variables:
|
|
|
|
PIPELINE_COMMIT_SHA: $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA
|
|
|
|
- if: $CI_OPEN_MERGE_REQUESTS == null
|
|
|
|
variables:
|
|
|
|
PIPELINE_COMMIT_SHA: $CI_COMMIT_SHA
|
2020-09-25 08:14:05 +00:00
|
|
|
- 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
|
|
|
CHECKOUT_REF_SCRIPT: "$CI_PROJECT_DIR/tools/ci/checkout_project_ref.py"
|
|
|
|
|
2020-10-24 01:21:17 +00:00
|
|
|
# Docker images
|
2018-08-03 08:28:33 +00:00
|
|
|
BOT_DOCKER_IMAGE_TAG: ":latest"
|
2022-04-25 06:56:01 +00:00
|
|
|
ESP_IDF_DOC_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-doc-env:v4.4-1-v6"
|
2021-05-26 08:44:20 +00:00
|
|
|
ESP_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-env:v4.4-1"
|
|
|
|
AFL_FUZZER_TEST_IMAGE: "$CI_DOCKER_REGISTRY/afl-fuzzer-test:v4.4-1-1"
|
2021-08-19 01:26:20 +00:00
|
|
|
CLANG_STATIC_ANALYSIS_IMAGE: "${CI_DOCKER_REGISTRY}/clang-static-analysis:v4.4-1-2"
|
2021-08-27 07:05:01 +00:00
|
|
|
SONARQUBE_SCANNER_IMAGE: "${CI_DOCKER_REGISTRY}/sonarqube-scanner:3"
|
2020-09-27 03:20:53 +00:00
|
|
|
|
2023-09-08 12:39:12 +00:00
|
|
|
# target test config file, used by scan test and assign test job
|
2021-02-09 04:31:38 +00:00
|
|
|
CI_TARGET_TEST_CONFIG_FILE: "$CI_PROJECT_DIR/.gitlab/ci/target-test.yml"
|
2020-09-27 03:20:53 +00:00
|
|
|
|
2020-10-24 01:21:17 +00:00
|
|
|
# target test repo parameters
|
2020-10-29 23:59:12 +00:00
|
|
|
TEST_ENV_CONFIG_REPO: "https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/qa/ci-test-runner-configs.git"
|
2019-06-28 16:39:21 +00:00
|
|
|
|
2023-12-06 06:10:41 +00:00
|
|
|
# Set this variable to specify the file name for the known failure cases.
|
|
|
|
KNOWN_FAILURE_CASES_FILE_NAME: "4.4.txt"
|
|
|
|
|
2022-10-25 13:47:13 +00:00
|
|
|
IDF_CI_BUILD: 1
|
|
|
|
|
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
|
2021-07-08 23:50:28 +00:00
|
|
|
tools/idf_tools.py --non-interactive install ${SETUP_TOOLS_LIST:-} && eval "$(tools/idf_tools.py --non-interactive export)" || exit 1
|
2021-03-09 17:24:39 +00:00
|
|
|
if [[ ! -z "$OOCD_DISTRO_URL" && "$CI_JOB_STAGE" == "target_test" ]]; then
|
2021-01-19 20:14:59 +00:00
|
|
|
echo "Using custom OpenOCD from ${OOCD_DISTRO_URL}"
|
|
|
|
wget $OOCD_DISTRO_URL
|
|
|
|
ARCH_NAME=$(basename $OOCD_DISTRO_URL)
|
|
|
|
tar -x -f $ARCH_NAME
|
|
|
|
export OPENOCD_SCRIPTS=$PWD/openocd-esp32/share/openocd/scripts
|
|
|
|
export PATH=$PWD/openocd-esp32/bin:$PATH
|
|
|
|
fi
|
2019-06-06 17:17:29 +00:00
|
|
|
fi
|
2019-05-24 04:35:43 +00:00
|
|
|
|
2016-09-01 07:13:15 +00:00
|
|
|
before_script:
|
2020-09-27 03:20:53 +00:00
|
|
|
- source tools/ci/utils.sh
|
2022-04-19 13:03:31 +00:00
|
|
|
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
|
2018-09-25 12:43:07 +00:00
|
|
|
- source tools/ci/setup_python.sh
|
2020-09-27 03:20:53 +00:00
|
|
|
- add_gitlab_ssh_keys
|
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
|
2020-09-27 03:20:53 +00:00
|
|
|
- fetch_submodules
|
2020-08-25 08:42:36 +00:00
|
|
|
|
2018-08-13 02:35:11 +00:00
|
|
|
# used for check scripts which we want to run unconditionally
|
2021-02-09 04:31:38 +00:00
|
|
|
.before_script_no_sync_submodule:
|
2019-05-29 18:39:02 +00:00
|
|
|
before_script:
|
2017-06-26 10:42:28 +00:00
|
|
|
- echo "Not setting up GitLab key, not fetching submodules"
|
2020-09-27 03:20:53 +00:00
|
|
|
- source tools/ci/utils.sh
|
2022-04-19 13:03:31 +00:00
|
|
|
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
|
2018-09-25 12:43:07 +00:00
|
|
|
- source tools/ci/setup_python.sh
|
2017-06-26 10:42:28 +00:00
|
|
|
- source tools/ci/configure_ci_environment.sh
|
2019-03-20 05:48:44 +00:00
|
|
|
|
2021-02-09 04:31:38 +00:00
|
|
|
.before_script_minimal:
|
2020-09-27 03:20:53 +00:00
|
|
|
before_script:
|
2021-02-09 04:31:38 +00:00
|
|
|
- echo "Only load utils.sh"
|
2020-09-27 03:20:53 +00:00
|
|
|
- source tools/ci/utils.sh
|
2022-04-19 13:03:31 +00:00
|
|
|
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
|
2020-09-27 03:20:53 +00:00
|
|
|
|
|
|
|
.before_script_macos:
|
2019-10-30 14:00:18 +00:00
|
|
|
before_script:
|
2020-09-27 03:20:53 +00:00
|
|
|
- source tools/ci/utils.sh
|
2022-04-19 13:03:31 +00:00
|
|
|
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
|
2021-06-23 11:34:01 +00:00
|
|
|
- export IDF_TOOLS_PATH="${HOME}/.espressif_runner_${CI_RUNNER_ID}_${CI_CONCURRENT_ID}"
|
2022-09-23 08:20:27 +00:00
|
|
|
# Clean up idf-env.json which might not be compatible with one produced by newer ESP-IDF versions
|
|
|
|
- rm -f ${IDF_TOOLS_PATH}/idf-env.json
|
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"
|
2020-09-27 03:20:53 +00:00
|
|
|
- fetch_submodules
|
2020-07-15 16:18:33 +00:00
|
|
|
|
2021-10-26 10:34:55 +00: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 16:39:21 +00:00
|
|
|
include:
|
2021-02-09 04:31:38 +00:00
|
|
|
- '.gitlab/ci/rules.yml'
|
|
|
|
- '.gitlab/ci/docs.yml'
|
|
|
|
- '.gitlab/ci/static-code-analysis.yml'
|
|
|
|
- '.gitlab/ci/pre_check.yml'
|
|
|
|
- '.gitlab/ci/build.yml'
|
|
|
|
- '.gitlab/ci/assign-test.yml'
|
2023-09-08 12:39:12 +00:00
|
|
|
- '.gitlab/ci/integration_test.yml'
|
2021-02-09 04:31:38 +00:00
|
|
|
- '.gitlab/ci/host-test.yml'
|
|
|
|
- '.gitlab/ci/target-test.yml'
|
|
|
|
- '.gitlab/ci/deploy.yml'
|