From 1d294f7606d4b70f33adcd9316eca32c28b66aa2 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Mon, 6 May 2019 09:42:55 +0200 Subject: [PATCH] ci: github build esp-mqtt with more stable IDF (latest release version rather then master) fixed also internal ci: use the same git command for buld and static analysis (reset --hard instead of checkout) --- .gitlab-ci.yml | 2 +- .travis.yml | 8 +++++--- modify_for_legacy_idf.sh | 8 +++++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aa8921e..3461a4c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -79,7 +79,7 @@ clang_tidy_check: - cd $IDF_PATH/components/mqtt/esp-mqtt - rm -rf .git - cp -r $CI_PROJECT_DIR/.git . - - git checkout $CI_COMMIT_SHA + - git reset --hard $CI_COMMIT_SHA - mv $CI_PROJECT_DIR/tidybuild $IDF_PATH/examples/protocols/mqtt/tcp/tidybuild - cd $IDF_PATH/examples/protocols/mqtt/tcp/tidybuild - git clone "${CI_REPORT_TOOLS}" diff --git a/.travis.yml b/.travis.yml index 5f1a823..b900e93 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,8 @@ before_install: # Have to checkout a temp branch for later in tree reference - git checkout -b temporary_ref_branch - CI_COMMIT_SHA=$(git rev-parse HEAD) + # Test building with latest (stable == v3.3 for now) IDF + - LATEST_IDF=release/v3.3 install: # Install ESP32 toochain following steps as desribed @@ -42,13 +44,13 @@ script: - cd $IDF_PATH - git checkout v3.1 && git submodule update --init --recursive - cd $PROJECT_PATH - - ./modify_for_legacy_idf.sh || true + - ./modify_for_legacy_idf.sh ${LATEST_IDF} || true - cd $PROJECT_PATH/examples/tcp - make defconfig - make -j4 - # Master build with latest IDF + # Build with latest IDF - cd $IDF_PATH - - git checkout master && git submodule update --init --recursive + - git checkout ${LATEST_IDF} && git submodule update --init --recursive - cd $IDF_PATH/components/mqtt/esp-mqtt - git remote add local $PROJECT_PATH/.git - git fetch local diff --git a/modify_for_legacy_idf.sh b/modify_for_legacy_idf.sh index 6c43074..8ea7e2b 100755 --- a/modify_for_legacy_idf.sh +++ b/modify_for_legacy_idf.sh @@ -1,5 +1,11 @@ #!/usr/bin/env bash +if [[ -z $1 ]]; then + LATEST_IDF=master +else + LATEST_IDF=$1 +fi + # This snipped prepares environment for using esp-mqtt repository separately from idf -- legacy use before IDFv3.2 # esp_mqtt_path=`pwd` @@ -7,7 +13,7 @@ mkdir -p ${esp_mqtt_path}/examples pushd cd $IDF_PATH former_commit_id=`git rev-parse HEAD` -git checkout master +git checkout ${LATEST_IDF} for example in tcp; do cp -r $IDF_PATH/examples/protocols/mqtt/${example} ${esp_mqtt_path}/examples