forked from espressif/esp-dev-kits
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
251 lines (237 loc) · 7.1 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
stages:
- build
- deploy
variables:
PYTHON_VER: 3.6.13
BATCH_BUILD: "1"
V: "0"
IDF_CI_BUILD: "1"
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 --force
- export LC_ALL="C.UTF-8" # Add UTF-8 support
.build_examples_template: &build_examples_template
stage: build
image: espressif/idf:release-v4.3
tags:
- build
.build_knob_board_examples_script: &build_knob_board_examples_script
- for EXAMPLE in $EXAMPLES; do
- cd $CI_PROJECT_DIR/esp32-c3-lcd-ev-board/examples/$EXAMPLE
- echo Building $EXAMPLE
- idf.py fullclean
- idf.py build
- echo Build Complete for $EXAMPLE
- done
.setup_idf: &setup_idf
# TODO: IDF_VERSION maybe a commit id, use `git fetch` rather than `git clone -b`
- cd /opt/esp/idf/
- git branch
#- git log -5
# - git clone -b ${IDF_VERSION} ${IDF_GIT_REPO_URL} --depth=1
#- mkdir -p esp-idf
#- cd esp-idf
#- git init
#- git remote add origin ${IDF_GIT_REPO_URL}
#- git fetch origin ${IDF_VERSION}:refs/head --depth=1 -f
#- git checkout ${IDF_VERSION}
#- git checkout v5.0
#- git submodule update -f --init --recursive
#- pwd
- git apply $CI_PROJECT_DIR/esp32-s3-lcd-ev-board/factory/release5.0_psram_octal_120m.patch
#- ./install.sh
#- . ./export.sh
# fetch submodules
#- export PYTHONPATH=${IDF_PATH}/tools/ci/python_packages/:${PYTHONPATH}
#- pip install python-gitlab
#- python tools/ci/ci_fetch_submodule.py
.build_esp_s3_lcd_ev_board_script: &build_esp_s3_lcd_ev_board_script
- ls $CI_PROJECT_DIR
- for EXAMPLE in $EXAMPLES; do
- cd $CI_PROJECT_DIR/esp32-s3-lcd-ev-board/examples/$EXAMPLE
- echo Building $EXAMPLE
- idf.py fullclean
- git submodule update -f --init --recursive
- idf.py build
- echo Build Complete for $EXAMPLE
- done
.build_knob_board_template:
stage: build
tags:
- build
variables:
EXAMPLES: "c3_knob_panel"
script:
- *build_knob_board_examples_script
.build_esp_s3_lcd_ev_board_template:
stage: build
tags:
- build
variables:
EXAMPLES: "86box_demo"
before_script:
- *setup_idf
script:
- *build_esp_s3_lcd_ev_board_script
build_kaluga_demo_cmake:
<<: *build_examples_template
script:
- cd esp32-s2-kaluga-1
- cd examples/camera
- idf.py fullclean
- idf.py set-target esp32s2
- idf.py build
- cd ../../
- cd examples/lcd
- idf.py fullclean
- idf.py set-target esp32s2
- idf.py build
- cd ../../
- cd examples/touch
- idf.py fullclean
- idf.py set-target esp32s2
- idf.py build
- cd ../../
- cd examples/adc_button
- idf.py fullclean
- idf.py set-target esp32s2
- idf.py build
- cd ../../
- cd examples/touch_audio
- idf.py fullclean
- idf.py set-target esp32s2
- idf.py build
- cd ../../
- cd examples/web_tts
- idf.py fullclean
- idf.py set-target esp32s2
- idf.py build
build_hmi_demo_cmake:
<<: *build_examples_template
script:
- cd esp32-s2-hmi-devkit-1
- cd examples/audio/audio_record
- idf.py fullclean
- idf.py set-target esp32s2
- idf.py build
- cd ../../../
- cd examples/audio/music_player
- idf.py fullclean
- idf.py set-target esp32s2
- idf.py build
- cd ../../../
- cd examples/get-started/hello_world
- idf.py fullclean
- idf.py set-target esp32s2
- idf.py build
- cd ../../../
- cd examples/get-started/led_blink
- idf.py fullclean
- idf.py set-target esp32s2
- idf.py build
- cd ../../../
- cd examples/get-started/provision
- idf.py fullclean
- idf.py set-target esp32s2
- idf.py build
- cd ../../../
- cd examples/sensors
- idf.py fullclean
- idf.py set-target esp32s2
- idf.py build
- cd ../../
- cd examples/storage/sdcard_fatfs
- idf.py fullclean
- idf.py set-target esp32s2
- idf.py build
- cd ../../../
- cd examples/storage/usb_msc
- idf.py fullclean
- idf.py set-target esp32s2
- idf.py build
- cd ../../../
- cd examples/power
- idf.py fullclean
- idf.py set-target esp32s2
- idf.py build
- cd ../../
- cd examples/smart-panel
- idf.py fullclean
- idf.py set-target esp32s2
- idf.py build
- cd ../../
build_esp32-c3-lcd-ev-board:
extends: .build_knob_board_template
image: espressif/idf:release-v5.0
build_esp32-s3-lcd-ev-board:
extends: .build_esp_s3_lcd_ev_board_template
image: espressif/idf:release-v5.0
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 week
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_master_to_github:
stage: deploy
only:
- master
- /^release\/v/
# when: on_success
image: $CI_DOCKER_REGISTRY/esp32-ci-env
variables:
GIT_STRATEGY: clone
GITHUB_PUSH_REFS: refs/remotes/origin/release refs/remotes/origin/master
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 add github git@github.com:espressif/esp-dev-kits.git
# What the next line of script does: goes through the list of refs for all branches we push to github,
# generates a snippet of shell which is evaluated. The snippet checks CI_BUILD_REF against the SHA
# (aka objectname) at tip of each branch, and if any SHAs match then it checks out the local branch
# and then pushes that ref to a corresponding github branch
#
# NB: In gitlab 9.x, CI_BUILD_REF was deprecated. New name is CI_COMMIT_REF. If below command suddenly
# generates bash syntax errors, this is probably why.
- eval $(git for-each-ref --shell bash --format 'if [ $CI_BUILD_REF == %(objectname) ]; then git checkout -B %(refname:strip=3); git push --follow-tags github %(refname:strip=3); fi;' $GITHUB_PUSH_REFS)