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: make
32 IDF_PATH: "$CI_PROJECT_DIR"
35 APPLY_BOT_FILTER_SCRIPT: "$CI_PROJECT_DIR/tools/ci/apply_bot_filter.py"
36 CHECKOUT_REF_SCRIPT: "$CI_PROJECT_DIR/tools/ci/checkout_project_ref.py"
37 CUSTOM_TOOLCHAIN_PATH: "/opt/xtensa-custom"
40 BOT_DOCKER_IMAGE_TAG: ":latest"
41 # target test config file, used by assign test job
42 CI_TARGET_TEST_CONFIG_FILE: "$CI_PROJECT_DIR/tools/ci/config/target-test.yml"
45 # before each job, we need to check if this job is filtered by bot stage/job filter
46 .apply_bot_filter: &apply_bot_filter
47 python $APPLY_BOT_FILTER_SCRIPT || exit 0
49 .setup_custom_toolchain: &setup_custom_toolchain |
50 if [ "$IDF_XTENSA_TOOLCHAIN_URL" ] ; then
51 echo "Use a custom toolchain: ${IDF_XTENSA_TOOLCHAIN_URL:-Unknown}"
52 rm -rf "$CUSTOM_TOOLCHAIN_PATH" &&
53 mkdir -p -v "$CUSTOM_TOOLCHAIN_PATH" &&
54 pushd "$CUSTOM_TOOLCHAIN_PATH" &&
55 curl -sSL -o xtensa-custom.xxx "$IDF_XTENSA_TOOLCHAIN_URL" &&
56 ls -l xtensa-custom.xxx &&
57 tar xf xtensa-custom.xxx --strip-components 1 &&
60 PATH=$CUSTOM_TOOLCHAIN_PATH/bin:$PATH
64 .cleanup_custom_toolchain: &cleanup_custom_toolchain |
65 echo "Cleaning up $CUSTOM_TOOLCHAIN_PATH"
66 rm -rf "$CUSTOM_TOOLCHAIN_PATH"
68 .setup_tools_unless_target_test: &setup_tools_unless_target_test |
69 if [[ "$SETUP_TOOLS" == "1" || "$CI_JOB_STAGE" != "target_test" ]]; then
70 tools/idf_tools.py --non-interactive install && eval "$(tools/idf_tools.py --non-interactive export)" || exit 1
73 .show_submodule_urls: &show_submodule_urls |
74 git config --get-regexp '^submodule\..*\.url$' || true
77 - echo "Running common script"
78 - *show_submodule_urls
79 - source tools/ci/setup_python.sh
80 # apply bot filter in before script
85 - echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
86 - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
87 - chmod 600 ~/.ssh/id_rsa
88 - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
89 # Set some options and environment for CI
90 - source tools/ci/configure_ci_environment.sh
92 - *setup_tools_unless_target_test
94 - *setup_custom_toolchain
96 # used for check scripts which we want to run unconditionally
97 .before_script_lesser_nofilter:
99 GIT_SUBMODULE_STRATEGY: none
101 - echo "Not setting up GitLab key, not fetching submodules, not applying bot filter"
102 - source tools/ci/setup_python.sh
103 - source tools/ci/configure_ci_environment.sh
104 - *setup_custom_toolchain
106 # used for everything else where we want to do no prep, except for bot filter
107 .before_script_lesser:
109 GIT_SUBMODULE_STRATEGY: none
111 - echo "Not setting up GitLab key, not fetching submodules"
112 - source tools/ci/setup_python.sh
113 # apply bot filter in before script
115 - source tools/ci/configure_ci_environment.sh
116 - *setup_custom_toolchain
119 - *cleanup_custom_toolchain
123 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
127 extends: .before_script_lesser_nofilter
129 .check_job_template_with_filter:
131 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
135 extends: .before_script_lesser_nofilter
138 - '/tools/ci/config/build.yml'
139 - '/tools/ci/config/assign-test.yml'
140 - '/tools/ci/config/host-test.yml'
141 - '/tools/ci/config/target-test.yml'
142 - '/tools/ci/config/check.yml'
143 - '/tools/ci/config/deploy.yml'