|
1 | 1 | stages: |
2 | | - - build |
3 | | - - test |
4 | | - - deploy |
5 | | - |
| 2 | + - build |
| 3 | + - test |
| 4 | + - deploy |
6 | 5 |
|
7 | 6 | variables: |
8 | | - IDF_REPO: ${GITLAB_SSH_SERVER}/idf/esp-idf.git |
| 7 | + IDF_REPO: ${GITLAB_SSH_SERVER}/idf/esp-idf.git |
9 | 8 |
|
10 | 9 | .add_gh_key_remote: &add_gh_key_remote | |
11 | | - cit_add_ssh_key "${GH_PUSH_KEY}" |
12 | | - git remote remove github || true |
13 | | - git remote add github ${GH_PUSH_REPO} |
| 10 | + cit_add_ssh_key "${GH_PUSH_KEY}" |
| 11 | + git remote remove github || true |
| 12 | + git remote add github ${GH_PUSH_REPO} |
14 | 13 |
|
15 | 14 | before_script: |
16 | | - # Use CI Tools |
17 | | - - curl -sSL ${CIT_LOADER_URL} | sh |
18 | | - - source citools/import_functions |
19 | | - # Add gitlab ssh key |
20 | | - - mkdir -p ~/.ssh |
21 | | - - chmod 700 ~/.ssh |
22 | | - - echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64 |
23 | | - - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa |
24 | | - - chmod 600 ~/.ssh/id_rsa |
25 | | - - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config |
26 | | - - PATH=$CI_PROJECT_DIR/esp-idf/tools:$PATH |
27 | | - - export MQTT_PATH=$CI_PROJECT_DIR |
| 15 | + # Use CI Tools |
| 16 | + - curl -sSL ${CIT_LOADER_URL} | sh |
| 17 | + - source citools/import_functions |
| 18 | + # Add gitlab ssh key |
| 19 | + - mkdir -p ~/.ssh |
| 20 | + - chmod 700 ~/.ssh |
| 21 | + - echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64 |
| 22 | + - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa |
| 23 | + - chmod 600 ~/.ssh/id_rsa |
| 24 | + - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config |
| 25 | + - PATH=$CI_PROJECT_DIR/esp-idf/tools:$PATH |
| 26 | + - export MQTT_PATH=$CI_PROJECT_DIR |
28 | 27 |
|
29 | 28 | .build_template: |
30 | | - stage: build |
31 | | - tags: |
32 | | - - build |
33 | | - - internet |
34 | | - script: |
35 | | - # Replace the IDF's default esp-mqtt with this version |
36 | | - - rm -rf $IDF_PATH/components/mqtt/esp-mqtt && cp -r $MQTT_PATH $IDF_PATH/components/mqtt/ |
37 | | - # Build the examples |
38 | | - - $MQTT_PATH/ci/build_examples.sh |
| 29 | + stage: build |
| 30 | + tags: |
| 31 | + - build |
| 32 | + - internet |
| 33 | + script: |
| 34 | + # Replace the IDF's default esp-mqtt with this version |
| 35 | + - rm -rf $IDF_PATH/components/mqtt/esp-mqtt && cp -r $MQTT_PATH $IDF_PATH/components/mqtt/ |
| 36 | + # Build the examples |
| 37 | + - $MQTT_PATH/ci/build_examples.sh |
39 | 38 |
|
40 | 39 | build_idf_v5.0: |
41 | | - extends: .build_template |
42 | | - image: espressif/idf:release-v5.0 |
| 40 | + extends: .build_template |
| 41 | + image: espressif/idf:release-v5.0 |
43 | 42 |
|
44 | 43 | build_idf_v5.1: |
45 | | - extends: .build_template |
46 | | - image: espressif/idf:release-v5.1 |
| 44 | + extends: .build_template |
| 45 | + image: espressif/idf:release-v5.1 |
| 46 | + |
| 47 | +build_idf_v5.2: |
| 48 | + extends: .build_template |
| 49 | + image: espressif/idf:release-v5.2 |
| 50 | + |
| 51 | +build_idf_v5.3: |
| 52 | + extends: .build_template |
| 53 | + image: espressif/idf:release-v5.3 |
| 54 | + |
| 55 | +build_idf_v5.4: |
| 56 | + extends: .build_template |
| 57 | + image: espressif/idf:release-v5.4 |
47 | 58 |
|
48 | 59 | build_idf_latest: |
49 | | - extends: .build_template |
50 | | - image: espressif/idf:latest |
| 60 | + extends: .build_template |
| 61 | + image: espressif/idf:latest |
51 | 62 |
|
52 | 63 | build_and_host_test: |
53 | | - stage: build |
54 | | - image: espressif/idf:latest |
55 | | - script: |
56 | | - # Replace the IDF's default esp-mqtt with this version |
57 | | - - rm -rf $IDF_PATH/components/mqtt/esp-mqtt && cp -r $MQTT_PATH $IDF_PATH/components/mqtt/ |
58 | | - - cd $IDF_PATH/components/mqtt/esp-mqtt/host_test |
59 | | - - idf.py build |
60 | | - - build/host_mqtt_client_test.elf |
| 64 | + stage: build |
| 65 | + image: espressif/idf:latest |
| 66 | + script: |
| 67 | + # Replace the IDF's default esp-mqtt with this version |
| 68 | + - rm -rf $IDF_PATH/components/mqtt/esp-mqtt && cp -r $MQTT_PATH $IDF_PATH/components/mqtt/ |
| 69 | + - cd $IDF_PATH/components/mqtt/esp-mqtt/host_test |
| 70 | + - idf.py build |
| 71 | + - build/host_mqtt_client_test.elf |
61 | 72 |
|
62 | 73 | build_and_test_qemu: |
63 | | - stage: build |
64 | | - image: ${CI_DOCKER_REGISTRY}/qemu-v5.1:1-20220802 |
65 | | - tags: |
66 | | - - build |
67 | | - - shiny |
68 | | - dependencies: [] |
69 | | - script: |
70 | | - - export IDF_PATH=$CI_PROJECT_DIR/esp-idf |
71 | | - - git clone "${IDF_REPO}" |
72 | | - # switch to IDF and setup the tools |
73 | | - - $MQTT_PATH/ci/set_idf.sh release/v5.1 |
74 | | - - $IDF_PATH/tools/idf_tools.py install-python-env |
75 | | - - cd $IDF_PATH && tools/idf_tools.py --non-interactive install && eval "$(tools/idf_tools.py --non-interactive export)" |
76 | | - # Remove `debug_backend` and Add `paho-mqtt` to the required packages |
77 | | - - sed '/debug_backend/d;/pygobject/d' $IDF_PATH/tools/requirements/requirements.ttfw.txt > requirements.txt |
78 | | - - python -m pip install -r requirements.txt |
79 | | - - python -m pip install paho-mqtt |
80 | | - - $MQTT_PATH/ci/set_mqtt.sh $CI_COMMIT_SHA |
81 | | - # build publish-connect stress test, setup test parameters |
82 | | - - cd tools/test_apps/protocols/mqtt/publish_connect_test && cat sdkconfig.qemu | $IDF_PATH/tools/ci/envsubst.py > sdkconfig.defaults && idf.py build |
83 | | - - export TEST_PATH=`pwd` && export MQTT_PUBLISH_TEST=1 |
84 | | - - export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/ci/python_packages" |
85 | | - # run test (with environment->qemu) |
86 | | - - cd $IDF_PATH/tools/ci/python_packages/tiny_test_fw/bin |
87 | | - # use more relaxed criteria with QEMU tests |
88 | | - - export MQTT_PUBLISH_MSG_len_0=0 MQTT_PUBLISH_MSG_repeat_0=5 |
89 | | - - export MQTT_PUBLISH_MSG_len_1=2 MQTT_PUBLISH_MSG_repeat_1=50 |
90 | | - - export MQTT_PUBLISH_MSG_len_2=128 MQTT_PUBLISH_MSG_repeat_2=2 |
91 | | - - export MQTT_PUBLISH_MSG_len_3=20 MQTT_PUBLISH_MSG_repeat_3=20 |
92 | | - - python Runner.py $TEST_PATH -c $MQTT_PATH/ci/publish_connect_mqtt_qemu.yml -e $TEST_PATH/env.yml |
| 74 | + stage: build |
| 75 | + image: ${CI_DOCKER_REGISTRY}/qemu-v5.1:1-20220802 |
| 76 | + tags: |
| 77 | + - build |
| 78 | + - shiny |
| 79 | + dependencies: [] |
| 80 | + script: |
| 81 | + - export IDF_PATH=$CI_PROJECT_DIR/esp-idf |
| 82 | + - git clone "${IDF_REPO}" |
| 83 | + # switch to IDF and setup the tools |
| 84 | + - $MQTT_PATH/ci/set_idf.sh release/v5.1 |
| 85 | + - $IDF_PATH/tools/idf_tools.py install-python-env |
| 86 | + - cd $IDF_PATH && tools/idf_tools.py --non-interactive install && eval "$(tools/idf_tools.py --non-interactive export)" |
| 87 | + # Remove `debug_backend` and Add `paho-mqtt` to the required packages |
| 88 | + - sed '/debug_backend/d;/pygobject/d' $IDF_PATH/tools/requirements/requirements.ttfw.txt > requirements.txt |
| 89 | + - python -m pip install -r requirements.txt |
| 90 | + - python -m pip install paho-mqtt |
| 91 | + - $MQTT_PATH/ci/set_mqtt.sh $CI_COMMIT_SHA |
| 92 | + # build publish-connect stress test, setup test parameters |
| 93 | + - cd tools/test_apps/protocols/mqtt/publish_connect_test && cat sdkconfig.qemu | $IDF_PATH/tools/ci/envsubst.py > sdkconfig.defaults && idf.py build |
| 94 | + - export TEST_PATH=`pwd` && export MQTT_PUBLISH_TEST=1 |
| 95 | + - export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/ci/python_packages" |
| 96 | + # run test (with environment->qemu) |
| 97 | + - cd $IDF_PATH/tools/ci/python_packages/tiny_test_fw/bin |
| 98 | + # use more relaxed criteria with QEMU tests |
| 99 | + - export MQTT_PUBLISH_MSG_len_0=0 MQTT_PUBLISH_MSG_repeat_0=5 |
| 100 | + - export MQTT_PUBLISH_MSG_len_1=2 MQTT_PUBLISH_MSG_repeat_1=50 |
| 101 | + - export MQTT_PUBLISH_MSG_len_2=128 MQTT_PUBLISH_MSG_repeat_2=2 |
| 102 | + - export MQTT_PUBLISH_MSG_len_3=20 MQTT_PUBLISH_MSG_repeat_3=20 |
| 103 | + - python Runner.py $TEST_PATH -c $MQTT_PATH/ci/publish_connect_mqtt_qemu.yml -e $TEST_PATH/env.yml |
93 | 104 |
|
94 | 105 | check_remotes_sync: |
95 | | - stage: test |
96 | | - except: |
97 | | - - master |
98 | | - - idf |
99 | | - script: |
100 | | - - *add_gh_key_remote |
101 | | - - git fetch --depth=1 origin master |
102 | | - - git fetch --depth=1 github master |
103 | | - - test "$(git rev-parse origin/master)" == "$(git rev-parse github/master)" |
| 106 | + stage: test |
| 107 | + except: |
| 108 | + - master |
| 109 | + - idf |
| 110 | + script: |
| 111 | + - *add_gh_key_remote |
| 112 | + - git fetch --depth=1 origin master |
| 113 | + - git fetch --depth=1 github master |
| 114 | + - test "$(git rev-parse origin/master)" == "$(git rev-parse github/master)" |
104 | 115 |
|
105 | 116 | push_master_to_github: |
106 | | - stage: deploy |
107 | | - image: ${CI_DOCKER_REGISTRY}/esp32-ci-env |
108 | | - tags: |
109 | | - - build |
110 | | - only: |
111 | | - - master |
112 | | - - idf |
113 | | - when: on_success |
114 | | - variables: |
115 | | - GIT_STRATEGY: clone |
116 | | - script: |
117 | | - - *add_gh_key_remote |
118 | | - - git push github HEAD:${CI_COMMIT_REF_NAME} |
| 117 | + stage: deploy |
| 118 | + image: ${CI_DOCKER_REGISTRY}/esp32-ci-env |
| 119 | + tags: |
| 120 | + - build |
| 121 | + only: |
| 122 | + - master |
| 123 | + - idf |
| 124 | + when: on_success |
| 125 | + variables: |
| 126 | + GIT_STRATEGY: clone |
| 127 | + script: |
| 128 | + - *add_gh_key_remote |
| 129 | + - git push github HEAD:${CI_COMMIT_REF_NAME} |
0 commit comments