1.deploy_job_template:
2  extends: .before_script_no_sync_submodule
3  stage: deploy
4  image: $ESP_ENV_IMAGE
5  tags:
6    - deploy
7
8push_to_github:
9  extends:
10    - .deploy_job_template
11    - .before_script_minimal
12    - .rules:protected-no_label
13  dependencies: []
14  script:
15    - add_github_ssh_keys
16    - git remote remove github &>/dev/null || true
17    - git remote add github git@github.com:espressif/esp-idf.git
18    - tools/ci/push_to_github.sh
19
20deploy_test_result:
21  extends:
22    - .deploy_job_template
23    - .before_script_minimal
24    - .rules:ref:master-schedule-always
25  image: $CI_DOCKER_REGISTRY/bot-env
26  tags:
27    - deploy_test
28  artifacts:
29    when: always
30    paths:
31      - ${CI_PROJECT_DIR}/test-management/*.log
32      # save all test logs as artifacts, make it easier to track errors
33      - ${CI_PROJECT_DIR}/TEST_LOGS
34    expire_in: 1 mos
35  variables:
36    UNIT_TEST_CASE_FILE: "${CI_PROJECT_DIR}/components/idf_test/unit_test/TestCaseAll.yml"
37    BOT_ACCOUNT_CONFIG_FILE: "${CI_PROJECT_DIR}/test-management/Config/Account.local.yml"
38    TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
39    AUTO_TEST_SCRIPT_PATH: "${CI_PROJECT_DIR}/auto_test_script"
40  script:
41    - add_gitlab_ssh_keys
42    - export GIT_SHA=$(echo ${PIPELINE_COMMIT_SHA} | cut -c 1-8)
43    - export REV_COUNT=$(git rev-list --count ${PIPELINE_COMMIT_SHA} --)
44    - export SUMMARY="IDF CI test result for $GIT_SHA (r${REV_COUNT})"
45    # artifacts of job update_test_cases creates test-management folder
46    # we need to remove it so we can clone test-management folder again
47    - rm -rf test-management
48    - retry_failed git clone $TEST_MANAGEMENT_REPO
49    - python3 $CHECKOUT_REF_SCRIPT test-management test-management
50    - cd test-management
51    - echo $BOT_JIRA_ACCOUNT > ${BOT_ACCOUNT_CONFIG_FILE}
52    # update test results
53    - python3 ImportTestResult.py -r "$GIT_SHA (r${REV_COUNT})" -j $JIRA_TEST_MANAGEMENT_PROJECT -s "$SUMMARY" -l CI -p ${CI_PROJECT_DIR}/TEST_LOGS --pipeline_url ${CI_PIPELINE_URL}
54
55check_submodule_sync:
56  extends:
57    - .deploy_job_template
58    - .rules:test:submodule
59  tags:
60    - github_sync
61  retry: 2
62  variables:
63    GIT_STRATEGY: clone
64    SUBMODULES_TO_FETCH: "none"
65    PUBLIC_IDF_URL: "https://github.com/espressif/esp-idf.git"
66  dependencies: []
67  script:
68    - git submodule deinit --force .
69    # setting the default remote URL to the public one, to resolve relative location URLs
70    - git config remote.origin.url ${PUBLIC_IDF_URL}
71    # check if all submodules are correctly synced to public repository
72    - git submodule init
73    - git config --get-regexp '^submodule\..*\.url$' || true
74    - git submodule update --recursive
75    - echo "IDF was cloned from ${PUBLIC_IDF_URL} completely"
76