forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 22
/
.gitlab-ci.yml
574 lines (540 loc) · 19.7 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
stages:
- test_build
- build
- pack
- sign
- private_deploy
- test
- public_deploy
- update_idf_tools
image: ${CI_DOCKER_REGISTRY}/llvm-build:4
variables:
ESP_LLVM_EMBEDDED_TOOLCHAIN_REF: "master"
ESP_GNU_TOOLCHAIN_VER: "13.2.0_20240305"
CROSS_ARM_IMAGE: $CI_DOCKER_REGISTRY/llvm-build-cross-arm:1
CROSS_WIN_IMAGE: $CI_DOCKER_REGISTRY/llvm-build-cross-win:2
DIST_DIR: "dist"
BUILD_DIR: "build"
.use_ci_tools: &use_ci_tools |
curl -sSL ${CIT_LOADER_URL} -o cit_loader.sh && sh cit_loader.sh
source citools/import_functions
.add_gitlab_key: &add_gitlab_key |
cit_add_ssh_key "${GITLAB_KEY}"
.get_toolchain_build_scripts: &get_toolchain_build_scripts |
git clone -b ${ESP_LLVM_EMBEDDED_TOOLCHAIN_REF} ${GITLAB_SSH_SERVER}/${ESP_LLVM_EMBEDDED_TOOLCHAIN_REPO}.git
before_script:
- *use_ci_tools
- *add_gitlab_key
.build_toolchain_template:
tags: [ "amd64", "build" ]
artifacts:
paths:
- ${DIST_DIR}/
- ${BUILD_DIR}/*.log
when: always
expire_in: 1 day
dependencies: []
variables:
TARGET: "Xtensa;RISCV"
USE_LINKER: "ld"
CROSS_BUILD_MINGW: "OFF"
BUILD_TARGET_LIBS: "OFF"
RUN_CORE_TESTS: "OFF"
RUN_PKG_TESTS: "OFF"
RUN_TARGET_LIB_TESTS: "OFF"
PACK_TOOLCHAIN: "ON"
PACK_STANDALONE_LIBS: "ON"
PACK_TARGET_LIBS: "OFF"
after_script:
# help to identify that build failed due to OOM
- >
if [ $CI_JOB_STATUS == 'failed' ]; then
[ ! -f "${BUILD_DIR}/build.log" ] || grep -i "internal compiler error\|Killed" ${BUILD_DIR}/build.log || true
[ ! -f "${BUILD_DIR}/tests.log" ] || grep -i "internal compiler error\|Killed" ${BUILD_DIR}/tests.log || true
[ ! -f "${BUILD_DIR}/compiler-rt-tests.log" ] || grep -i "internal compiler error\|Killed" ${BUILD_DIR}/compiler-rt-tests.log || true
[ ! -f "${BUILD_DIR}/lld-tests.log" ] || grep -i "internal compiler error\|Killed" ${BUILD_DIR}/lld-tests.log || true
[ ! -f "${BUILD_DIR}/pkg-tests.log" ] || grep -i "internal compiler error\|Killed" ${BUILD_DIR}/pkg-tests.log || true
fi
script:
- *get_toolchain_build_scripts
- LLVM_PROJECT_PATH=$PWD
- BUILD_PATH=$PWD/${BUILD_DIR}
- mkdir -p ${BUILD_PATH}
- BUILD_HOST=$(gcc -dumpmachine)
# Config to build target libraries
# TODO: do not build core tools (clang, lld, binutils etc)
# when PACK_TOOLCHAIN is OFF and PACK_TARGET_LIBS is ON.
# Re-use core tools built in another job.
# LLVM-xxx
- >
if [ "${PACK_TARGET_LIBS}" == "ON" ] || [ "${BUILD_TARGET_LIBS}" == "ON" ]; then
echo "Enable target libraries build"
export USE_LIBC="newlib";
export USE_LIBCXX="libstdcxx";
export USE_RTLIB="compiler-rt;libgcc";
else
echo "Disable target libraries"
export USE_LIBC=none;
export USE_LIBCXX="";
if [ "${RUN_CORE_TESTS}" == "ON" ]; then
# Need to have multilib dir structure to avoid test failures due to '-Wmissing-multilib'.
# So enable copying of libgcc from GNU toolchain. It is fast and not heavy.
export USE_RTLIB="libgcc";
else
export USE_RTLIB="";
fi
fi
# build toolchain core w/o any libs and GNU components
- cmake $PWD/esp-llvm-embedded-toolchain -GNinja
-DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=${LLVM_PROJECT_PATH}
-DNEWLIB_REPO_URL="${GITLAB_SSH_SERVER}/${NEWLIB_REPO_PATH}.git"
-DBINUTILS_REPO_URL="${GITLAB_SSH_SERVER}/${BINUTILS_REPO_PATH}.git"
-DXTENSA_OVERLAYS_REPO_URL="${GITLAB_SSH_SERVER}/${XTENSA_OVERLAYS_REPO_PATH}.git"
-DFETCHCONTENT_QUIET=OFF
-DESP_GNU_TOOLCHAIN_VER=${ESP_GNU_TOOLCHAIN_VER}
-DLLVM_TOOLCHAIN_CROSS_BUILD_MINGW=${CROSS_BUILD_MINGW}
-DUSE_LIBC=${USE_LIBC}
-DUSE_LIBCXX=${USE_LIBCXX}
-DUSE_RTLIB=${USE_RTLIB}
-DUSE_BINUTILS=ON
-DESP_TOOLCHAIN=ON
-DHOST_TRIPLE=${CONF_HOST}
-DLLVM_TOOLCHAIN_ENABLED_TARGETS="${TARGET}"
-DLLVM_USE_LINKER=${USE_LINKER}
-DLLVM_PARALLEL_LINK_JOBS=2
-DLLVM_PARALLEL_COMPILE_JOBS=2
-DCLANG_REPOSITORY_STRING="${GH_REPO_HTTPS}"
-DCPACK_ARCHIVE_THREADS=0
-B ${BUILD_PATH} 2>&1 > ${BUILD_PATH}/build.log
# Do not run unit tests for cross-builds.
# Run as non-root user because permission tests fail when run by root.
- >
if [[ "${CONF_HOST}" == "${BUILD_HOST}" ]]; then
export CUR_USER=$(whoami);
useradd -m test_runner;
chown -R test_runner ${BUILD_PATH};
if [[ "${RUN_CORE_TESTS}" == "ON" ]]; then
echo "Run LLVM/Clang unit tests";
touch ${BUILD_PATH}/tests.log;
chmod o+w ${BUILD_PATH}/tests.log;
runuser -u test_runner -- ninja -C ${BUILD_PATH} check-all 2>&1 > ${BUILD_PATH}/tests.log;
echo "Run LLD unit tests";
touch ${BUILD_PATH}/lld-tests.log;
chmod o+w ${BUILD_PATH}/lld-tests.log;
runuser -u test_runner -- ninja -C ${BUILD_PATH} check-lld 2>&1 > ${BUILD_PATH}/lld-tests.log;
fi
if [[ "${RUN_TARGET_LIB_TESTS}" == "ON" ]]; then
echo "Run Compiler-RT unit tests";
touch ${BUILD_PATH}/compiler-rt-tests.log;
chmod o+w ${BUILD_PATH}/compiler-rt-tests.log;
runuser -u test_runner -- ninja -C ${BUILD_PATH} check-compiler-rt 2>&1 > ${BUILD_PATH}/compiler-rt-tests.log;
fi
if [[ "${RUN_PKG_TESTS}" == "ON" ]]; then
echo "Run package tests";
# to avoid test failure "fatal: detected dubious ownership in repository at '/builds/llvm-project'"
chown -R test_runner $LLVM_PROJECT_PATH;
touch ${BUILD_PATH}/pkg-tests.log;
chmod o+w ${BUILD_PATH}/pkg-tests.log;
runuser -u test_runner -- ninja -C ${BUILD_PATH} check-package-llvm-toolchain 2>&1 > ${BUILD_PATH}/pkg-tests.log;
chown -R ${CUR_USER} $LLVM_PROJECT_PATH;
fi
chown -R ${CUR_USER} ${BUILD_PATH};
fi
# pack distro
- mkdir -p ${PWD}/${DIST_DIR}
- >
if [[ "${PACK_TOOLCHAIN}" == "ON" ]]; then
ninja -C ${BUILD_PATH} package-llvm-toolchain 2>&1 >> ${BUILD_PATH}/build.log
DISTRO_PACK_PATH=$(ninja -C ${BUILD_PATH} print-llvm-toolchain-package-path | tail -n 1)
echo "DISTRO_PACK_PATH=${DISTRO_PACK_PATH}"
mv ${DISTRO_PACK_PATH} ${PWD}/${DIST_DIR}/
ARCHIVE_NAME=$(basename ${DISTRO_PACK_PATH})
echo "${ARCHIVE_NAME}" > ${PWD}/${DIST_DIR}/dist_name_${CONF_HOST}
fi
# pack distro with standalone libs
- >
if [[ "${PACK_STANDALONE_LIBS}" == "ON" ]]; then
ninja -C ${BUILD_PATH} package-llvm-standalone-libs 2>&1 >> ${BUILD_PATH}/build.log
DISTRO_PACK_PATH=$(ninja -C ${BUILD_PATH} print-llvm-standalone-libs-package-path | tail -n 1)
echo "DISTRO_PACK_PATH=${DISTRO_PACK_PATH}"
mv ${DISTRO_PACK_PATH} ${PWD}/${DIST_DIR}/
ARCHIVE_NAME=$(basename ${DISTRO_PACK_PATH})
echo "${ARCHIVE_NAME}" > ${PWD}/${DIST_DIR}/libs_dist_name_${CONF_HOST}
fi
# pack target libraries to be re-used in distros for other platforms
- >
if [[ "${PACK_TARGET_LIBS}" == "ON" ]]; then
ninja -C ${BUILD_PATH} package-llvm-toolchain-target-libs 2>&1 >> ${BUILD_PATH}/build.log
DISTRO_PACK_PATH=$(ninja -C ${BUILD_PATH} print-llvm-toolchain-target-libs-package-path | tail -n 1)
echo "DISTRO_PACK_PATH=${DISTRO_PACK_PATH}"
mv ${DISTRO_PACK_PATH} ${PWD}/${DIST_DIR}/
ARCHIVE_NAME=$(basename ${DISTRO_PACK_PATH})
echo "${ARCHIVE_NAME}" > ${PWD}/${DIST_DIR}/target_libs_arch_name
fi
- ls -l ${PWD}/${DIST_DIR}
# some Clang/LLVM unit tests fail if we build Clang for RISCV+Xtensa only
# this job is intended to run unit tests only, so it builds Clang with all backends
# TODO: LLVM-326 and LLVM-401
build_and_test:
tags: [ "amd64", "build" ]
stage: test_build
artifacts:
paths:
- ${BUILD_DIR}/*.log
when: always
expire_in: 1 day
variables:
after_script:
# help to identify that build failed due to OOM
- >
if [ $CI_JOB_STATUS == 'failed' ]; then
[ ! -f "${BUILD_DIR}/build.log" ] || grep -i "internal compiler error\|Killed" ${BUILD_DIR}/build.log || true
[ ! -f "${BUILD_DIR}/tests.log" ] || grep -i "internal compiler error\|Killed" ${BUILD_DIR}/tests.log || true
[ ! -f "${BUILD_DIR}/lld-tests.log" ] || grep -i "internal compiler error\|Killed" ${BUILD_DIR}/lld-tests.log || true
fi
script:
- export BUILD_PATH=$PWD/${BUILD_DIR}
- mkdir -p ${BUILD_PATH}
- cmake -G Ninja
-S llvm
-DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra"
-DCMAKE_BUILD_TYPE=Release
-DLLVM_ENABLE_ASSERTIONS=ON
-DLLDB_INCLUDE_TESTS=OFF
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=Xtensa
-B ${BUILD_PATH} 2>&1 > ${BUILD_PATH}/build.log
- export CUR_USER=$(whoami);
- useradd -m test_runner;
- chown -R test_runner ${BUILD_PATH};
- echo "Run LLVM/Clang unit tests";
- touch ${BUILD_PATH}/tests.log;
- chmod o+w ${BUILD_PATH}/tests.log;
- runuser -u test_runner -- ninja -C ${BUILD_PATH} check-all 2>&1 > ${BUILD_PATH}/tests.log;
- echo "Run LLD unit tests";
- touch ${BUILD_PATH}/lld-tests.log;
- chmod o+w ${BUILD_PATH}/lld-tests.log;
- runuser -u test_runner -- ninja -C ${BUILD_PATH} check-lld 2>&1 > ${BUILD_PATH}/lld-tests.log;
- chown -R ${CUR_USER} ${BUILD_PATH};
.build_linux-gnu_template:
extends: .build_toolchain_template
variables:
USE_LINKER: "gold"
# Actually this job builds and packs distro for x86_64-linux-gnu,
# but also it runs package tests. So keep it in 'test_build' stage
build_x86_64-linux-gnu:
extends: .build_linux-gnu_template
stage: test_build
variables:
CONF_HOST: "x86_64-linux-gnu"
# Build complete distro it is necessary for running package tests
BUILD_TARGET_LIBS: "ON"
RUN_PKG_TESTS: "ON"
# Target libs are built in build_x86_64-linux-gnu, but due to artifacts
# size limit we have to produce target libs archive in this job.
# Archive with target libs from this job will be used in pack jobs
# for all platform except for x86_64-linux-gnu.
build_target_libs:
extends: .build_linux-gnu_template
stage: build
variables:
CONF_HOST: "x86_64-linux-gnu"
RUN_TARGET_LIB_TESTS: "ON"
PACK_TARGET_LIBS: "ON"
PACK_TOOLCHAIN: "OFF"
PACK_STANDALONE_LIBS: "OFF"
build_x86_64-w64-mingw32:
extends: .build_toolchain_template
stage: build
image: ${CROSS_WIN_IMAGE}
variables:
USE_LINKER: ""
CONF_HOST: "x86_64-w64-mingw32"
CROSS_BUILD_MINGW: "ON"
build_arm-linux-gnueabihf:
extends: .build_linux-gnu_template
stage: build
image: ${CROSS_ARM_IMAGE}
variables:
CONF_HOST: "arm-linux-gnueabihf"
build_aarch64-linux-gnu:
extends: .build_linux-gnu_template
stage: build
image: ${CROSS_ARM_IMAGE}
variables:
CONF_HOST: "aarch64-linux-gnu"
build_x86_64-apple-darwin:
extends: .build_toolchain_template
stage: build
variables:
CONF_HOST: "x86_64-apple-darwin21.1"
build_aarch64-apple-darwin:
extends: .build_toolchain_template
stage: build
variables:
CONF_HOST: "aarch64-apple-darwin21.1"
.unpack_distro: &unpack_distro |
pushd ${DIST_DIR}
ls -l
DISTRO_PACK_FILE=$(cat dist_name_${CONF_HOST})
echo "DISTRO_PACK_FILE=${DISTRO_PACK_FILE}"
${UNPACK_TOOL} ${DISTRO_PACK_FILE}
DISTRO_PACK_DIR=$(tar tJf ${DISTRO_PACK_FILE} | sed -e 's@/.*@@' | uniq)
ls -l $PWD/${DISTRO_PACK_DIR}/lib/clang-runtimes/
echo "DISTRO_PACK_DIR=${DISTRO_PACK_DIR}"
rm -f ${DISTRO_PACK_FILE}
.pack_template:
stage: pack
tags: [ "amd64", "build" ]
artifacts:
paths:
- ${DIST_DIR}/
when: always
expire_in: 3 day
variables:
PACK_TOOL: "tar cJf"
UNPACK_TOOL: "tar xJf"
script:
- *get_toolchain_build_scripts
# update distro
- *unpack_distro
- TARGET_LIBS_PACK_FILE=$(cat target_libs_arch_name)
- rm -f target_libs_arch_name
- echo "TARGET_LIBS_PACK_FILE=${TARGET_LIBS_PACK_FILE}"
- tar xJfv ${TARGET_LIBS_PACK_FILE}
- rm -f ${TARGET_LIBS_PACK_FILE}
- ls -l $PWD
- ls -l $PWD/${DISTRO_PACK_DIR}
- ls -l $PWD/${DISTRO_PACK_DIR}/lib/clang-runtimes/
# both distro and target libs archives have the same root dir name,
# so that dir contains everything we need to re-pack after unpacking steps above
- ${PACK_TOOL} ${DISTRO_PACK_FILE} ${DISTRO_PACK_DIR}
- rm -rf ${DISTRO_PACK_DIR}
- ls -l
pack_x86_64-w64-mingw32:
extends: .pack_template
needs:
# needs target libs archive from native build job
- job: "build_target_libs"
- job: "build_x86_64-w64-mingw32"
variables:
CONF_HOST: "x86_64-w64-mingw32"
pack_arm-linux-gnueabihf:
extends: .pack_template
needs:
# needs target libs archive from native build job
- job: "build_target_libs"
- job: "build_arm-linux-gnueabihf"
variables:
CONF_HOST: "arm-linux-gnueabihf"
pack_aarch64-linux-gnu:
extends: .pack_template
needs:
# needs target libs archive from native build job
- job: "build_target_libs"
- job: "build_aarch64-linux-gnu"
variables:
CONF_HOST: "aarch64-linux-gnu"
pack_x86_64-apple-darwin:
extends: .pack_template
needs:
# needs target libs archive from native build job
- job: "build_target_libs"
- job: "build_x86_64-apple-darwin"
variables:
CONF_HOST: "x86_64-apple-darwin21.1"
pack_aarch64-apple-darwin:
extends: .pack_template
needs:
# needs target libs archive from native build job
- job: "build_target_libs"
- job: "build_aarch64-apple-darwin"
variables:
CONF_HOST: "aarch64-apple-darwin21.1"
.macos_codesign_template:
stage: sign
when: on_success
resource_group: macos_codesign
tags: [ "darwin", "codesign" ]
artifacts:
paths:
- ${DIST_ART_DIR}
variables:
# directory with distro archives
DIST_ART_DIR: ${DIST_DIR}
# command to archive distro
ARCHIVE_TOOL: "tar cJf"
# command to unarchive distro
UNARCHIVE_TOOL: "tar xJf"
# URL to macos codesign repo
NOTARIZATION_SCRIPTS_GIT: "${CI_SERVER_PROTOCOL}://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/espressif/macos_codesign_notarization.git"
script:
- git clone -q --depth=1 ${NOTARIZATION_SCRIPTS_GIT} -b ${CI_COMMIT_REF_NAME} ||
git clone -q --depth=1 ${NOTARIZATION_SCRIPTS_GIT}
- ./macos_codesign_notarization/run.sh
sign_x86_64-apple-darwin:
extends: .macos_codesign_template
needs:
- pack_x86_64-apple-darwin
sign_aarch64-apple-darwin:
extends: .macos_codesign_template
needs:
- pack_aarch64-apple-darwin
.prepare_test_app_build: &prepare_test_app_build |
# Use custom idf in case custom branch is present
if [ -n "${TEST_APP_IDF_CUSTOM_BRANCH:-}" ]; then
echo "TEST_APP_IDF_CUSTOM_BRANCH=$TEST_APP_IDF_CUSTOM_BRANCH"
# Clone esp-idf
git clone --shallow-submodules --recursive --single-branch --branch $TEST_APP_IDF_CUSTOM_BRANCH -- https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/espressif/esp-idf.git esp-idf
export IDF_PATH=$PWD/esp-idf
# Activate pyenv
if [ $(command -v pyenv) ]; then
source /opt/pyenv/activate
pyenv global $(pyenv versions --bare)
fi
# 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}"
fi
idf.py --version || true
pushd $IDF_PATH/components
git clone --shallow-submodules --recursive --single-branch --branch $TEST_APP_ESP_DSP_CUSTOM_BRANCH -- https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/idf/esp-dsp.git esp-dsp
pushd $PWD/esp-dsp/test_app
test_esp_dsp:
image: espressif/idf:latest
tags: [ "amd64", "build" ]
allow_failure: true
artifacts:
paths:
- ${BUILD_DIR}/*.log
when: always
expire_in: 1 day
parallel:
matrix:
- CHIP: esp32p4
needs:
- job: "build_x86_64-linux-gnu"
variables:
# use IDF 'master' from docker image
TEST_APP_IDF_CUSTOM_BRANCH: ""
TEST_APP_ESP_DSP_CUSTOM_BRANCH: "master"
CONF_HOST: "x86_64-linux-gnu"
UNPACK_TOOL: "tar xJf"
script:
- mkdir -p $PWD/${BUILD_DIR}
- export BUILD_LOG=$PWD/${BUILD_DIR}/build.log
- *unpack_distro
- export PATH=$PWD/${DISTRO_PACK_DIR}/bin:${PATH}
- which clang
- *prepare_test_app_build
- export IDF_TOOLCHAIN=clang
- idf.py set-target ${CHIP} 2>&1 | tee ${BUILD_LOG}
- idf.py build 2>&1 | tee -a ${BUILD_LOG}
test_xesppie:
stage: test
dependencies:
- build_x86_64-linux-gnu
allow_failure: true
only:
- tags
script:
- cd ${DIST_DIR}/
- ls -l
- DISTRO_PACK_FILE=$(cat dist_name_x86_64-linux-gnu)
- tar -xf ${DISTRO_PACK_FILE}
- ls -l
- cd esp-clang
- ls -l
- pwd
- export CC="$(pwd)/bin/clang"
- export OBJDUMP="$(pwd)/bin/llvm-objdump"
- git clone -q --depth=1 "${GITLAB_SSH_SERVER}/idf/esp-compiler-tests.git"
- cd esp-compiler-tests/build-only/xesppie
- ./test_xesppie.py
upload_to_http:
stage: private_deploy
when: manual
allow_failure: true
tags: [ "deploy", "shiny" ]
variables:
# force the fetch strategy to clean old archives up in dist/ dir
GIT_STRATEGY: fetch
needs:
- job: build_x86_64-linux-gnu
script:
- cit_add_ssh_key "${HTTP_UPLOAD_KEY}"
# List of archives
- FILES=$(find ${DIST_DIR} -name dist_name_\* -exec cat {} \+)
- cd ${DIST_DIR}
- ls -l $FILES
- scp ${FILES} ${HTTP_UPLOAD_DIR}/ct-ng/llvm-builds
# Show info
- echo -e "\nArchives were published there:\n\n$(for n in ${FILES}; do echo "${HTTP_PUBLIC_DIR}/ct-ng/llvm-builds/${n}"; done)\n"
.gen_checksum_file: &gen_checksum_file |
ls -l ${FILES}
for n in ${FILES}; do
sz=$(stat -c%s "${n}") >> ${SHA256_FILE};
printf "# %s: %s bytes\n" "${n}" "${sz}" >> ${SHA256_FILE};
sha256sum -b "${n}" >> ${SHA256_FILE};
done
# Append FILES with checksum file
FILES=$(echo -e "${FILES}\n${SHA256_FILE}")
ls -l ${FILES}
upload_to_github:
stage: public_deploy
when: manual
allow_failure: true
only:
- tags
tags: [ "amd64", "internet" ]
image: espressif/github-hub:2
variables:
GIT_STRATEGY: fetch
GITHUB_TOKEN: "${GH_TOKEN}"
GITHUB_REPO: "${GH_REPO_HTTPS}"
TAG: "${CI_COMMIT_TAG}"
TOOLCHAIN_SHA256_FILE: clang-${CI_COMMIT_TAG}-checksum.sha256
LIBS_SHA256_FILE: libs-clang-${CI_COMMIT_TAG}-checksum.sha256
needs:
- job: build_x86_64-linux-gnu
- job: pack_arm-linux-gnueabihf
- job: pack_aarch64-linux-gnu
- job: pack_x86_64-w64-mingw32
- job: sign_x86_64-apple-darwin
- job: sign_aarch64-apple-darwin
- job: test_xesppie
before_script: []
script:
- ls -l ${DIST_DIR}
- cd ${DIST_DIR}
- git remote add github ${GH_REPO_HTTPS}
- hub release show ${TAG} || { echo "Please create a release on GitHub with ${TAG} tag at first"; exit 1; }
# Generate checksum file for toolchain
# List of archives
- FILES=$(find ${PWD} -name dist_name_\* -exec cat {} \+)
- SHA256_FILE=${TOOLCHAIN_SHA256_FILE}
- *gen_checksum_file
- DIST_FILES=${FILES}
# Generate checksum file for standalone libraries
- FILES=$(find ${PWD} -name libs_dist_name_\* -exec cat {} \+)
- SHA256_FILE=${LIBS_SHA256_FILE}
- *gen_checksum_file
- DIST_FILES=$(echo -e "${DIST_FILES}\n${FILES}")
- ls -l ${DIST_FILES}
# Upload archives
- for n in ${DIST_FILES}; do hub release edit -m "" -a "${n}" "${TAG}"; done
update_idf_tools:
stage: update_idf_tools
when: manual
allow_failure: true
only:
- tags
variables:
TOOL_NAME: esp-clang
TOOL_MEMBERS: esp-clang
TOOL_VERSION: ${CI_COMMIT_TAG}
TOOL_SHA256_URL: https://github.com/espressif/llvm-project/releases/download/${CI_COMMIT_TAG}/clang-${CI_COMMIT_TAG}-checksum.sha256
RN_SECTION: Toolchain
trigger:
project: idf/idf-tools-updater
strategy: depend