2016-08-22 06:19:08 -04:00
stages :
- build
2016-08-23 00:54:09 -04:00
- test
2016-08-22 06:19:08 -04:00
- deploy
2016-09-01 03:13:15 -04:00
before_script :
2016-09-12 21:34:28 -04:00
# add gitlab ssh key
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
2016-09-13 09:24:57 -04:00
- echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
2016-09-12 21:34:28 -04:00
- 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
# if testing master branch, use github wifi libs.
# if testing other branches, use gitlab wifi libs (as maybe changes aren't merged to master yet)
- test "${CI_BUILD_REF_NAME}" = "master" || sed -i "s%https://github.com/espressif/esp32-wifi-lib%ssh://git@gitlab.espressif.cn:27227/idf/esp32-wifi-lib%" .gitmodules
# fetch all submodules
2016-09-01 03:13:15 -04:00
- git submodule update --init --recursive
2016-08-22 03:02:22 -04:00
build_template_app :
2016-08-22 06:19:08 -04:00
stage : build
2016-08-22 03:02:22 -04:00
image : espressif/esp32-ci-env
2016-09-08 22:49:03 -04:00
tags :
- build
2016-08-22 03:02:22 -04:00
variables :
SDK_PATH : "$CI_PROJECT_DIR"
IDF_PATH : "$CI_PROJECT_DIR"
2016-08-22 06:19:08 -04:00
GIT_STRATEGY : clone
2016-08-22 03:02:22 -04:00
script :
- git clone https://github.com/espressif/esp-idf-template.git
- cd esp-idf-template
2016-09-01 04:58:06 -04:00
# Try to use the same branch name for esp-idf-template that we're
# using on esp-idf. If it doesn't exist then just stick to the default
# branch
- git checkout ${CI_BUILD_REF_NAME} || echo "Using esp-idf-template default branch..."
2016-08-23 04:19:49 -04:00
- make defconfig
2016-09-08 20:49:35 -04:00
- make all V=1
2016-08-22 06:19:08 -04:00
2016-09-08 22:49:03 -04:00
.build_gitlab : &build_template
stage : build
tags :
- build
image : espressif/esp32-ci-env
variables :
SDK_PATH : "$CI_PROJECT_DIR"
IDF_PATH : "$CI_PROJECT_DIR"
GIT_STRATEGY : clone
build_ssc :
<< : *build_template
artifacts :
paths :
- ./SSC/build/*.bin
- ./SSC/build/*.elf
- ./SSC/build/*.map
- ./SSC/build/bootloader/*.bin
expire_in : 6 mos
script :
- git clone ssh://git@gitlab.espressif.cn:27227/yinling/SSC.git
- cd SSC
- make defconfig
- chmod +x gen_misc_ng.sh
- ./gen_misc_ng.sh
2016-08-23 00:54:09 -04:00
test_nvs_on_host :
stage : test
image : espressif/esp32-ci-env
2016-09-08 22:49:03 -04:00
tags :
- nvs_host_test
2016-08-23 00:54:09 -04:00
script :
- cd components/nvs_flash/test
- make test
2016-08-24 00:16:26 -04:00
test_build_system :
stage : test
image : espressif/esp32-ci-env
2016-09-08 22:49:03 -04:00
tags :
- build_test
2016-08-24 01:31:33 -04:00
variables :
IDF_PATH : "$CI_PROJECT_DIR"
2016-08-24 00:16:26 -04:00
script :
2016-08-24 23:55:47 -04:00
- ./make/test_build_system.sh
2016-08-24 00:16:26 -04:00
2016-09-08 22:49:03 -04:00
# template for test jobs
.test_template : &test_template
stage : test
when : on_success
only :
- master
2016-09-18 11:12:50 -04:00
- triggers
2016-09-08 22:49:03 -04:00
variables :
# need user to set SDK_NAME and CONFIG_FILE (may need to set BIN_PATH and APP_NAME later) in before_script
SCRIPT_PATH : /home/gitlab-runner/auto_test_script
BIN_PATH : ${CI_PROJECT_DIR}/SSC/build/
APP_NAME : ssc
LOG_PATH : $CI_PROJECT_DIR/$CI_BUILD_REF
artifacts :
when : always
paths :
- $LOG_PATH
expire_in : 6 mos
script :
- cd $SCRIPT_PATH
- python CIRunner.py -l $LOG_PATH -c $SDK_NAME/$CONFIG_FILE bin_path $APP_NAME $BIN_PATH
sanity_test :
<< : *test_template
tags :
- ESP32
- SSC_T1_1
- SSC_T2_1
- SSC_T1_WAN
before_script :
- SDK_NAME=ESP32_IDF
- CONFIG_FILE=sanity_test.yml
2016-08-22 06:19:08 -04:00
push_master_to_github :
2016-09-13 09:24:57 -04:00
before_script :
- echo "Not setting up GitLab key, not fetching submodules"
2016-08-22 06:19:08 -04:00
stage : deploy
only :
- master
2016-09-08 22:49:03 -04:00
tags :
- deploy
2016-08-22 06:19:08 -04:00
when : on_success
image : espressif/esp32-ci-env
variables :
GIT_STRATEGY : clone
script :
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
2016-09-13 09:24:57 -04:00
- echo -n $GH_PUSH_KEY > ~/.ssh/id_rsa_base64
2016-08-22 06:19:08 -04:00
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- git remote add github git@github.com:espressif/esp-idf.git
- git push github HEAD:master