mirror of
https://github.com/espressif/esp-mqtt.git
synced 2026-08-03 20:14:15 +02:00
2b33476c3f
- Adds documentation build and deploy - Removes QEMU test as it is outdated
109 lines
2.7 KiB
YAML
109 lines
2.7 KiB
YAML
stages:
|
|
- build
|
|
- test
|
|
- test_deploy
|
|
- deploy
|
|
|
|
variables:
|
|
IDF_REPO: ${GITLAB_SSH_SERVER}/idf/esp-idf.git
|
|
|
|
.add_gh_key_remote: &add_gh_key_remote |
|
|
cit_add_ssh_key "${GH_PUSH_KEY}"
|
|
git remote remove github || true
|
|
git remote add github ${GH_PUSH_REPO}
|
|
|
|
before_script:
|
|
# Use CI Tools
|
|
- curl -sSL ${CIT_LOADER_URL} | sh
|
|
- source citools/import_functions
|
|
# Add gitlab ssh key
|
|
- mkdir -p ~/.ssh
|
|
- chmod 700 ~/.ssh
|
|
- echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
|
|
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
|
|
- chmod 600 ~/.ssh/id_rsa
|
|
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
|
|
- PATH=$CI_PROJECT_DIR/esp-idf/tools:$PATH
|
|
- export MQTT_PATH=$CI_PROJECT_DIR
|
|
|
|
.build_template:
|
|
stage: build
|
|
tags:
|
|
- build
|
|
- internet
|
|
script:
|
|
# Replace the IDF's default esp-mqtt with this version
|
|
- rm -rf $IDF_PATH/components/mqtt/esp-mqtt && cp -r $MQTT_PATH $IDF_PATH/components/mqtt/
|
|
# Build the examples
|
|
- $MQTT_PATH/ci/build_examples.sh
|
|
|
|
build_idf_v5.0:
|
|
extends: .build_template
|
|
image: espressif/idf:release-v5.0
|
|
|
|
build_idf_v5.1:
|
|
extends: .build_template
|
|
image: espressif/idf:release-v5.1
|
|
|
|
build_idf_v5.2:
|
|
extends: .build_template
|
|
image: espressif/idf:release-v5.2
|
|
|
|
build_idf_v5.3:
|
|
extends: .build_template
|
|
image: espressif/idf:release-v5.3
|
|
|
|
build_idf_v5.4:
|
|
extends: .build_template
|
|
image: espressif/idf:release-v5.4
|
|
|
|
build_idf_latest:
|
|
extends: .build_template
|
|
image: espressif/idf:latest
|
|
|
|
build_and_host_test:
|
|
stage: build
|
|
image: espressif/idf:latest
|
|
tags:
|
|
- build
|
|
- internet
|
|
script:
|
|
# Replace the IDF's default esp-mqtt with this version
|
|
- rm -rf $IDF_PATH/components/mqtt/esp-mqtt && cp -r $MQTT_PATH $IDF_PATH/components/mqtt/
|
|
- cd $IDF_PATH/components/mqtt/esp-mqtt/test/host
|
|
- idf.py build
|
|
- build/host_mqtt_client_test.elf
|
|
|
|
check_remotes_sync:
|
|
stage: test_deploy
|
|
image: espressif/idf:latest
|
|
tags:
|
|
- build
|
|
- internet
|
|
except:
|
|
- master
|
|
- idf
|
|
script:
|
|
- *add_gh_key_remote
|
|
- git fetch --depth=1 origin master
|
|
- git fetch --depth=1 github master
|
|
- test "$(git rev-parse origin/master)" == "$(git rev-parse github/master)"
|
|
|
|
push_master_to_github:
|
|
stage: deploy
|
|
image: ${CI_DOCKER_REGISTRY}/esp32-ci-env
|
|
tags:
|
|
- build
|
|
only:
|
|
- master
|
|
- idf
|
|
when: on_success
|
|
variables:
|
|
GIT_STRATEGY: clone
|
|
script:
|
|
- *add_gh_key_remote
|
|
- git push github HEAD:${CI_COMMIT_REF_NAME}
|
|
|
|
include:
|
|
- local: ".gitlab/ci/docs.yml"
|