-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
662 lines (606 loc) · 20.9 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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
stages:
- build
- test
- deploy
- release_stage1
- release_submit
image: $CI_DOCKER_REGISTRY/esp32-toolchain
variables:
#
# System environment
# Common parameters for the 'make' during CI tests
MAKEFLAGS: "-j4 --no-keep-going"
# OpenOCD configuration options
OPENOCD_CONFIGURE_OPTS: "--disable-doxygen-html --disable-doxygen-pdf --enable-ftdi --enable-jlink --enable-ulink"
# GitHub Tool options
GITHUB_USER: "${GH_USER}"
GITHUB_REPO: "${GH_REPO}"
GITHUB_TOKEN: "${GH_TOKEN}"
#
# CI settings
# GIT_STRATEGY is not defined here, an option from "CI / CD Settings"- "General pipelines" is used.
GIT_SUBMODULE_STRATEGY: none
#
# Customization of jobs
DIST_ART_DIR: "dist"
DIST_INSTALLED_DIR: "${CI_PROJECT_NAME}"
ARCHIVE_TOOL: "tar czvf"
# UNARCHIVE_TOOL: "tar xvf"
ARCHIVE_EXT: "tar.gz"
GH_TOOL_NAME: github-release
GH_TOOL: "./${DIST_ART_DIR}/${GH_TOOL_NAME}"
RELEASE_DESC: "New release"
# py_debug_backend repo URL
DBG_BACKEND_REPO: "https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/espressif/py_debug_backend.git"
.submodules_mirror_update: &submodules_mirror_update |
# Gitlab doesn't clean submodule contents
git submodule foreach "git clean -d -x -f" || true
# Use local mirror for submodules
git config submodule.tools/git2cl.url https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/idf/git2cl.git
git config submodule.jimtcl.url https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/idf/jimtcl.git
git config submodule.src/jtag/drivers/libjaylink.url https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/idf/libjaylink.git
git submodule update --init
.get_release_name: &get_release_name |
PREFX=${CI_PROJECT_NAME}
tmpVER=$( tmpTAG=$(git describe --tags | grep -E "^v[0-9]") && ( echo $tmpTAG | sed -n -r "s|^v(.*)|\1|gp" ) || echo "" )
if [ ! $tmpVER ]; then
tmpVER=$( tmpTAG=$(git describe --tags | grep -E "^${PREFX}-") && ( echo $tmpTAG | sed -n -r "s|^${PREFX}-(.*)|\1|gp" ) || echo "" )
if [ ! $tmpVER ]; then
echo "There is not a correct tag"; exit 1
fi
fi
REL_VERSION=$tmpVER
REL_NAME=${CI_PROJECT_NAME}-${PLATFORM_NAME}-${REL_VERSION}
ARCHIVE_NAME=${REL_NAME}.${ARCHIVE_EXT}
echo "PLATFORM_NAME: $PLATFORM_NAME"
echo "REL_VERSION: $REL_VERSION"
echo "REL_NAME: $REL_NAME"
echo "ARCHIVE_NAME: $ARCHIVE_NAME"
.dist_archive: &dist_archive |
${ARCHIVE_TOOL} ${ARCHIVE_NAME} ${DIST_INSTALLED_DIR}
mkdir -p ${DIST_ART_DIR}
mv ${ARCHIVE_NAME} ${DIST_ART_DIR}
echo "${ARCHIVE_NAME}" > ${DIST_ART_DIR}/dist_name_${PLATFORM_NAME}
.add_gitlab_key: &add_gitlab_key |
command -v ssh-agent >/dev/null || exit 1
eval $(ssh-agent -s)
printf '%s\n' "${GITLAB_KEY}" | tr -d '\r' | ssh-add - > /dev/null
mkdir -p ~/.ssh && chmod 700 ~/.ssh
[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config || true
.add_gh_key_remote: &add_gh_key_remote |
command -v ssh-agent >/dev/null || exit 1
eval $(ssh-agent -s)
printf '%s\n' "${GH_PUSH_KEY}" | tr -d '\r' | ssh-add - > /dev/null
mkdir -p ~/.ssh && chmod 700 ~/.ssh
[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config || ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
git remote remove github || true
git remote add github ${GH_PUSH_REPO}
.gh_getting_tool: &gh_getting_tool |
# do not download if it was installed locally
LOCAL_TOOL_PATH=$(command -v ${GH_TOOL_NAME}) && cp ${LOCAL_TOOL_PATH} . || wget --no-verbose -O $GH_TOOL_NAME $GH_TOOL_URL
chmod +x ./$GH_TOOL_NAME
.gh_upload_archive: &gh_upload_archive |
ARCHIVE_NAME=$(cat ${DIST_ART_DIR}/dist_name_${PLATFORM_NAME})
echo Release ${GH_REL_TAG}, file ${ARCHIVE_NAME}
${GH_TOOL} upload -s ${GITHUB_TOKEN} --tag ${GH_REL_TAG} -f ${DIST_ART_DIR}/${ARCHIVE_NAME} -n ${ARCHIVE_NAME}
# prefix should be like a $CI_PROJECT_NAME, but we cannot use variable here
.release_tag_filter: &release_tag_filter
only:
- /^v[0-9].*$/
- /^openocd-esp32-.*$/
.release_submit_action: &release_submit_action
when: manual
allow_failure: true
.prepare_espytrace_package: &prepare_espytrace_package |
IDF_ESPYTRACE_DIR=$IDF_PATH/tools/esp_app_trace/espytrace
if [ -d "$IDF_ESPYTRACE_DIR" ]; then
cp -rv $IDF_ESPYTRACE_DIR $BUILD_TEST_APP_DIR/
else
cp -rv testing/esp/extra/espytrace $BUILD_TEST_APP_DIR/
fi
.prepare_test_app_build: &prepare_test_app_build |
mkdir -p $BUILD_TEST_APP_DIR
cp -rv testing/esp/test_apps/gen_ut_app $BUILD_TEST_APP_DIR/
pushd $BUILD_TEST_APP_DIR
git clone https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/espressif/esp-idf.git
pushd esp-idf
git checkout $TEST_APP_IDF_TAG || true
tools/ci/mirror-submodule-update.sh
export IDF_PATH=$PWD
export BATCH_BUILD=1
export V=0
popd
pushd gen_ut_app
.finish_test_app_build: &finish_test_app_build |
export UT_APP_DIR=$PWD
mkdir -p $UT_APP_DIR/gcov_data
if [ -d "$UT_APP_DIR/builds/apptrace_gcov_dual" ]; then
pushd $UT_APP_DIR/builds/apptrace_gcov_dual
find . -type d -exec mkdir -p $UT_APP_DIR/gcov_data/apptrace_gcov_dual/\{\} \;
popd
fi
if [ -d "$UT_APP_DIR/builds/apptrace_gcov_single" ]; then
pushd $UT_APP_DIR/builds/apptrace_gcov_single
find . -type d -exec mkdir -p $UT_APP_DIR/gcov_data/apptrace_gcov_single/\{\} \;
popd
fi
echo "export OPENOCD_GCOV_PREFIX=$UT_APP_DIR/gcov_data" > $UT_APP_DIR/gcov_data/gcov_env.sh
export PREFIX_STRIP=$(awk -F"/" '{print NF-1}' <<< $UT_APP_DIR/builds)
echo "export OPENOCD_GCOV_PREFIX_STRIP=$PREFIX_STRIP" >> $UT_APP_DIR/gcov_data/gcov_env.sh
popd
popd
.build_legacy_test_app_template: &build_legacy_test_app_template
stage: build
image: $CI_DOCKER_REGISTRY/esp32-ci-env
tags:
- build
artifacts:
paths:
- $BUILD_TEST_APP_DIR/gen_ut_app/output/*/gen_ut_app.elf
- $BUILD_TEST_APP_DIR/gen_ut_app/output/*/gen_ut_app.bin
- $BUILD_TEST_APP_DIR/gen_ut_app/output/*/partitions_singleapp.bin
- $BUILD_TEST_APP_DIR/gen_ut_app/output/multi_app_images/partitions_multi_apps.bin
- $BUILD_TEST_APP_DIR/gen_ut_app/output/*/bootloader/bootloader.bin
# Needed to run tests
- $BUILD_TEST_APP_DIR/gen_ut_app/main/gcov_tests.gcda.gcov
- $BUILD_TEST_APP_DIR/gen_ut_app/main/helper_funcs.gcda.gcov
- $BUILD_TEST_APP_DIR/gen_ut_app/gcov_data/apptrace_gcov_dual
- $BUILD_TEST_APP_DIR/gen_ut_app/gcov_data/apptrace_gcov_single
- $BUILD_TEST_APP_DIR/gen_ut_app/gcov_data/gcov_env.sh
- $BUILD_TEST_APP_DIR/espytrace
expire_in: 2 weeks
script:
- *add_gitlab_key
- *prepare_test_app_build
- make defconfig && make ut-build-all-configs
- *finish_test_app_build
- *prepare_espytrace_package
.do_build_test_app: &do_build_test_app |
if [ -z "$TEST_APP_CONFIGS" ]; then
echo "Build ALL"
IDF_TARGET=${CHIP_NAME} $IDF_PATH/tools/idf.py ut-build-all-configs
else
for cfg_name in $TEST_APP_CONFIGS
do
echo "Build <${cfg_name}>"
IDF_TARGET=${CHIP_NAME} $IDF_PATH/tools/idf.py ut-apply-config-$cfg_name
IDF_TARGET=${CHIP_NAME} $IDF_PATH/tools/idf.py ut-build-$cfg_name
done
fi
.build_test_app_template: &build_test_app_template
stage: build
image: $CI_DOCKER_REGISTRY/esp32-ci-env
tags:
- build
artifacts:
paths:
- $BUILD_TEST_APP_DIR/gen_ut_app/output/*/gen_ut_app.elf
- $BUILD_TEST_APP_DIR/gen_ut_app/output/*/gen_ut_app.bin
- $BUILD_TEST_APP_DIR/gen_ut_app/output/*/partition_table/partition-table.bin
- $BUILD_TEST_APP_DIR/gen_ut_app/output/*/bootloader/bootloader.bin
# Needed to run tests
- $BUILD_TEST_APP_DIR/gen_ut_app/main/gcov_tests.gcda.gcov
- $BUILD_TEST_APP_DIR/gen_ut_app/main/helper_funcs.gcda.gcov
- $BUILD_TEST_APP_DIR/gen_ut_app/gcov_data/apptrace_gcov_dual
- $BUILD_TEST_APP_DIR/gen_ut_app/gcov_data/apptrace_gcov_single
- $BUILD_TEST_APP_DIR/gen_ut_app/gcov_data/gcov_env.sh
- $BUILD_TEST_APP_DIR/espytrace
expire_in: 2 weeks
script:
- *add_gitlab_key
- *prepare_test_app_build
- ${IDF_PATH}/tools/idf_tools.py install xtensa-${CHIP_NAME}-elf
# cannot exec '. ${IDF_PATH}/export.sh' here because not all tools distros are presented
# in the image and `export.sh` fails w/o adding tools to $PATH
- idf_exports=$(${IDF_PATH}/tools/idf_tools.py export) || true
- eval "${idf_exports}"
- *do_build_test_app
- *finish_test_app_build
- *prepare_espytrace_package
.run_tests_linux: &run_tests_linux |
ARCHIVE_NAME=$(cat ${DIST_ART_DIR}/dist_name_${PLATFORM_NAME})
tar -C ${TEST_RUN_DIR} -x -f ${DIST_ART_DIR}/${ARCHIVE_NAME}
export DIST_DIR=${PWD}/${TEST_RUN_DIR}/${DIST_INSTALLED_DIR}
pushd $PWD/testing/esp
git clone $DBG_BACKEND_REPO
pushd py_debug_backend
git checkout $CUSTOM_DEBUG_BACKEND_TAG || git checkout $CI_COMMIT_REF_NAME || echo "using default branch"
popd
popd
export PYTHONPATH=$PWD/${TEST_RUN_DIR}:$PWD/testing/esp/py_debug_backend
. $PWD/${TEST_RUN_DIR}/gen_ut_app/gcov_data/gcov_env.sh
testing/esp/run_tests.py -o $DIST_DIR/bin/openocd -s $DIST_DIR/share/openocd/scripts -a $PWD/$TEST_RUN_DIR -t xtensa-${CHIP_NAME}-elf- -d 4 -l $PWD/$TEST_RUN_DIR/debug_backend_tests.log -to $PWD/$TEST_RUN_DIR/results $TEST_RUN_EXTRA_OPTS
.tests_linux_template: &tests_linux_template
stage: test
image: $CI_DOCKER_REGISTRY/esp32-ci-env
artifacts:
paths:
- $TEST_RUN_DIR/debug_backend_tests.log
reports:
junit:
- $TEST_RUN_DIR/results/*
when: always
expire_in: 1 week
script:
- *add_gitlab_key
- *submodules_mirror_update
- *run_tests_linux
.tests_armel_template: &tests_armel_template
stage: test
image: $CI_DOCKER_REGISTRY/rpi-test-env
artifacts:
paths:
- $TEST_RUN_DIR/debug_backend_tests.log
reports:
junit:
- $TEST_RUN_DIR/results/*
when: always
expire_in: 1 week
script:
- *add_gitlab_key
- *submodules_mirror_update
- export PATH=${HOME}/.espressif/tools/xtensa-${CHIP_NAME}-elf/${ESP_TOOLCHAIN_VER}/xtensa-${CHIP_NAME}-elf/bin:${PATH}
- source /opt/pyenv/activate && pyenv global ${TEST_IMAGE_PYTHON_VER}
- *run_tests_linux
before_script:
- set -o errexit; set -o pipefail; set -o nounset
- test ${DEBUG_SHELL:-""} && set -x
build_linux:
stage: build
image: $CI_DOCKER_REGISTRY/esp32-toolchain
tags:
- build
artifacts:
paths:
- ${DIST_ART_DIR}
expire_in: 2 weeks
variables:
PLATFORM_NAME: "linux64"
script:
- *get_release_name
- *add_gitlab_key
- *submodules_mirror_update
- ./bootstrap
- mkdir _build
- pushd _build/
- ../configure --prefix=$PWD/../$DIST_INSTALLED_DIR $OPENOCD_CONFIGURE_OPTS
- make
- src/openocd --version 2>&1 | { ! grep 'dirty'; }
- MAKEFLAGS= make install-strip
- popd
- *dist_archive
build_linux_armel:
stage: build
image: $CI_DOCKER_REGISTRY/esp32-toolchain-arm-cross
tags:
- build
artifacts:
paths:
- ${DIST_ART_DIR}
expire_in: 2 weeks
variables:
CONF_HOST: "arm-linux-gnueabi"
PLATFORM_NAME: "armel"
script:
- *get_release_name
- *add_gitlab_key
- *submodules_mirror_update
- ./bootstrap
- mkdir _build
- pushd _build/
- ../configure --prefix=$PWD/../$DIST_INSTALLED_DIR --host=${CONF_HOST} $OPENOCD_CONFIGURE_OPTS
- make
- MAKEFLAGS= make install-strip
- popd
- *dist_archive
build_windows:
stage: build
image: $CI_DOCKER_REGISTRY/esp32-toolchain-win-cross
tags:
- build
artifacts:
paths:
- ${DIST_ART_DIR}
expire_in: 2 weeks
variables:
CONF_HOST: "i686-w64-mingw32"
PLATFORM_NAME: "win32"
ARCHIVE_TOOL: "zip -r"
ARCHIVE_EXT: "zip"
script:
- *get_release_name
- *add_gitlab_key
- *submodules_mirror_update
# Build libusb-1.0
- export LIBUSB_VER=libusb-1.0.21
- wget https://dl.espressif.com/dl/$LIBUSB_VER.tar.gz -O $LIBUSB_VER.tar.gz
- tar xzf $LIBUSB_VER.tar.gz && rm $LIBUSB_VER.tar.gz
- pushd $LIBUSB_VER
- ./bootstrap.sh
- ./configure --prefix=$PWD/dist --host=${CONF_HOST} --enable-shared=no --enable-static=yes
- make
- make install-strip
- export PKG_CONFIG_PATH=$PWD/dist/lib/pkgconfig
- popd
# Build OpenOCD
- git submodule update --init
- ./bootstrap
- mkdir _build
- pushd _build/
- ../configure --prefix=$PWD/../$DIST_INSTALLED_DIR --host=${CONF_HOST} $OPENOCD_CONFIGURE_OPTS
- make
- MAKEFLAGS= make install-strip
- popd
- cp /usr/${CONF_HOST}/lib/libwinpthread-1.dll $DIST_INSTALLED_DIR/bin/
- *dist_archive
build_macos:
stage: build
image: $CI_DOCKER_REGISTRY/osxcross
tags:
- build
artifacts:
paths:
- ${DIST_ART_DIR}
expire_in: 2 weeks
variables:
PLATFORM_NAME: "macos"
script:
- *get_release_name
- *add_gitlab_key
- *submodules_mirror_update
# Osxcross comes with a no-op symlink for pkg-confg,
# remove it and install pkg-config.
# TODO: prepare a Docker image which would have it included.
- rm -f `which x86_64-apple-darwin12-pkg-config`
- wget https://dl.espressif.com/dl/pkg-config_0.28-1_amd64.deb
- dpkg -i ./pkg-config_0.28-1_amd64.deb
# Build bootstrap tcl interpreter.
# TODO: include 'tcl' package into the docker image instead
- cp -r jimtcl jimtcl-bootstarp
- pushd jimtcl-bootstarp/
- ./configure --prefix=$PWD/local
- make
- make install
- popd
# Cross-compile libusb-1.0 for OSX
- export LIBUSB_VER=libusb-1.0.21
- wget https://dl.espressif.com/dl/$LIBUSB_VER.tar.gz -O $LIBUSB_VER.tar.gz
- tar xzf $LIBUSB_VER.tar.gz && rm $LIBUSB_VER.tar.gz
- pushd $LIBUSB_VER
- ./bootstrap.sh
- ./configure --prefix=$PWD/dist --host=x86_64-apple-darwin12 --enable-shared=no --enable-static=yes CC=x86_64-apple-darwin12-cc
- make
- make install
- popd
# Finally, cross-compile OpenOCD
- export PKG_CONFIG_PATH=$PWD/$LIBUSB_VER/dist/lib/pkgconfig
- ./bootstrap
- mkdir _build
- pushd _build/
- ../configure --prefix=$PWD/../$DIST_INSTALLED_DIR --host=x86_64-apple-darwin12 $OPENOCD_CONFIGURE_OPTS LDFLAGS="-Wl,-framework,CoreFoundation -Wl,-framework,IOKit" CC=x86_64-apple-darwin12-cc
- make
- MAKEFLAGS= make install-strip
- popd
- *dist_archive
build_test_app_esp32:
<<: *build_test_app_template
variables:
CHIP_NAME: "esp32"
BUILD_TEST_APP_DIR: "build_test_app_esp32"
TEST_APP_CONFIGS: ""
TEST_APP_IDF_TAG: $CI_COMMIT_REF_NAME
UT_GET_IDF_VER: "0"
build_test_app_esp32s2:
<<: *build_test_app_template
variables:
CHIP_NAME: "esp32s2"
BUILD_TEST_APP_DIR: "build_test_app_esp32s2"
TEST_APP_CONFIGS: ""
TEST_APP_IDF_TAG: $CI_COMMIT_REF_NAME
UT_GET_IDF_VER: "0"
build_test_app_esp32_legacy_idf_rel:
<<: *build_legacy_test_app_template
variables:
CHIP_NAME: "esp32"
BUILD_TEST_APP_DIR: "build_test_app_esp32_legacy_idf_rel"
TEST_APP_CONFIGS: ""
TEST_APP_IDF_TAG: "v$TEST_APP_LEGACY_IDF_RELEASE_TAG"
UT_GET_IDF_VER: "1"
build_test_app_esp32_custom_idf_rel:
<<: *build_test_app_template
variables:
CHIP_NAME: "esp32"
BUILD_TEST_APP_DIR: "build_test_app_esp32_custom_idf_rel"
TEST_APP_CONFIGS: "default single_core"
TEST_APP_IDF_TAG: "v$TEST_APP_CUSTOM_IDF_RELEASE_TAG"
UT_GET_IDF_VER: "1"
tests_armel_esp32_solo:
<<: *tests_armel_template
tags:
- arm
- test_jtag_solo
dependencies:
- build_test_app_esp32
- build_linux_armel
variables:
CHIP_NAME: "esp32"
PLATFORM_NAME: "armel"
TEST_RUN_DIR: "build_test_app_esp32"
TEST_RUN_EXTRA_OPTS: "-i latest -b esp32-solo-devkitj -p test_*.*Single"
tests_armel_esp32_legacy_idf_rel:
<<: *tests_armel_template
tags:
- test_jtag_arm
dependencies:
- build_test_app_esp32_legacy_idf_rel
- build_linux_armel
variables:
CHIP_NAME: "esp32"
PLATFORM_NAME: "armel"
TEST_RUN_DIR: "build_test_app_esp32_legacy_idf_rel"
TEST_RUN_EXTRA_OPTS: "-i $TEST_APP_LEGACY_IDF_RELEASE_TAG -b esp32-wrover-kit-3.3v"
tests_armel_esp32_custom_idf_rel:
<<: *tests_armel_template
tags:
- test_jtag_arm
dependencies:
- build_test_app_esp32_custom_idf_rel
- build_linux_armel
variables:
CHIP_NAME: "esp32"
PLATFORM_NAME: "armel"
TEST_RUN_DIR: "build_test_app_esp32_custom_idf_rel"
# currently we need to run semihost test on IDF with old semihost driver
TEST_RUN_EXTRA_OPTS: "-i $TEST_APP_CUSTOM_IDF_RELEASE_TAG -b esp32-wrover-kit-3.3v -p test_semihost"
tests_armel_esp32:
<<: *tests_armel_template
tags:
- test_jtag_arm
dependencies:
- build_test_app_esp32
- build_linux_armel
variables:
CHIP_NAME: "esp32"
PLATFORM_NAME: "armel"
TEST_RUN_DIR: "build_test_app_esp32"
TEST_RUN_EXTRA_OPTS: "-i latest -b esp32-wrover-kit-3.3v"
tests_armel_esp32s2:
<<: *tests_armel_template
tags:
- test_jtag_arm_esp32s2
dependencies:
- build_test_app_esp32s2
- build_linux_armel
variables:
CHIP_NAME: "esp32s2"
PLATFORM_NAME: "armel"
TEST_RUN_DIR: "build_test_app_esp32s2"
TEST_RUN_EXTRA_OPTS: "-i latest -b esp32s2-devkitj -p test_*.*Single"
style_check:
stage: build
image: $CI_DOCKER_REGISTRY/esp32-ci-env
tags:
- build
script:
- tools/check-line-endings.sh $PWD
- tools/format-esp.sh && git diff --exit-code
push_master_to_github:
stage: deploy
image: $CI_DOCKER_REGISTRY/esp32-ci-env
only:
- master
when: on_success
dependencies: []
variables:
GIT_STRATEGY: clone
script:
- *add_gh_key_remote
- git push github HEAD:master
get_gh_tools:
stage: test
<<: *release_tag_filter
artifacts:
paths:
- ${DIST_ART_DIR}
variables:
GIT_STRATEGY: none
script:
- *gh_getting_tool
- mkdir -p ${DIST_ART_DIR}
- mv ${GH_TOOL_NAME} ${DIST_ART_DIR}/
release_tag_draft:
stage: release_stage1
<<: *release_tag_filter
when: on_success
script:
- *add_gh_key_remote
- git push github --force ${CI_COMMIT_TAG}
# release draft
- ${GH_TOOL} delete -s ${GITHUB_TOKEN} --tag ${CI_COMMIT_TAG} || true
- ${GH_TOOL} release -s ${GITHUB_TOKEN} --tag ${CI_COMMIT_TAG} --description "${RELEASE_DESC}" --draft
- GH_REL_TAG=${CI_COMMIT_TAG}
# Upload archives
- PLATFORM_NAME="linux64"
- *gh_upload_archive
- PLATFORM_NAME="armel"
- *gh_upload_archive
- PLATFORM_NAME="win32"
- *gh_upload_archive
- PLATFORM_NAME="macos"
- *gh_upload_archive
Release_tag_submit:
stage: release_submit
<<: *release_tag_filter
<<: *release_submit_action
dependencies:
- get_gh_tools
variables:
GIT_STRATEGY: none
script:
- ${GH_TOOL} edit -s ${GITHUB_TOKEN} --tag ${CI_COMMIT_TAG} --description "${RELEASE_DESC}"
Pre-Release_tag_submit:
stage: release_submit
<<: *release_tag_filter
<<: *release_submit_action
dependencies:
- get_gh_tools
variables:
GIT_STRATEGY: none
script:
- ${GH_TOOL} edit -s ${GITHUB_TOKEN} --tag ${CI_COMMIT_TAG} --description "${RELEASE_DESC}" --pre-release
Delete_tag_release:
stage: release_submit
<<: *release_tag_filter
<<: *release_submit_action
dependencies:
- get_gh_tools
variables:
GIT_STRATEGY: none
script:
- ${GH_TOOL} delete -s ${GITHUB_TOKEN} --tag ${CI_COMMIT_TAG} || true
build_nuttx_app:
stage: build
variables:
TRIGGER_JOB: "OPENOCD"
trigger:
project: idf/apache/esp-nuttx-apps
strategy: depend
.copy_nuttx_files: ©_nuttx_files |
cp testing/esp/test_apps/nuttx/gdbstartup $TEST_RUN_DIR/$NUTTX_APP_NAME
mv nuttx.bin $TEST_RUN_DIR/$NUTTX_APP_NAME/$NUTTX_APP_NAME.bin
mv nuttx $TEST_RUN_DIR/$NUTTX_APP_NAME/$NUTTX_APP_NAME.elf
mv bootloader.bin partition-table.bin $TEST_RUN_DIR/$NUTTX_APP_NAME/
test_nuttx_esp32:
image: $CI_DOCKER_REGISTRY/rpi-test-env
stage: test
tags:
- test_jtag_arm
variables:
PLATFORM_NAME: "armel"
TEST_RUN_DIR: "nuttx_test"
NUTTX_APP_NAME: "nuttx_openocd"
CHIP_NAME: "esp32"
OOCD_CMDS: "set ESP_RTOS NuttX,set ESP32_ONLYCPU 1"
TEST_RUN_EXTRA_OPTS: "-i other -b esp32-wrover-kit-3.3v -p test_nuttx"
needs:
- job: build_linux_armel
artifacts: true
- job: build_nuttx_app
artifacts: false
- project: idf/apache/esp-nuttx-apps
job: build_esp32_openocd
ref: master
artifacts: true
script:
- export PATH=${HOME}/.espressif/tools/xtensa-${CHIP_NAME}-elf/${ESP_TOOLCHAIN_VER}/xtensa-${CHIP_NAME}-elf/bin:${PATH}
- source /opt/pyenv/activate && pyenv global ${TEST_IMAGE_PYTHON_VER}
- mkdir -p $TEST_RUN_DIR/$NUTTX_APP_NAME
- *copy_nuttx_files
- ARCHIVE_NAME=$(cat ${DIST_ART_DIR}/dist_name_${PLATFORM_NAME})
- tar -C ${TEST_RUN_DIR} -x -f ${DIST_ART_DIR}/${ARCHIVE_NAME}
- export DIST_DIR=${PWD}/${TEST_RUN_DIR}/${DIST_INSTALLED_DIR}
- pushd $PWD/testing/esp
- git clone $DBG_BACKEND_REPO
- popd
- export PYTHONPATH=$PWD/${TEST_RUN_DIR}:$PWD/testing/esp/py_debug_backend
- testing/esp/run_tests.py -o $DIST_DIR/bin/openocd -s $DIST_DIR/share/openocd/scripts -a $PWD/$TEST_RUN_DIR -t xtensa-${CHIP_NAME}-elf- -d 4 -l $PWD/$TEST_RUN_DIR/debug_backend_tests.log $TEST_RUN_EXTRA_OPTS -c "${OOCD_CMDS}"