forked from espressif/esp-iot-solution
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
121 lines (112 loc) · 3.43 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
stages:
- build
- deploy
variables:
IOT_SOLUTION_PATH: "$CI_PROJECT_DIR"
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
- git --version
- git submodule update --init --recursive
.build_template: &build_template
stage: build
image: espressif/idf:release-v4.3
tags:
- build
variables:
BATCH_BUILD: "1"
V: "0"
.build_examples_template: &build_examples_template
<<: *build_template
artifacts:
when: always
paths:
- $BUILD_PATH/*/*/*/build/*.bin
- $BUILD_PATH/*/*/*/build/*/*.bin
- $BUILD_PATH/*/*/*/build/*.json
- $BUILD_PATH/*.json
- $LOG_PATH/*
expire_in: 1 week
variables:
IDF_CI_BUILD: "1"
LOG_PATH: "$CI_PROJECT_DIR/log_examples"
BUILD_PATH: "$CI_PROJECT_DIR/build_examples"
SIZE_INFO_LOCATION: "$CI_PROJECT_DIR/log_examples/size_info.txt"
PEDANTIC_CFLAGS: ""
PEDANTIC_CXXFLAGS: ""
script:
# it's not possible to build 100% out-of-tree and have the "artifacts"
# mechanism work, but this is the next best thing
- rm -rf ${BUILD_PATH}
# build some of examples
- python ${IOT_SOLUTION_PATH}/tools/ci/genarate_build_json.py
- ${IOT_SOLUTION_PATH}/tools/ci/build_examples.sh
build_examples_00_with_idf_v4.2:
<<: *build_examples_template
image: espressif/idf:release-v4.2
build_examples_00_with_idf_v4.3:
<<: *build_examples_template
image: espressif/idf:release-v4.3
build_examples_00_with_idf_v4.4:
<<: *build_examples_template
image: espressif/idf:release-v4.4
build_docs:
stage: build
image: $CI_DOCKER_REGISTRY/esp-idf-doc-env:v7
tags:
- build_docs
artifacts:
when: always
paths:
# English version of documentation
- docs/en/doxygen-warning-log.txt
- docs/en/sphinx-warning-log.txt
- docs/en/sphinx-warning-log-sanitized.txt
- docs/en/_build/html
# Chinese version of documentation
- docs/zh_CN/doxygen-warning-log.txt
- docs/zh_CN/sphinx-warning-log.txt
- docs/zh_CN/sphinx-warning-log-sanitized.txt
- docs/zh_CN/_build/html
expire_in: 1 mos
script:
- source /opt/pyenv/activate && pyenv global 3.6.10
- pip install "setuptools<57.5.0"
- pip install "funcparserlib==0.3.6"
- /opt/pyenv/pyenv-1.2.16/versions/3.6.10/bin/python -m pip install --user -r docs/requirements.txt
- cd docs
- ./check_lang_folder_sync.sh
- cd en
- make gh-linkcheck
- make html
- ../check_doc_warnings.sh
- cd ../zh_CN
- make gh-linkcheck
- make html
- ../check_doc_warnings.sh
push_to_github:
stage: deploy
only:
- master
- /^release\/v/
# when: on_success
image: $CI_DOCKER_REGISTRY/esp32-ci-env
variables:
GIT_STRATEGY: clone
before_script:
- echo "skip default before_script"
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 remove github &>/dev/null || true
- git remote add github [email protected]:espressif/esp-iot-solution.git
- ${IOT_SOLUTION_PATH}/tools/ci/push_to_github.sh