@@ -34,8 +34,7 @@ variables:
3434 # since we're using merged-result pipelines, the last commit should work for most cases
3535 # --prune --prune-tags: in case remote branch or tag is force pushed
3636 GIT_FETCH_EXTRA_FLAGS : " --no-recurse-submodules --prune --prune-tags"
37- # we're using .cache folder for caches
38- GIT_CLEAN_FLAGS : -ffdx -e .cache/
37+
3938 LATEST_GIT_TAG : v6.0-rc1
4039
4140 SUBMODULE_FETCH_TOOL : " tools/ci/ci_fetch_submodule.py"
@@ -168,9 +167,6 @@ variables:
168167 # Done after sourcing export.sh so that we could easily invoke the right pip
169168 section_start "upgrade_ci_dependencies" "Upgrading CI dependencies"
170169 pip install --upgrade --upgrade-strategy=eager -r $IDF_PATH/tools/requirements/requirements.ci.txt -c ~/.espressif/${CI_PYTHON_CONSTRAINT_FILE}
171- if [[ "${CI_JOB_STAGE}" == "target_test" ]]; then
172- pip install --upgrade --upgrade-strategy=eager -r $IDF_PATH/tools/requirements/requirements.test-specific.txt -c ~/.espressif/${CI_PYTHON_CONSTRAINT_FILE}
173- fi
174170 section_end "upgrade_ci_dependencies"
175171
176172 REEXPORT_NEEDED=0
@@ -245,155 +241,20 @@ variables:
245241 before_script :
246242 - *common-before_scripts
247243
248- .before_script:build :
249- before_script :
250- - *common-before_scripts
251- - *setup_tools_and_idf_python_venv
252- - add_gitlab_ssh_keys
253- - fetch_submodules
254- - export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
255- - export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS}
256-
257244.after_script:build :
258245 after_script :
259246 - source tools/ci/utils.sh
260247 - *show_ccache_statistics
261248 - *upload_failed_job_log_artifacts
262249
263- # #############################
264- # Git Strategy Job Templates #
265- # #############################
266- .git_init : &git_init |
267- mkdir -p "${CI_PROJECT_DIR}"
268- cd "${CI_PROJECT_DIR}"
269- git init
270-
271- .git_fetch_from_mirror_url_if_exists : &git_fetch_from_mirror_url_if_exists |
272- # check if set mirror
273- if [ -n "${LOCAL_GITLAB_HTTPS_HOST:-}" ] && [ -n "${ESPCI_TOKEN:-}" ]; then
274- MIRROR_REPO_URL="https://bot:${ESPCI_TOKEN}@${LOCAL_GITLAB_HTTPS_HOST}/${CI_PROJECT_PATH}"
275- elif [ -n "${LOCAL_GIT_MIRROR:-}" ]; then
276- MIRROR_REPO_URL="${LOCAL_GIT_MIRROR}/${CI_PROJECT_PATH}"
277- fi
278-
279- # fetch from mirror first if set
280- if [ -n "${MIRROR_REPO_URL:-}" ]; then
281- if git remote -v | grep origin; then
282- git remote set-url origin "${MIRROR_REPO_URL}"
283- else
284- git remote add origin "${MIRROR_REPO_URL}"
285- fi
286- # mirror url may fail with authentication issue
287- git fetch origin --no-recurse-submodules || true
288- fi
289-
290- # set remote url to CI_REPOSITORY_URL
291- if git remote -v | grep origin; then
292- git remote set-url origin "${CI_REPOSITORY_URL}"
293- else
294- git remote add origin "${CI_REPOSITORY_URL}"
295- fi
296-
297- .git_checkout_ci_commit_sha : &git_checkout_ci_commit_sha |
298- git checkout $CI_COMMIT_SHA
299- eval "git clean ${GIT_CLEAN_FLAGS}"
300-
301- # git diff requires two commits, with different CI env var
302- #
303- # By default, we use git strategy "clone" with depth 1 to speed up the clone process.
304- # But for jobs requires running `git diff`, we need to fetch more commits to get the correct diffs.
305- #
306- # Since there's no way to get the correct git_depth before the job starts,
307- # we can't set `GIT_DEPTH` in the job definition.
308- #
309- # Set git strategy to "none" and fetch manually instead.
310- .before_script:fetch:git_diff :
311- variables :
312- GIT_STRATEGY : none
313- before_script :
314- - *git_init
315- - *git_fetch_from_mirror_url_if_exists
316- - |
317- # Store the diff output in a temporary file
318- TEMP_FILE=$(mktemp)
319- # merged results pipelines, by default
320- if [[ -n $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA ]]; then
321- git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_SHA
322- git fetch origin $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA
323-
324- git diff --name-only $CI_MERGE_REQUEST_TARGET_BRANCH_SHA...$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA > "$TEMP_FILE"
325- GIT_DIFF_OUTPUT=$(cat "$TEMP_FILE")
326- git fetch origin $CI_COMMIT_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
327- # merge request pipelines, when the mr got conflicts
328- elif [[ -n $CI_MERGE_REQUEST_DIFF_BASE_SHA ]]; then
329- git fetch origin $CI_MERGE_REQUEST_DIFF_BASE_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
330- git fetch origin $CI_COMMIT_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
331- git diff --name-only $CI_MERGE_REQUEST_DIFF_BASE_SHA $CI_COMMIT_SHA > "$TEMP_FILE"
332- GIT_DIFF_OUTPUT=$(cat "$TEMP_FILE")
333- # other pipelines, like the protected branches pipelines
334- elif [[ "$CI_COMMIT_BEFORE_SHA" != "0000000000000000000000000000000000000000" ]]; then
335- git fetch origin $CI_COMMIT_BEFORE_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
336- git fetch origin $CI_COMMIT_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
337- git diff --name-only $CI_COMMIT_BEFORE_SHA $CI_COMMIT_SHA > "$TEMP_FILE"
338- GIT_DIFF_OUTPUT=$(cat "$TEMP_FILE")
339- else
340- # pipeline source could be web, scheduler, etc.
341- git fetch origin $CI_COMMIT_SHA --depth=2 ${GIT_FETCH_EXTRA_FLAGS}
342- git diff --name-only $CI_COMMIT_SHA~1 $CI_COMMIT_SHA > "$TEMP_FILE"
343- GIT_DIFF_OUTPUT=$(cat "$TEMP_FILE")
344- fi
345- - *git_checkout_ci_commit_sha
346- - *common-before_scripts
347- - *setup_tools_and_idf_python_venv
348- - add_gitlab_ssh_keys
349-
350- # target test runners may locate in different places
351- # for runners set git mirror, we fetch from the mirror first, then fetch the HEAD commit
352- .before_script:fetch:target_test :
353- variables :
354- GIT_STRATEGY : none
355- before_script :
356- - *git_init
357- - *git_fetch_from_mirror_url_if_exists
358- - eval "git fetch --depth=1 ${GIT_FETCH_EXTRA_FLAGS} origin ${CI_COMMIT_SHA}"
359- - *git_checkout_ci_commit_sha
360- - *common-before_scripts
361- - *setup_tools_and_idf_python_venv
362- - add_gitlab_ssh_keys
363- # no submodules
364-
365250.brew-macos-settings :
366251 variables :
367- GIT_STRATEGY : none # we do manual git clone to use local mirror
252+ GIT_STRATEGY : fetch
368253 IDF_CCACHE_ENABLE : " 0"
369254 CCACHE_DIR : " /var/tmp/cache/idf_ccache"
370255 tags :
371256 - macos-tart
372257 image : macos-sequoia-idf-v6.0
373- cache : [] # pip cache is created under amd64, and submodules are downloaded with brew mirror, so disable cache here
374- before_script :
375- # assert LOCAL_GIT_MIRROR is set
376- - echo -e "section_start:`date +%s`:check_out\r\e[0Kchecking out from local git mirror, then reset to CI_COMMIT_SHA"
377- - |
378- if [ -z "${LOCAL_GIT_MIRROR:-}" ]; then
379- echo "Error: LOCAL_GIT_MIRROR not set, cannot clone from mirror."
380- exit 1
381- fi
382- - MIRROR_REPO_URL="${LOCAL_GIT_MIRROR}/${CI_PROJECT_PATH}"
383- - cd "${CI_PROJECT_DIR}"
384- # since .cache exists in CI_PROJECT_DIR, so can't direct `git clone .`
385- - git clone -b ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_COMMIT_BRANCH}} --depth=1 --recursive --shallow-submodules "${MIRROR_REPO_URL}" tmp
386- - mv tmp/.git ./
387- - rm -rf tmp
388- - git reset --hard
389- # set remote url back
390- - git remote set-url origin "${CI_REPOSITORY_URL}"
391- - eval "git fetch --depth=1 ${GIT_FETCH_EXTRA_FLAGS} origin ${CI_COMMIT_SHA}"
392- - git checkout FETCH_HEAD
393- - git submodule update --init --recursive --depth=1
394- - echo -e "section_end:`date +%s`:check_out\r\e[0K"
395- - *common-before_scripts
396- - *setup_tools_and_idf_python_venv
397258 after_script : [] # ccache now is disabled for macos brew runners
398259 timeout : 30m
399260
@@ -421,16 +282,5 @@ default:
421282 - *setup_tools_and_idf_python_venv
422283 - add_gitlab_ssh_keys
423284 - fetch_submodules
424- # gitlab bug, setting them here doesn't work
425- # - expire_in: https://gitlab.com/gitlab-org/gitlab/-/issues/404563
426- # - when: https://gitlab.com/gitlab-org/gitlab/-/issues/440672
427- # artifacts:
428- # expire_in: 1 week
429- # when: always
430- retry :
431- max : 2
432- when :
433- # In case of a runner failure we could hop to another one, or a network error could go away.
434- - runner_system_failure
435- # Job execution timeout may be caused by a network issue.
436- - job_execution_timeout
285+ - export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
286+ - export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS}
0 commit comments