mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Build examples out-of-tree as part of CI process
This commit is contained in:
parent
8016e862e0
commit
de76546227
@ -69,6 +69,23 @@ build_ssc:
|
|||||||
- chmod +x gen_misc_ng.sh
|
- chmod +x gen_misc_ng.sh
|
||||||
- ./gen_misc_ng.sh
|
- ./gen_misc_ng.sh
|
||||||
|
|
||||||
|
build_examples:
|
||||||
|
<<: *build_template
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- build_examples/*/*/build/*.bin
|
||||||
|
- build_examples/*/*/build/*.elf
|
||||||
|
- build_examples/*/*/build/*.map
|
||||||
|
- build_examples/*/*/build/bootloader/*.bin
|
||||||
|
expire_in: 6 mos
|
||||||
|
|
||||||
|
script:
|
||||||
|
# it's not possible to build 100% out-of-tree and have the "artifacts"
|
||||||
|
# mechanism work, but this is the next best thing
|
||||||
|
- mkdir build_examples
|
||||||
|
- cd build_examples
|
||||||
|
- ${IDF_PATH}/make/build_examples.sh
|
||||||
|
|
||||||
test_nvs_on_host:
|
test_nvs_on_host:
|
||||||
stage: test
|
stage: test
|
||||||
image: espressif/esp32-ci-env
|
image: espressif/esp32-ci-env
|
||||||
|
@ -13,3 +13,4 @@ sdkconfig: sdkconfig.defaults
|
|||||||
$(Q) cp $< $@
|
$(Q) cp $< $@
|
||||||
|
|
||||||
menuconfig: sdkconfig
|
menuconfig: sdkconfig
|
||||||
|
defconfig: sdkconfig
|
||||||
|
31
make/build_examples.sh
Executable file
31
make/build_examples.sh
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Build all examples from the examples directory, out of tree to
|
||||||
|
# ensure they can run when copied to a new directory.
|
||||||
|
#
|
||||||
|
# Runs as part of CI process.
|
||||||
|
#
|
||||||
|
# Assumes CWD is an out-of-tree build directory, and will copy examples to individual subdirectories, one by one.
|
||||||
|
#
|
||||||
|
[ -z ${IDF_PATH} ] && echo "IDF_PATH is not set" && exit 1
|
||||||
|
|
||||||
|
EXAMPLE_NUM=1
|
||||||
|
RESULT=0
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
for example in ${IDF_PATH}/examples/*; do
|
||||||
|
[ -f ${example}/Makefile ] || continue
|
||||||
|
echo "Building ${example} as ${EXAMPLE_NUM}..."
|
||||||
|
mkdir ${EXAMPLE_NUM}
|
||||||
|
cp -r ${example} ${EXAMPLE_NUM}
|
||||||
|
pushd ${EXAMPLE_NUM}/`basename ${example}`
|
||||||
|
# can't do "make defconfig all" as this will trip menuconfig
|
||||||
|
# sometimes
|
||||||
|
make defconfig && make || RESULT=$?
|
||||||
|
popd
|
||||||
|
EXAMPLE_NUM=$(( $EXAMPLE_NUM + 1 ))
|
||||||
|
done
|
||||||
|
|
||||||
|
exit $RESULT
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user