Skip to content

Commit bf70e6e

Browse files
Daniel Newtonjgriffiths
andcommitted
build: initial re-work of the ci pipeline
Split up and rename the various build stages to reflect what they do and disambiguate e.g. building from flashing/testing. Use consistent naming for jobs/config then leverage it to reduce boilerplate repetition. Generate the CI build config from the developer build config, then remove the developer build-only CI step. Update the v2.0 developer build config to use JTAG so flashing between it and CI builds doesn't require physically switching to JTAG mode. Collate the build artifacts into a single download for release, pre-sign the dev images for release automatically. Ensure sequential access to devices using flock to prevent flaky failures. Remove the CI use of ttgo as a substitute v2.0 device. Co-authored-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
1 parent 1c07625 commit bf70e6e

39 files changed

+514
-1203
lines changed

.gitlab-ci.yml

Lines changed: 35 additions & 541 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ cd /jade
192192
rm -fr sdkconfig
193193
cp configs/sdkconfig_qemu.defaults sdkconfig.defaults
194194
idf.py all
195+
cp components/esp32_bsdiff/bsdiff.* build/
195196
apt-get update -qq && apt-get install virtualenv -yqq
196197
virtualenv -p python3 ./venv3
197198
source ./venv3/bin/activate

ci_flash.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,20 @@ if [[ -z ${JADESERIALPORT} ]]; then
1212
fi
1313

1414
TARGET_CHIP=${1:-esp32}
15+
BUILD_DIR=${2:-build}
1516

1617
if [ "$TARGET_CHIP" = "esp32" ]; then
1718
python ${IDF_PATH}/components/esptool_py/esptool/esptool.py --chip ${TARGET_CHIP} --port ${JADESERIALPORT} --baud 2000000 --before default_reset erase_flash
18-
python ${IDF_PATH}/components/esptool_py/esptool/esptool.py --chip ${TARGET_CHIP} --port ${JADESERIALPORT} --baud 2000000 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0xE000 build/ota_data_initial.bin 0x1000 build/bootloader/bootloader.bin 0x10000 build/jade.bin 0x9000 build/partition_table/partition-table.bin
19+
python ${IDF_PATH}/components/esptool_py/esptool/esptool.py --chip ${TARGET_CHIP} --port ${JADESERIALPORT} --baud 2000000 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0xE000 ${BUILD_DIR}/ota_data_initial.bin 0x1000 ${BUILD_DIR}/bootloader/bootloader.bin 0x10000 ${BUILD_DIR}/jade.bin 0x9000 ${BUILD_DIR}/partition_table/partition-table.bin
1920
else
2021
python ${IDF_PATH}/components/esptool_py/esptool/esptool.py --chip ${TARGET_CHIP} --port ${JADESERIALPORT} --baud 460800 --before default_reset erase_flash
21-
python ${IDF_PATH}/components/esptool_py/esptool/esptool.py --chip ${TARGET_CHIP} --port ${JADESERIALPORT} --baud 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size 8MB 0x0 build/bootloader/bootloader.bin 0x20000 build/jade.bin 0x8000 build/partition_table/partition-table.bin 0x1a000 build/ota_data_initial.bin
22+
python ${IDF_PATH}/components/esptool_py/esptool/esptool.py --chip ${TARGET_CHIP} --port ${JADESERIALPORT} --baud 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size 8MB 0x0 ${BUILD_DIR}/bootloader/bootloader.bin 0x20000 ${BUILD_DIR}/jade.bin 0x8000 ${BUILD_DIR}/partition_table/partition-table.bin 0x1a000 ${BUILD_DIR}/ota_data_initial.bin
2223
fi
2324

2425
sleep 1
2526

2627

27-
if fgrep -qs "CONFIG_APPTRACE_GCOV_ENABLE=y" build/sdkconfig sdkconfig; then
28+
if fgrep -qs "CONFIG_APPTRACE_GCOV_ENABLE=y" ${BUILD_DIR}/sdkconfig sdkconfig; then
2829
cleanup() {
2930
killall -9 openocd || true
3031
}
@@ -60,7 +61,7 @@ source ~/venv3/bin/activate
6061
pip install --require-hashes -r requirements.txt
6162

6263
# NOTE: tools/fwprep.py should have run in the build step and produced the compressed firmware file
63-
FW_FULL=$(ls build/*_fw.bin)
64+
FW_FULL=$(ls ${BUILD_DIR}/*_fw.bin)
6465
python jade_ota.py --push-mnemonic --log=INFO --serialport=${JADESERIALPORT} --fwfile=${FW_FULL}
6566

6667
sleep 5
@@ -69,7 +70,7 @@ python -c "from jadepy import JadeAPI; jade = JadeAPI.create_serial(device=\"${J
6970
python test_jade.py --log=INFO --serialport=${JADESERIALPORT}
7071

7172
# check if gcov is enabled and run collection tool
72-
if fgrep -qs "CONFIG_APPTRACE_GCOV_ENABLE=y" build/sdkconfig sdkconfig; then
73+
if fgrep -qs "CONFIG_APPTRACE_GCOV_ENABLE=y" ${BUILD_DIR}/sdkconfig sdkconfig; then
7374
./tools/gcov/generate_report.sh
7475
killall -9 openocd || true
7576
fi
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

configs/sdkconfig_display_ttgo_tdisplays3_ci.defaults

Lines changed: 0 additions & 88 deletions
This file was deleted.

0 commit comments

Comments
 (0)