Skip to content

Commit 03feb38

Browse files
Merge branch 'fix/cleanup_ci_readme' into 'master'
Small cleanu See merge request espressif/esp-mqtt!231
2 parents bdda020 + bb85b20 commit 03feb38

File tree

2 files changed

+117
-104
lines changed

2 files changed

+117
-104
lines changed

.gitlab-ci.yml

Lines changed: 106 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,129 @@
11
stages:
2-
- build
3-
- test
4-
- deploy
5-
2+
- build
3+
- test
4+
- deploy
65

76
variables:
8-
IDF_REPO: ${GITLAB_SSH_SERVER}/idf/esp-idf.git
7+
IDF_REPO: ${GITLAB_SSH_SERVER}/idf/esp-idf.git
98

109
.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}
1413

1514
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
2827

2928
.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
3938

4039
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
4342

4443
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
4758

4859
build_idf_latest:
49-
extends: .build_template
50-
image: espressif/idf:latest
60+
extends: .build_template
61+
image: espressif/idf:latest
5162

5263
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
6172

6273
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
93104

94105
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)"
104115

105116
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}

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
[![](https://travis-ci.org/tuanpmt/espmqtt.svg?branch=master)](https://travis-ci.org/tuanpmt/espmqtt)
2-
[![](http://hits.dwyl.io/tuanpmt/espmqtt.svg)](http://hits.dwyl.io/tuanpmt/espmqtt)
3-
[![Twitter Follow](https://img.shields.io/twitter/follow/tuanpmt.svg?style=social&label=Follow)](https://twitter.com/tuanpmt)
4-
![GitHub contributors](https://img.shields.io/github/contributors/tuanpmt/espmqtt.svg)
5-
61
# ESP32 MQTT Library
72

3+
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/espressif/esp-mqtt/test-examples.yml?branch=master)
4+
![License](https://img.shields.io/github/license/espressif/esp-mqtt)
5+
![GitHub contributors](https://img.shields.io/github/contributors/espressif/esp-mqtt)
6+
87
## Features
98

10-
- Based on: https://github.com/tuanpmt/esp_mqtt
9+
- Based on: <https://github.com/tuanpmt/esp_mqtt>
1110
- Support MQTT over TCP, SSL with mbedtls, MQTT over Websocket, MQTT over Websocket Secure
12-
- Easy to setup with URI
11+
- Easy to setup with URI
1312
- Multiple instances (Multiple clients in one application)
1413
- Support subscribing, publishing, authentication, will messages, keep alive pings and all 3 QoS levels (it should be a fully functional client).
14+
- Support for MQTT 3.1.1 and 5.0
1515

1616
## How to use
1717

@@ -20,9 +20,9 @@ Please refer to instructions in [ESP-IDF](https://github.com/espressif/esp-idf)
2020

2121
## Documentation
2222

23-
* Please refer to the standard [ESP-IDF](https://github.com/espressif/esp-idf), documentation for the latest version: https://docs.espressif.com/projects/esp-idf/
23+
- Please refer to the standard [ESP-IDF](https://github.com/espressif/esp-idf), documentation for the latest version: <https://docs.espressif.com/projects/esp-idf/>
2424

25-
* Documentation of ESP-MQTT API: https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/protocols/mqtt.html
25+
- Documentation of ESP-MQTT API: <https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/protocols/mqtt.html>
2626

2727
## License
2828

@@ -33,7 +33,9 @@ Apache License
3333
## Older IDF verisons
3434

3535
For [ESP-IDF](https://github.com/espressif/esp-idf) versions prior to IDFv3.2, please clone as a component of [ESP-IDF](https://github.com/espressif/esp-idf):
36+
3637
```
3738
git submodule add https://github.com/espressif/esp-mqtt.git components/espmqtt
3839
```
40+
3941
and checkout the [ESP-MQTT_FOR_IDF_3.1](https://github.com/espressif/esp-mqtt/tree/ESP-MQTT_FOR_IDF_3.1) tag

0 commit comments

Comments
 (0)