forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy path.universal-toolchain-release.yml
529 lines (497 loc) · 18.5 KB
/
.universal-toolchain-release.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
# Prepare release name/number
.get_release_name: &get_release_name |
# using annotated tags
REL_NUM=$(git describe --abbrev=7)
REL_NAME=${REL_SFX}-${REL_NUM}-${PLATFORM_NAME}
ARCHIVE_NAME=${REL_NAME}.${ARCHIVE_EXT}
LIBS_ARCHIVE_NAME=libs_${REL_NAME}.${ARCHIVE_EXT}
echo "PLATFORM_NAME: $PLATFORM_NAME"
echo "REL_NUM: $REL_NUM"
echo "REL_NAME: $REL_NAME"
echo "ARCHIVE_NAME: $ARCHIVE_NAME"
# Get an existing crosstool-ng builds for all chips
.get_gcc_toolchain: &get_gcc_toolchain |
declare -a XTENSA_CPUS=("esp32"
"esp32s2"
"esp32s3")
for ((i = 0; i < ${#XTENSA_CPUS[@]}; i++)); do
XTENSA_CPU=${XTENSA_CPUS[$i]}
GCC_TOOLCHAIN_ARCH=xtensa-${XTENSA_CPU}-elf-${GCC_REL_VER}-${GCC_PLATFORM_NAME}.${GCC_ARCHIVE_EXT}
wget --no-verbose https://dl.espressif.com/github_assets/espressif/crosstool-NG/releases/download/esp-${GCC_REL_VER}/${GCC_TOOLCHAIN_ARCH}
${GCC_UNARCHIVE_TOOL} ${GCC_TOOLCHAIN_ARCH}
done;
GCC_TOOLCHAIN_ARCH=riscv32-esp-elf-${GCC_REL_VER}-${GCC_PLATFORM_NAME}.${GCC_ARCHIVE_EXT}
wget --no-verbose https://dl.espressif.com/github_assets/espressif/crosstool-NG/releases/download/esp-${GCC_REL_VER}/${GCC_TOOLCHAIN_ARCH}
${GCC_UNARCHIVE_TOOL} ${GCC_TOOLCHAIN_ARCH}
# Pack the toolchain
.package_toolchain: &package_toolchain |
${ARCHIVE_TOOL} ${ARCHIVE_NAME} esp-clang/
mkdir -p ${DISTRO_DIR}
mv ${ARCHIVE_NAME} ${DISTRO_DIR}/
echo "${ARCHIVE_NAME}" > ${DISTRO_DIR}/dist_name_${PLATFORM_NAME}
# Pack libs to be used for Rust, Go etc.
.package_libs: &package_libs |
eval ${ARCHIVE_TOOL} ${LIBS_ARCHIVE_NAME} esp-clang/lib/clang/${CLANG_VER}/include esp-clang/lib/lib{clang,LLVM}* ${LIBS_PACK_EXTRA_PATHS:-}
mkdir -p ${DISTRO_DIR}
mv ${LIBS_ARCHIVE_NAME} ${DISTRO_DIR}/
echo "${LIBS_ARCHIVE_NAME}" > ${DISTRO_DIR}/dist_name_libs-${PLATFORM_NAME}
.get_binutils: &get_binutils |
git clone -b ${BINUTILS_REF} --single-branch ${GITLAB_SSH_SERVER}/idf/${BINUTILS_REPO}.git
BINUTILS_PATH=$PWD/${BINUTILS_REPO}
.get_xtensa_overlays: &get_xtensa_overlays |
git clone -b ${XTENSA_OVERLAYS_REF} --single-branch ${GITLAB_SSH_SERVER}/idf/${XTENSA_OVERLAYS_REPO}.git
XTENSA_OVERLAYS_PATH=$PWD/${XTENSA_OVERLAYS_REPO}
.get_newlib: &get_newlib |
git clone -b ${NEWLIB_REF} --single-branch ${GITLAB_SSH_SERVER}/idf/${NEWLIB_REPO}.git
NEWLIB_PATH=$PWD/${NEWLIB_REPO}
.build_template:
stage: build
tags: [ "amd64", "build" ]
artifacts:
paths:
- ${DIST_DIR}/
- ${BUILD_DIR}/lld-tests.log
- ${BUILD_DIR}/tests.log
- ${BUILD_DIR}/build.log
- "${BUILD_DIR}/**/CMakeError.log"
- "${BUILD_DIR}/**/CMakeOutput.log"
when: always
expire_in: 1 day
variables:
BUILD_TOOLCHAIN_CMD_EXTRA_ARGS: ""
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:
- *get_release_name
- mkdir ${DOWNLOADS_DIR}
- pushd ${DOWNLOADS_DIR}
- ESP_GCC_TOOLCHAIN_DIST_BASE=$PWD
- *get_gcc_toolchain
- *get_binutils
- *get_xtensa_overlays
- popd
- !reference [.get_clang_toolchain_build_scripts, script]
- !reference [.fix_origin_remote_for_public, script]
- LLVM_PROJECT_PATH=$PWD
- BUILD_PATH=$PWD/${BUILD_DIR}
- mkdir -p ${BUILD_PATH}
- export USE_PARALLEL_LINK_JOBS=2
- export USE_PARALLEL_COMPILE_JOBS=2
# build Clang toolchain w/o newlib
- ${BUILD_TOOLCHAIN_CMD} --llvm-path=${LLVM_PROJECT_PATH}
--gcc-toolchains-path=${ESP_GCC_TOOLCHAIN_DIST_BASE} --binutils-path=${BINUTILS_PATH}
--xtensa-overlays-path=${XTENSA_OVERLAYS_PATH} --host=${CONF_HOST} ${BUILD_TOOLCHAIN_CMD_EXTRA_ARGS} ${BUILD_PATH} 2>&1 > ${BUILD_PATH}/build.log
- BUILD_HOST=$(gcc -dumpmachine)
# 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 LLVM_BUILD_PATH=${BUILD_PATH}/build/llvm/build-${CONF_HOST}-Release;
echo "Run unit tests for native build in ${LLVM_BUILD_PATH}";
useradd -m test_runner;
chown -R test_runner ${LLVM_BUILD_PATH};
touch ${BUILD_PATH}/tests.log;
chmod o+w ${BUILD_PATH}/tests.log;
runuser -l test_runner -c 'cmake --build '${LLVM_BUILD_PATH}' --target check-all 2>&1 > '${BUILD_PATH}'/tests.log';
touch ${BUILD_PATH}/lld-tests.log;
chmod o+w ${BUILD_PATH}/lld-tests.log;
runuser -l test_runner -c 'cmake --build '${LLVM_BUILD_PATH}' --target lld-test 2>&1 > '${BUILD_PATH}'/lld-tests.log';
fi
- export DISTRO_DIR=$PWD/$DIST_DIR
- pushd ${BUILD_PATH}
- *package_toolchain
- popd
.build_linux-gnu_template:
extends: .build_template
variables:
ARCHIVE_TOOL: "${ARCHIVE_TOOL_LINUX}"
ARCHIVE_EXT: "${ARCHIVE_EXT_LINUX}"
GCC_UNARCHIVE_TOOL: "${UNARCHIVE_TOOL_LINUX}"
GCC_ARCHIVE_EXT: "${ARCHIVE_EXT_LINUX}"
BUILD_TOOLCHAIN_CMD: "./build-toolchain.sh"
USE_LINKER: "gold"
build_x86_64-linux-gnu:
extends: .build_linux-gnu_template
variables:
CONF_HOST: "x86_64-linux-gnu"
PLATFORM_NAME: "${PLATFORM_NAME_LINUX}"
GCC_PLATFORM_NAME: "${GCC_PLATFORM_NAME_LINUX}"
build_arm-linux-gnueabihf:
extends: .build_linux-gnu_template
image: ${CROSS_ARM_IMAGE}
variables:
CONF_HOST: "arm-linux-gnueabihf"
PLATFORM_NAME: "${PLATFORM_NAME_LINUX_ARMHF}"
GCC_PLATFORM_NAME: "${GCC_PLATFORM_NAME_LINUX_ARMHF}"
build_aarch64-linux-gnu:
extends: .build_linux-gnu_template
image: ${CROSS_ARM_IMAGE}
variables:
CONF_HOST: "aarch64-linux-gnu"
PLATFORM_NAME: "${PLATFORM_NAME_LINUX_ARM64}"
GCC_PLATFORM_NAME: "${GCC_PLATFORM_NAME_LINUX_ARM64}"
build_x86_64-w64-mingw32:
extends: .build_template
needs:
# needs native toolchain and newlib from this job
- job: build_x86_64-linux-gnu
before_script:
- !reference [.use_ci_tools, script]
- !reference [.add_gitlab_key, script]
# get ARCHIVE_NAME for Linux release. Modify vars to make get_release_name working properly
- CLANG_LINUX_ARCHIVE=$(cat ${DIST_DIR}/dist_name_${PLATFORM_NAME_LINUX})
# unpack x86_64-linux-gnu toolchain to re-use it as native Clang for Windows build
- mkdir -p esp-clang-${PLATFORM_NAME_LINUX}
- ${UNARCHIVE_TOOL_LINUX} ${DIST_DIR}/${CLANG_LINUX_ARCHIVE} -C esp-clang-${PLATFORM_NAME_LINUX}
# we do not want to keep artifacts from 'x86_64-linux-gnu' job
- rm -rf ${DIST_DIR}
- rm -rf ${BUILD_DIR}
# add build command args speciifc for Windows build
- export BUILD_TOOLCHAIN_CMD_EXTRA_ARGS="--native-esp-clang-path=$PWD/esp-clang-${PLATFORM_NAME_LINUX}"
variables:
CONF_HOST: "x86_64-w64-mingw32"
PLATFORM_NAME: "${PLATFORM_NAME_WIN}"
GCC_PLATFORM_NAME: "${GCC_PLATFORM_NAME_WIN}"
ARCHIVE_TOOL: "${ARCHIVE_TOOL_LINUX}"
ARCHIVE_EXT: "${ARCHIVE_EXT_LINUX}"
GCC_UNARCHIVE_TOOL: "${UNARCHIVE_TOOL_WIN}"
GCC_ARCHIVE_EXT: "${ARCHIVE_EXT_WIN}"
BUILD_TOOLCHAIN_CMD: "./build-toolchain-win.sh"
.build_apple-darwin_template:
extends: .build_template
variables:
ARCHIVE_TOOL: "${ARCHIVE_TOOL_MACOS}"
ARCHIVE_EXT: "${ARCHIVE_EXT_MACOS}"
GCC_UNARCHIVE_TOOL: "${UNARCHIVE_TOOL_MACOS}"
GCC_ARCHIVE_EXT: "${ARCHIVE_EXT_MACOS}"
BUILD_TOOLCHAIN_CMD: "./build-toolchain.sh"
build_x86_64-apple-darwin:
extends: .build_apple-darwin_template
variables:
CONF_HOST: "x86_64-apple-darwin21.1"
PLATFORM_NAME: "${PLATFORM_NAME_MACOS}"
GCC_PLATFORM_NAME: "${GCC_PLATFORM_NAME_MACOS}"
build_aarch64-apple-darwin:
extends: .build_apple-darwin_template
variables:
CONF_HOST: "aarch64-apple-darwin21.1"
PLATFORM_NAME: "${PLATFORM_NAME_MACOS_ARM64}"
GCC_PLATFORM_NAME: "${GCC_PLATFORM_NAME_MACOS_ARM64}"
build_newlib:
stage: build
tags: [ "amd64", "build" ]
needs:
# needs native toolchain
- job: build_x86_64-linux-gnu
artifacts:
paths:
- ${DIST_DIR}/
- ${BUILD_DIR}/build.log
when: always
expire_in: 1 day
variables:
PLATFORM_NAME: "${PLATFORM_NAME_LINUX}"
ARCHIVE_TOOL: "${ARCHIVE_TOOL_LINUX}"
UNARCHIVE_TOOL: "${UNARCHIVE_TOOL_LINUX}"
ARCHIVE_EXT: "${ARCHIVE_EXT_LINUX}"
script:
# get ARCHIVE_NAME for Linux release.
- CLANG_ARCHIVE=$PWD/${DIST_DIR}/$(cat ${DIST_DIR}/dist_name_${PLATFORM_NAME_LINUX})
- mkdir -p ${DOWNLOADS_DIR}
- pushd ${DOWNLOADS_DIR}
- *get_xtensa_overlays
- *get_newlib
# unpack clang
- ${UNARCHIVE_TOOL} ${CLANG_ARCHIVE}
- export PATH=$PWD/esp-clang/bin:$PATH
- popd
- rm -rf $PWD/${DIST_DIR}
- !reference [.get_clang_toolchain_build_scripts, script]
# build newlib overlay using ESP native (Linux) clang toolchain only
# it will be re-used for cross-buit toolchains (win and mac).
- NEWLIB_OVERLAY_DISTRO_PATH=$PWD/${DIST_DIR}
- mkdir -p ${NEWLIB_OVERLAY_DISTRO_PATH}
- BUILD_PATH=$PWD/${BUILD_DIR}
- mkdir -p ${BUILD_PATH}
- ./build-toolchain.sh --newlib-path=${NEWLIB_PATH} --xtensa-overlays-path=${XTENSA_OVERLAYS_PATH} ${BUILD_PATH} 2>&1 > ${BUILD_PATH}/build.log
- pushd ${BUILD_PATH}
- ${ARCHIVE_TOOL_NEWLIB} ${NEWLIB_OVERLAY_DISTRO_PATH}/esp-clang-newlib-overlay.${ARCHIVE_EXT_NEWLIB} esp-clang/
- popd
build_compiler-rt:
stage: build
tags: [ "amd64", "build" ]
needs:
# needs native toolchain with newlib
# newlib is necessary for building tests
- job: build_x86_64-linux-gnu
- job: build_newlib
artifacts:
paths:
- ${DIST_DIR}/
- ${BUILD_DIR}/build.log
when: always
expire_in: 1 day
variables:
PLATFORM_NAME: "${PLATFORM_NAME_LINUX}"
ARCHIVE_TOOL: "${ARCHIVE_TOOL_LINUX}"
UNARCHIVE_TOOL: "${UNARCHIVE_TOOL_LINUX}"
ARCHIVE_EXT: "${ARCHIVE_EXT_LINUX}"
script:
- LLVM_PROJECT_PATH=$PWD
# get ARCHIVE_NAME for Linux release.
- CLANG_ARCHIVE=$PWD/${DIST_DIR}/$(cat ${DIST_DIR}/dist_name_${PLATFORM_NAME_LINUX})
- NEWLIB_ARCHIVE=$PWD/${DIST_DIR}/esp-clang-newlib-overlay.${ARCHIVE_EXT_NEWLIB}
- mkdir -p ${DOWNLOADS_DIR}
- pushd ${DOWNLOADS_DIR}
# unpack clang
- ${UNARCHIVE_TOOL} ${CLANG_ARCHIVE}
# unpack newlib
- ${UNARCHIVE_TOOL_NEWLIB} ${NEWLIB_ARCHIVE}
# now Linux toolchain with newlib is in $PWD/esp-clang
- export PATH=$PWD/esp-clang/bin:$PATH
- popd
- rm -rf $PWD/${DIST_DIR}
- !reference [.get_clang_toolchain_build_scripts, script]
# build compiler-rt overlay using ESP native (Linux) clang toolchain only
# it will be re-used for cross-buit toolchains (win and mac).
- COMPILER_RT_OVERLAY_DISTRO_PATH=$PWD/${DIST_DIR}
- mkdir -p ${COMPILER_RT_OVERLAY_DISTRO_PATH}
- BUILD_PATH=$PWD/${BUILD_DIR}
- mkdir -p ${BUILD_PATH}
- ./build-toolchain.sh --llvm-path=${LLVM_PROJECT_PATH} --build-llvm=no --build-compiler-rt=yes ${BUILD_PATH} 2>&1 > ${BUILD_PATH}/build.log
- pushd ${BUILD_PATH}
- ${ARCHIVE_TOOL_COMPILER_RT} ${COMPILER_RT_OVERLAY_DISTRO_PATH}/esp-clang-compiler-rt-overlay.${ARCHIVE_EXT_COMPILER_RT} esp-clang/
- popd
.pack_template:
stage: pack
tags: [ "amd64", "build" ]
artifacts:
paths:
- ${DIST_DIR}/
when: always
expire_in: 3 day
script:
- *get_release_name
- export BUILD_PATH=$PWD/${BUILD_DIR}
- mkdir -p ${BUILD_PATH}
# unpack clang
- ${UNARCHIVE_TOOL} ${DIST_DIR}/${ARCHIVE_NAME} -C ${BUILD_PATH}
# unpack newlib
- ${UNARCHIVE_TOOL_NEWLIB} ${DIST_DIR}/esp-clang-newlib-overlay.${ARCHIVE_EXT_NEWLIB} -C ${BUILD_PATH}
# unpack compiler-rt
- ${UNARCHIVE_TOOL_COMPILER_RT} ${DIST_DIR}/esp-clang-compiler-rt-overlay.${ARCHIVE_EXT_COMPILER_RT} -C ${BUILD_PATH}
- rm -rf ${DIST_DIR}
- !reference [.get_clang_toolchain_build_scripts, script]
# strip binutils afer newlib is built
- STRIP_BINUTILS=YES ./build-toolchain.sh --host=${CONF_HOST} ${BUILD_PATH}
- DISTRO_DIR=$PWD/${DIST_DIR}
- pushd ${BUILD_PATH}
- *package_toolchain
- *package_libs
- popd
.pack_linux-gnu_template:
extends: .pack_template
variables:
ARCHIVE_TOOL: "${ARCHIVE_TOOL_LINUX}"
UNARCHIVE_TOOL: "${UNARCHIVE_TOOL_LINUX}"
ARCHIVE_EXT: "${ARCHIVE_EXT_LINUX}"
pack_x86_64-linux-gnu:
extends: .pack_linux-gnu_template
needs:
- job: build_x86_64-linux-gnu
- job: build_newlib
- job: build_compiler-rt
variables:
CONF_HOST: "x86_64-linux-gnu"
PLATFORM_NAME: "${PLATFORM_NAME_LINUX}"
pack_arm-linux-gnueabihf:
extends: .pack_linux-gnu_template
image: ${CROSS_ARM_IMAGE}
needs:
- job: build_arm-linux-gnueabihf
- job: build_newlib
- job: build_compiler-rt
variables:
CONF_HOST: "arm-linux-gnueabihf"
PLATFORM_NAME: "${PLATFORM_NAME_LINUX_ARMHF}"
pack_aarch64-linux-gnu:
extends: .pack_linux-gnu_template
image: ${CROSS_ARM_IMAGE}
needs:
- job: build_aarch64-linux-gnu
- job: build_newlib
- job: build_compiler-rt
variables:
CONF_HOST: "aarch64-linux-gnu"
PLATFORM_NAME: "${PLATFORM_NAME_LINUX_ARM64}"
pack_x86_64-w64-mingw32:
extends: .pack_template
needs:
- job: build_x86_64-w64-mingw32
- job: build_newlib
- job: build_compiler-rt
variables:
CONF_HOST: "x86_64-w64-mingw32"
PLATFORM_NAME: "${PLATFORM_NAME_WIN}"
ARCHIVE_TOOL: "${PACK_ARCHIVE_TOOL_WIN}"
UNARCHIVE_TOOL: "${PACK_UNARCHIVE_TOOL_WIN}"
ARCHIVE_EXT: "${PACK_ARCHIVE_EXT_WIN}"
LIBS_PACK_EXTRA_PATHS: esp-clang/bin/lib{c++,clang,LLVM,unwind}*
.pack_apple-darwin_template:
extends: .pack_template
variables:
ARCHIVE_TOOL: "${ARCHIVE_TOOL_MACOS}"
UNARCHIVE_TOOL: "${UNARCHIVE_TOOL_MACOS}"
ARCHIVE_EXT: "${ARCHIVE_EXT_MACOS}"
pack_x86_64-apple-darwin:
extends: .pack_apple-darwin_template
needs:
- job: build_x86_64-apple-darwin
- job: build_newlib
- job: build_compiler-rt
variables:
CONF_HOST: "x86_64-apple-darwin21.1"
PLATFORM_NAME: "${PLATFORM_NAME_MACOS}"
pack_aarch64-apple-darwin:
extends: .pack_apple-darwin_template
needs:
- job: build_aarch64-apple-darwin
- job: build_newlib
- job: build_compiler-rt
variables:
CONF_HOST: "aarch64-apple-darwin21.1"
PLATFORM_NAME: "${PLATFORM_NAME_MACOS_ARM64}"
test_x86_64-linux-gnu:
stage: test
tags: [ "amd64", "build" ]
needs:
- job: pack_x86_64-linux-gnu
artifacts:
paths:
- ${BUILD_DIR}/tests.log
when: always
expire_in: 1 day
variables:
PLATFORM_NAME: "${PLATFORM_NAME_LINUX}"
ARCHIVE_TOOL: "${ARCHIVE_TOOL_LINUX}"
UNARCHIVE_TOOL: "${UNARCHIVE_TOOL_LINUX}"
ARCHIVE_EXT: "${ARCHIVE_EXT_LINUX}"
script:
- BUILD_PATH=$PWD/$BUILD_DIR
- mkdir -p ${BUILD_PATH}
- *get_release_name
- ${UNARCHIVE_TOOL} ${DIST_DIR}/${ARCHIVE_NAME}
# getting testsuite
- git clone -b ${LLVM_GCC_TESTSUITE_REF} --depth 1 $GITLAB_SSH_SERVER/idf/${LLVM_TESTSUITE_REPO}.git
# preparing testsuite
- export PATH=${PWD}/esp-clang/bin:$PATH
- cd ${LLVM_TESTSUITE_REPO}
# qemu
- ./qemu_esp32_install.sh
# run testsuite for esp32
- ./run_esp32_tests.sh 2>&1 > ${BUILD_PATH}/tests.log
sign_pack_x86_64-apple-darwin:
stage: macos_codesign
when: on_success
resource_group: macos_codesign
tags: [ "darwin", "codesign" ]
# list all jobs that produces macos distros
needs:
- job: pack_x86_64-apple-darwin
artifacts:
paths:
- ${DIST_DIR}
variables:
# directory with distro archives
DIST_ART_DIR: ${DIST_DIR}
# command to unarchive distro
ARCHIVE_TOOL: ${ARCHIVE_TOOL_MACOS}
# command to unarchive distro
UNARCHIVE_TOOL: ${UNARCHIVE_TOOL_MACOS}
# 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_aarch64-apple-darwin:
stage: macos_codesign
when: on_success
resource_group: macos_codesign
tags: [ "darwin", "codesign" ]
# list all jobs that produces macos distros
needs:
- job: pack_aarch64-apple-darwin
artifacts:
paths:
- ${DIST_DIR}
variables:
# directory with distro archives
DIST_ART_DIR: ${DIST_DIR}
# command to unarchive distro
ARCHIVE_TOOL: ${ARCHIVE_TOOL_MACOS}
# command to unarchive distro
UNARCHIVE_TOOL: ${UNARCHIVE_TOOL_MACOS}
# 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
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: pack_x86_64-linux-gnu
before_script:
- !reference [.use_ci_tools, script]
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"
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}"
needs:
- job: pack_x86_64-linux-gnu
- job: pack_arm-linux-gnueabihf
- job: pack_aarch64-linux-gnu
- job: pack_x86_64-w64-mingw32
- job: sign_pack_x86_64-apple-darwin
- job: sign_aarch64-apple-darwin
before_script: []
script:
- ls -l dist*/
- 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; }
# List of archives
- FILES=$(find ${DIST_DIR} -name dist_name_\* -exec cat {} \+)
- cd ${DIST_DIR}
- ls -l $FILES
# Upload archives
- for n in ${FILES}; do hub release edit -m "" -a "${n}" "${TAG}"; done