13 # Common parameters for the 'make' during CI tests
14 MAKEFLAGS: "-j5 --no-keep-going"
16 # GitLab-CI environment
18 # more attempts for more robust
19 GET_SOURCES_ATTEMPTS: "10"
20 ARTIFACT_DOWNLOAD_ATTEMPTS: "10"
22 # GIT_STRATEGY is not defined here.
23 # Use an option from "CI / CD Settings" - "General pipelines".
25 # "normal" strategy for fetching only top-level submodules since nothing requires the sub-submodules code for building IDF.
26 # If the "recursive" strategy is used we have a problem with using relative URLs for sub-submodules.
27 GIT_SUBMODULE_STRATEGY: normal
29 UNIT_TEST_BUILD_SYSTEM: cmake
30 EXAMPLE_TEST_BUILD_SYSTEM: cmake
33 IDF_PATH: "$CI_PROJECT_DIR"
36 APPLY_BOT_FILTER_SCRIPT: "$CI_PROJECT_DIR/tools/ci/apply_bot_filter.py"
37 CHECKOUT_REF_SCRIPT: "$CI_PROJECT_DIR/tools/ci/checkout_project_ref.py"
38 CUSTOM_TOOLCHAIN_PATH: "/opt/xtensa-custom"
41 BOT_DOCKER_IMAGE_TAG: ":latest"
42 # target test config file, used by assign test job
43 CI_TARGET_TEST_CONFIG_FILE: "$CI_PROJECT_DIR/tools/ci/config/target-test.yml"
46 # before each job, we need to check if this job is filtered by bot stage/job filter
47 .apply_bot_filter: &apply_bot_filter
48 python $APPLY_BOT_FILTER_SCRIPT || exit 0
50 .setup_custom_toolchain: &setup_custom_toolchain |
51 if [ "$IDF_XTENSA_TOOLCHAIN_URL" ] ; then
52 echo "Use a custom toolchain: ${IDF_XTENSA_TOOLCHAIN_URL:-Unknown}"
53 rm -rf "$CUSTOM_TOOLCHAIN_PATH" &&
54 mkdir -p -v "$CUSTOM_TOOLCHAIN_PATH" &&
55 pushd "$CUSTOM_TOOLCHAIN_PATH" &&
56 curl -sSL -o xtensa-custom.xxx "$IDF_XTENSA_TOOLCHAIN_URL" &&
57 ls -l xtensa-custom.xxx &&
58 tar xf xtensa-custom.xxx --strip-components 1 &&
61 PATH=$CUSTOM_TOOLCHAIN_PATH/bin:$PATH
65 .cleanup_custom_toolchain: &cleanup_custom_toolchain |
66 echo "Cleaning up $CUSTOM_TOOLCHAIN_PATH"
67 rm -rf "$CUSTOM_TOOLCHAIN_PATH"
69 .setup_tools_unless_target_test: &setup_tools_unless_target_test |
70 if [ "$CI_JOB_STAGE" != "target_test" ]; then
71 tools/idf_tools.py --non-interactive install && eval "$(tools/idf_tools.py --non-interactive export)" || exit 1
74 .show_submodule_urls: &show_submodule_urls |
75 git config --get-regexp '^submodule\..*\.url$' || true
78 - echo "Running common script"
79 - *show_submodule_urls
80 - source tools/ci/setup_python.sh
81 # apply bot filter in before script
86 - echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
87 - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
88 - chmod 600 ~/.ssh/id_rsa
89 - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
90 # Set some options and environment for CI
91 - source tools/ci/configure_ci_environment.sh
93 - *setup_tools_unless_target_test
95 - *setup_custom_toolchain
97 # used for check scripts which we want to run unconditionally
98 .before_script_lesser_nofilter:
100 GIT_SUBMODULE_STRATEGY: none
102 - echo "Not setting up GitLab key, not fetching submodules, not applying bot filter"
103 - source tools/ci/setup_python.sh
104 - source tools/ci/configure_ci_environment.sh
105 - *setup_custom_toolchain
107 # used for everything else where we want to do no prep, except for bot filter
108 .before_script_lesser:
110 GIT_SUBMODULE_STRATEGY: none
112 - echo "Not setting up GitLab key, not fetching submodules"
113 - source tools/ci/setup_python.sh
114 # apply bot filter in before script
116 - source tools/ci/configure_ci_environment.sh
117 - *setup_custom_toolchain
120 - *cleanup_custom_toolchain
124 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
128 extends: .before_script_lesser_nofilter
130 .check_job_template_with_filter:
132 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
136 extends: .before_script_lesser_nofilter
139 - '/tools/ci/config/build.yml'
140 - '/tools/ci/config/assign-test.yml'
141 - '/tools/ci/config/host-test.yml'
142 - '/tools/ci/config/target-test.yml'
143 - '/tools/ci/config/check.yml'
144 - '/tools/ci/config/deploy.yml'