mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
2fe759ce1d
1. add night job define (need to set variable in trigger to run night jobs) 2. move auto generated part to the end of file 3. add auto generated CI jobs
291 lines
7.3 KiB
YAML
291 lines
7.3 KiB
YAML
stages:
|
|
- build
|
|
- test
|
|
- deploy
|
|
|
|
before_script:
|
|
# 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
|
|
|
|
# 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
|
|
- git submodule update --init --recursive
|
|
|
|
build_template_app:
|
|
stage: build
|
|
image: espressif/esp32-ci-env
|
|
tags:
|
|
- build
|
|
|
|
variables:
|
|
SDK_PATH: "$CI_PROJECT_DIR"
|
|
IDF_PATH: "$CI_PROJECT_DIR"
|
|
GIT_STRATEGY: clone
|
|
|
|
script:
|
|
- git clone https://github.com/espressif/esp-idf-template.git
|
|
- cd esp-idf-template
|
|
# 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..."
|
|
- make defconfig
|
|
- make all V=1
|
|
|
|
|
|
.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
|
|
- git checkout ${CI_BUILD_REF_NAME} || echo "Using SSC default branch..."
|
|
- make defconfig
|
|
- chmod +x gen_misc_ng.sh
|
|
- ./gen_misc_ng.sh
|
|
|
|
build_examples:
|
|
<<: *build_template
|
|
artifacts:
|
|
paths:
|
|
- build_examples/*/*/build/*.bin
|
|
- build_examples/*/*/build/*.elf
|
|
- build_examples/*/*/build/*.map
|
|
- build_examples/*/*/build/bootloader/*.bin
|
|
expire_in: 6 mos
|
|
|
|
script:
|
|
# it's not possible to build 100% out-of-tree and have the "artifacts"
|
|
# mechanism work, but this is the next best thing
|
|
- mkdir build_examples
|
|
- cd build_examples
|
|
- ${IDF_PATH}/make/build_examples.sh
|
|
|
|
test_nvs_on_host:
|
|
stage: test
|
|
image: espressif/esp32-ci-env
|
|
tags:
|
|
- nvs_host_test
|
|
script:
|
|
- cd components/nvs_flash/test
|
|
- make test
|
|
|
|
test_build_system:
|
|
stage: test
|
|
image: espressif/esp32-ci-env
|
|
tags:
|
|
- build_test
|
|
variables:
|
|
IDF_PATH: "$CI_PROJECT_DIR"
|
|
script:
|
|
- ./make/test_build_system.sh
|
|
|
|
|
|
push_master_to_github:
|
|
before_script:
|
|
- echo "Not setting up GitLab key, not fetching submodules"
|
|
stage: deploy
|
|
only:
|
|
- master
|
|
tags:
|
|
- deploy
|
|
when: on_success
|
|
image: espressif/esp32-ci-env
|
|
variables:
|
|
GIT_STRATEGY: clone
|
|
script:
|
|
- mkdir -p ~/.ssh
|
|
- chmod 700 ~/.ssh
|
|
- echo -n $GH_PUSH_KEY > ~/.ssh/id_rsa_base64
|
|
- 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 --follow-tags github HEAD:master
|
|
|
|
|
|
# AUTO GENERATED PART START, DO NOT MODIFY CONTENT BELOW
|
|
# template for test jobs
|
|
.test_template: &test_template
|
|
stage: test
|
|
when: on_success
|
|
only:
|
|
- master
|
|
- triggers
|
|
|
|
variables:
|
|
LOCAL_ENV_CONFIG_PATH: "/home/gitlab-runner/LocalConfig/ESP32"
|
|
BIN_PATH: "$CI_PROJECT_DIR/SSC/build/"
|
|
APP_NAME: "ssc"
|
|
LOG_PATH: "$CI_PROJECT_DIR/$CI_BUILD_REF"
|
|
# assume it's tests are put in "components/test"
|
|
TEST_CASE_FILE_PATH: "components/test"
|
|
# jobs MUST set CONFIG_FILE in before_script, and overwrite the variables above if necessary
|
|
CONFIG_FILE: "jobs must set this variable"
|
|
|
|
artifacts:
|
|
when: always
|
|
paths:
|
|
- $LOG_PATH
|
|
expire_in: 6 mos
|
|
|
|
script:
|
|
# assume that auto_test_script is a sub-module of SDK, otherwise add as submodule here
|
|
- git submodule update --init --recursive
|
|
- python CIRunner.py -l $LOG_PATH -c $CONFIG_FILE -e $LOCAL_ENV_CONFIG_PATH -t $TEST_CASE_FILE_PATH bin_path $APP_NAME $BIN_PATH
|
|
|
|
|
|
# template for overnight test jobs
|
|
.test_template_night: &test_template_night
|
|
<<: *test_template
|
|
only:
|
|
# can only be triggered
|
|
- triggers
|
|
script:
|
|
# must be night build triggers, otherwise exit without test
|
|
- test $NIGHT_BUILD != "Yes" || exit
|
|
# assume that auto_test_script is a sub-module of SDK
|
|
- git submodule update --init --recursive
|
|
- python CIRunner.py -l $LOG_PATH -c $CONFIG_FILE -e $LOCAL_ENV_CONFIG_PATH -t $TEST_CASE_FILE_PATH bin_path $APP_NAME $BIN_PATH
|
|
|
|
Function_SYS_01:
|
|
<<: *test_template
|
|
tags:
|
|
- ESP32_IDF
|
|
- SSC_T1_1
|
|
before_script:
|
|
- SDK_NAME=ESP32_IDF
|
|
- LOCAL_ENV_CONFIG_PATH=/home/gitlab-runner/LocalConfig/ESP32_IDF
|
|
- CONFIG_FILE=Function_SYS_01.yml
|
|
|
|
Function_WIFI_01:
|
|
<<: *test_template
|
|
tags:
|
|
- ESP32_IDF
|
|
- SSC_T1_APC
|
|
- SSC_T1_1
|
|
- SSC_T1_WEP
|
|
- SSC_T2_1
|
|
before_script:
|
|
- SDK_NAME=ESP32_IDF
|
|
- LOCAL_ENV_CONFIG_PATH=/home/gitlab-runner/LocalConfig/ESP32_IDF
|
|
- CONFIG_FILE=Function_WIFI_01.yml
|
|
|
|
Function_WIFI_02:
|
|
<<: *test_template
|
|
tags:
|
|
- ESP32_IDF
|
|
- SSC_T1_APC
|
|
- SSC_T1_1
|
|
- SSC_T1_WEP
|
|
- SSC_T2_1
|
|
before_script:
|
|
- SDK_NAME=ESP32_IDF
|
|
- LOCAL_ENV_CONFIG_PATH=/home/gitlab-runner/LocalConfig/ESP32_IDF
|
|
- CONFIG_FILE=Function_WIFI_02.yml
|
|
|
|
Function_TCPIP_01:
|
|
<<: *test_template
|
|
tags:
|
|
- ESP32_IDF
|
|
- SSC_T1_1
|
|
- SSC_T1_2
|
|
- SSC_T2_1
|
|
before_script:
|
|
- SDK_NAME=ESP32_IDF
|
|
- LOCAL_ENV_CONFIG_PATH=/home/gitlab-runner/LocalConfig/ESP32_IDF
|
|
- CONFIG_FILE=Function_TCPIP_01.yml
|
|
|
|
Function_TCPIP_02:
|
|
<<: *test_template
|
|
tags:
|
|
- ESP32_IDF
|
|
- SSC_T1_1
|
|
- SSC_T2_1
|
|
before_script:
|
|
- SDK_NAME=ESP32_IDF
|
|
- LOCAL_ENV_CONFIG_PATH=/home/gitlab-runner/LocalConfig/ESP32_IDF
|
|
- CONFIG_FILE=Function_TCPIP_02.yml
|
|
|
|
Function_TCPIP_03:
|
|
<<: *test_template
|
|
tags:
|
|
- ESP32_IDF
|
|
- SSC_T1_1
|
|
- SSC_T2_1
|
|
before_script:
|
|
- SDK_NAME=ESP32_IDF
|
|
- LOCAL_ENV_CONFIG_PATH=/home/gitlab-runner/LocalConfig/ESP32_IDF
|
|
- CONFIG_FILE=Function_TCPIP_03.yml
|
|
|
|
Function_TCPIP_04:
|
|
<<: *test_template
|
|
tags:
|
|
- ESP32_IDF
|
|
- SSC_T1_1
|
|
- SSC_T1_2
|
|
- SSC_T2_1
|
|
before_script:
|
|
- SDK_NAME=ESP32_IDF
|
|
- LOCAL_ENV_CONFIG_PATH=/home/gitlab-runner/LocalConfig/ESP32_IDF
|
|
- CONFIG_FILE=Function_TCPIP_04.yml
|
|
|
|
Function_TCPIP_05:
|
|
<<: *test_template
|
|
tags:
|
|
- ESP32_IDF
|
|
- SSC_T1_1
|
|
- SSC_T1_2
|
|
- SSC_T2_1
|
|
before_script:
|
|
- SDK_NAME=ESP32_IDF
|
|
- LOCAL_ENV_CONFIG_PATH=/home/gitlab-runner/LocalConfig/ESP32_IDF
|
|
- CONFIG_FILE=Function_TCPIP_05.yml
|
|
|
|
Function_TCPIP_06:
|
|
<<: *test_template
|
|
tags:
|
|
- ESP32_IDF
|
|
- SSC_T1_1
|
|
- SSC_T2_1
|
|
before_script:
|
|
- SDK_NAME=ESP32_IDF
|
|
- LOCAL_ENV_CONFIG_PATH=/home/gitlab-runner/LocalConfig/ESP32_IDF
|
|
- CONFIG_FILE=Function_TCPIP_06.yml
|
|
|
|
Function_TCPIP_07:
|
|
<<: *test_template_night
|
|
tags:
|
|
- ESP32_IDF
|
|
- SSC_T1_1
|
|
before_script:
|
|
- SDK_NAME=ESP32_IDF
|
|
- LOCAL_ENV_CONFIG_PATH=/home/gitlab-runner/LocalConfig/ESP32_IDF
|
|
- CONFIG_FILE=Function_TCPIP_07.yml
|
|
|