2016-08-22 10:19:08 +00:00
|
|
|
stages:
|
2022-06-07 01:05:15 +00:00
|
|
|
- upload_cache
|
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
|
2020-09-25 08:14:05 +00:00
|
|
|
- if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_PIPELINE_SOURCE == "push"'
|
|
|
|
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
|
2023-05-24 02:53:57 +00:00
|
|
|
IS_MR_PIPELINE: 1
|
2021-10-28 06:12:40 +00:00
|
|
|
- if: $CI_OPEN_MERGE_REQUESTS == null
|
|
|
|
variables:
|
|
|
|
PIPELINE_COMMIT_SHA: $CI_COMMIT_SHA
|
2023-05-24 02:53:57 +00:00
|
|
|
IS_MR_PIPELINE: 0
|
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"
|
2022-06-27 02:40:38 +00:00
|
|
|
PYTHON_VER: 3.7.10
|
2017-10-18 11:53:10 +00:00
|
|
|
|
2022-07-13 02:34:02 +00:00
|
|
|
CLANG_TIDY_RUNNER_PROJ: 2107 # idf/clang-tidy-runner
|
|
|
|
|
2020-10-24 01:21:17 +00:00
|
|
|
# Docker images
|
2018-08-03 08:28:33 +00:00
|
|
|
BOT_DOCKER_IMAGE_TAG: ":latest"
|
2022-01-31 06:20:59 +00:00
|
|
|
|
2023-04-19 10:24:35 +00:00
|
|
|
ESP_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-env-v5.2:1"
|
|
|
|
CLANG_STATIC_ANALYSIS_IMAGE: "${CI_DOCKER_REGISTRY}/clang-static-analysis-v5.2:1-1"
|
|
|
|
ESP_IDF_DOC_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.2:1-1"
|
2023-05-23 10:24:37 +00:00
|
|
|
QEMU_IMAGE: "${CI_DOCKER_REGISTRY}/qemu-v5.2:1-20230522"
|
2023-04-19 10:24:35 +00:00
|
|
|
TARGET_TEST_ENV_IMAGE: "$CI_DOCKER_REGISTRY/target-test-env-v5.2:1"
|
2022-01-31 06:20:59 +00:00
|
|
|
|
2021-08-27 07:05:01 +00:00
|
|
|
SONARQUBE_SCANNER_IMAGE: "${CI_DOCKER_REGISTRY}/sonarqube-scanner:3"
|
2022-07-28 07:32:13 +00:00
|
|
|
|
|
|
|
PRE_COMMIT_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-pre-commit:1"
|
2020-09-27 03:20:53 +00:00
|
|
|
|
2020-10-24 01:21:17 +00:00
|
|
|
# target test config file, used by 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
|
|
|
|
2021-09-16 14:48:03 +00:00
|
|
|
# cache python dependencies
|
|
|
|
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
|
|
|
|
2022-02-01 12:32:10 +00:00
|
|
|
# Set this variable to the branch of idf-constraints repo in order to test a custom Python constraint file. The
|
|
|
|
# branch name must be without the remote part ("origin/"). Keep the variable empty in order to use the constraint
|
|
|
|
# file from https://dl.espressif.com/dl/esp-idf.
|
|
|
|
CI_PYTHON_CONSTRAINT_BRANCH: ""
|
|
|
|
|
|
|
|
# Update the filename for a specific ESP-IDF release. It is used only with CI_PYTHON_CONSTRAINT_BRANCH.
|
2023-04-19 10:24:35 +00:00
|
|
|
CI_PYTHON_CONSTRAINT_FILE: "espidf.constraints.v5.2.txt"
|
2022-02-01 12:32:10 +00:00
|
|
|
|
2022-05-02 12:31:13 +00:00
|
|
|
# Set this variable to repository name of a Python tool you wish to install and test in the context of ESP-IDF CI.
|
|
|
|
# Keep the variable empty when not used.
|
|
|
|
CI_PYTHON_TOOL_REPO: ""
|
|
|
|
|
|
|
|
# Set this variable to the branch of a Python tool repo specified in CI_PYTHON_TOOL_REPO. The
|
|
|
|
# branch name must be without the remote part ("origin/"). Keep the variable empty when not used.
|
|
|
|
# This is used only if CI_PYTHON_TOOL_REPO is not empty.
|
|
|
|
CI_PYTHON_TOOL_BRANCH: ""
|
|
|
|
|
2022-11-05 07:46:13 +00:00
|
|
|
IDF_CI_BUILD: 1
|
|
|
|
|
2021-09-16 14:48:03 +00:00
|
|
|
cache:
|
2022-02-25 06:31:21 +00:00
|
|
|
# pull only for most of the use cases since it's cache dir.
|
2022-07-12 08:48:54 +00:00
|
|
|
# Only set "push" policy for "upload_cache" stage jobs
|
|
|
|
- key: pip-cache
|
|
|
|
paths:
|
|
|
|
- .cache/pip
|
|
|
|
policy: pull
|
|
|
|
- key: submodule-cache
|
|
|
|
paths:
|
|
|
|
- .cache/submodule_archives
|
|
|
|
policy: pull
|
2021-09-16 14:48:03 +00:00
|
|
|
|
2023-04-13 09:25:46 +00:00
|
|
|
|
2022-07-28 07:32:13 +00:00
|
|
|
.common_before_scripts: &common-before_scripts |
|
|
|
|
source tools/ci/utils.sh
|
|
|
|
is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
|
|
|
|
|
2019-11-22 07:58:32 +00:00
|
|
|
if [[ -n "$IDF_DONT_USE_MIRRORS" ]]; then
|
2022-07-28 07:32:13 +00:00
|
|
|
export IDF_MIRROR_PREFIX_MAP=
|
2019-11-22 07:58:32 +00:00
|
|
|
fi
|
2022-07-28 07:32:13 +00:00
|
|
|
|
2023-05-31 13:35:47 +00:00
|
|
|
if echo "$CI_MERGE_REQUEST_LABELS" | egrep "(^|,)include_nightly_run(,|$)"; then
|
2022-07-28 07:32:13 +00:00
|
|
|
export INCLUDE_NIGHTLY_RUN="1"
|
2019-06-06 17:17:29 +00:00
|
|
|
fi
|
2019-05-24 04:35:43 +00:00
|
|
|
|
2022-07-28 07:32:13 +00:00
|
|
|
# configure cmake related flags
|
|
|
|
source tools/ci/configure_ci_environment.sh
|
|
|
|
|
|
|
|
# add extra python packages
|
|
|
|
export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/esp_app_trace:$IDF_PATH/components/partition_table:$IDF_PATH/tools/ci/python_packages:$PYTHONPATH"
|
|
|
|
|
|
|
|
.setup_tools_and_idf_python_venv: &setup_tools_and_idf_python_venv |
|
|
|
|
# must use after setup_tools_except_target_test
|
|
|
|
# otherwise the export.sh won't work properly
|
|
|
|
|
|
|
|
# download constraint file for dev
|
2022-02-01 12:32:10 +00:00
|
|
|
if [[ -n "$CI_PYTHON_CONSTRAINT_BRANCH" ]]; then
|
2022-04-27 05:58:50 +00:00
|
|
|
wget -O /tmp/constraint.txt --header="Authorization:Bearer ${ESPCI_TOKEN}" ${GITLAB_HTTP_SERVER}/api/v4/projects/2581/repository/files/${CI_PYTHON_CONSTRAINT_FILE}/raw?ref=${CI_PYTHON_CONSTRAINT_BRANCH}
|
2022-02-01 12:32:10 +00:00
|
|
|
mkdir -p ~/.espressif
|
|
|
|
mv /tmp/constraint.txt ~/.espressif/${CI_PYTHON_CONSTRAINT_FILE}
|
|
|
|
fi
|
|
|
|
|
2022-07-28 07:32:13 +00:00
|
|
|
# Mirror
|
|
|
|
if [[ -n "$IDF_DONT_USE_MIRRORS" ]]; then
|
|
|
|
export IDF_MIRROR_PREFIX_MAP=
|
|
|
|
fi
|
|
|
|
|
|
|
|
# install latest python packages
|
|
|
|
# target test jobs
|
|
|
|
if [[ "${CI_JOB_STAGE}" == "target_test" ]]; then
|
|
|
|
# ttfw jobs
|
2023-04-06 03:10:41 +00:00
|
|
|
if ! echo "${CI_JOB_NAME}" | egrep ".*pytest.*"; then
|
2022-07-28 07:32:13 +00:00
|
|
|
run_cmd bash install.sh --enable-ci --enable-ttfw
|
|
|
|
else
|
|
|
|
run_cmd bash install.sh --enable-ci --enable-pytest
|
|
|
|
fi
|
|
|
|
elif [[ "${CI_JOB_STAGE}" == "build_doc" ]]; then
|
|
|
|
run_cmd bash install.sh --enable-ci --enable-docs
|
|
|
|
elif [[ "${CI_JOB_STAGE}" == "build" ]]; then
|
|
|
|
run_cmd bash install.sh --enable-ci --enable-pytest
|
|
|
|
else
|
2023-04-06 03:10:41 +00:00
|
|
|
if ! echo "${CI_JOB_NAME}" | egrep ".*pytest.*"; then
|
2022-10-13 05:51:15 +00:00
|
|
|
run_cmd bash install.sh --enable-ci
|
|
|
|
else
|
|
|
|
run_cmd bash install.sh --enable-ci --enable-pytest
|
|
|
|
fi
|
2022-07-28 07:32:13 +00:00
|
|
|
fi
|
|
|
|
|
2022-11-18 12:29:39 +00:00
|
|
|
# Install esp-clang if necessary
|
|
|
|
if [[ "$IDF_TOOLCHAIN" == "clang" ]]; then
|
|
|
|
$IDF_PATH/tools/idf_tools.py --non-interactive install esp-clang
|
|
|
|
fi
|
|
|
|
|
2022-07-28 07:32:13 +00:00
|
|
|
source ./export.sh
|
|
|
|
|
2023-02-28 14:15:24 +00:00
|
|
|
# Custom clang
|
|
|
|
if [[ ! -z "$CI_CLANG_DISTRO_URL" ]]; then
|
|
|
|
echo "Using custom clang from ${CI_CLANG_DISTRO_URL}"
|
|
|
|
wget $CI_CLANG_DISTRO_URL
|
|
|
|
ARCH_NAME=$(basename $CI_CLANG_DISTRO_URL)
|
|
|
|
tar -x -f $ARCH_NAME
|
|
|
|
export PATH=$PWD/esp-clang/bin:$PATH
|
|
|
|
fi
|
|
|
|
|
2022-07-28 07:32:13 +00:00
|
|
|
# Custom OpenOCD
|
|
|
|
if [[ ! -z "$OOCD_DISTRO_URL" && "$CI_JOB_STAGE" == "target_test" ]]; then
|
|
|
|
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
|
|
|
|
|
2022-05-02 12:31:13 +00:00
|
|
|
if [[ -n "$CI_PYTHON_TOOL_REPO" ]]; then
|
|
|
|
git clone --quiet --depth=1 -b ${CI_PYTHON_TOOL_BRANCH} https://gitlab-ci-token:${ESPCI_TOKEN}@${GITLAB_HTTPS_HOST}/espressif/${CI_PYTHON_TOOL_REPO}.git
|
|
|
|
pip install ./${CI_PYTHON_TOOL_REPO}
|
|
|
|
rm -rf ${CI_PYTHON_TOOL_REPO}
|
|
|
|
fi
|
|
|
|
|
2016-09-01 07:13:15 +00:00
|
|
|
before_script:
|
2022-07-28 07:32:13 +00:00
|
|
|
- *common-before_scripts
|
|
|
|
- *setup_tools_and_idf_python_venv
|
2020-09-27 03:20:53 +00:00
|
|
|
- add_gitlab_ssh_keys
|
|
|
|
- fetch_submodules
|
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:
|
2022-07-28 07:32:13 +00:00
|
|
|
- *common-before_scripts
|
2022-04-27 05:58:50 +00:00
|
|
|
|
2020-09-27 03:20:53 +00:00
|
|
|
.before_script_macos:
|
2019-10-30 14:00:18 +00:00
|
|
|
before_script:
|
2022-07-28 07:32:13 +00:00
|
|
|
- *common-before_scripts
|
2020-02-17 14:00:01 +00:00
|
|
|
# On macOS, these tools need to be installed
|
2022-07-28 07:32:13 +00:00
|
|
|
- export IDF_TOOLS_PATH="${HOME}/.espressif_runner_${CI_RUNNER_ID}_${CI_CONCURRENT_ID}"
|
2020-02-17 14:00:01 +00:00
|
|
|
- $IDF_PATH/tools/idf_tools.py --non-interactive install cmake ninja
|
|
|
|
# This adds tools (compilers) and the version-specific Python environment to PATH
|
2022-07-28 07:32:13 +00:00
|
|
|
- *setup_tools_and_idf_python_venv
|
2021-11-19 08:11:47 +00:00
|
|
|
- fetch_submodules
|
2022-07-13 02:34:02 +00:00
|
|
|
|
|
|
|
.before_script_build_jobs:
|
|
|
|
before_script:
|
2022-07-28 07:32:13 +00:00
|
|
|
- *common-before_scripts
|
|
|
|
- *setup_tools_and_idf_python_venv
|
2022-07-13 02:34:02 +00:00
|
|
|
- add_gitlab_ssh_keys
|
|
|
|
- fetch_submodules
|
2022-03-14 09:01:29 +00:00
|
|
|
- export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
|
|
|
|
- export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS}
|
2021-11-19 08:11:47 +00:00
|
|
|
|
2021-10-26 10:34:55 +00:00
|
|
|
default:
|
|
|
|
retry:
|
|
|
|
max: 2
|
2022-02-09 10:00:54 +00:00
|
|
|
when:
|
|
|
|
# In case of a runner failure we could hop to another one, or a network error could go away.
|
|
|
|
- runner_system_failure
|
|
|
|
# Job execution timeout may be caused by a network issue.
|
|
|
|
- job_execution_timeout
|
2021-10-26 10:34:55 +00:00
|
|
|
|
2019-06-28 16:39:21 +00:00
|
|
|
include:
|
2021-02-09 04:31:38 +00:00
|
|
|
- '.gitlab/ci/rules.yml'
|
2022-06-07 01:05:15 +00:00
|
|
|
- '.gitlab/ci/upload_cache.yml'
|
2021-02-09 04:31:38 +00:00
|
|
|
- '.gitlab/ci/docs.yml'
|
|
|
|
- '.gitlab/ci/static-code-analysis.yml'
|
|
|
|
- '.gitlab/ci/pre_check.yml'
|
|
|
|
- '.gitlab/ci/build.yml'
|
|
|
|
- '.gitlab/ci/assign-test.yml'
|
|
|
|
- '.gitlab/ci/host-test.yml'
|
|
|
|
- '.gitlab/ci/target-test.yml'
|
|
|
|
- '.gitlab/ci/deploy.yml'
|