From dd53d08802f04f103ee0184447f992f7df4b7b1c Mon Sep 17 00:00:00 2001 From: Paul Date: Sat, 26 Oct 2019 11:57:52 +0200 Subject: [PATCH] updates to support automated CI builds --- platformio.ini | 43 ++++++++++++++++++++++++------------------- scripts/build.sh | 3 +++ scripts/rename_fw.py | 4 ++-- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/platformio.ini b/platformio.ini index 2d4f6c6c4..b818c6f33 100644 --- a/platformio.ini +++ b/platformio.ini @@ -3,8 +3,7 @@ ; [platformio] -default_envs = release -;default_envs = debug +default_envs = debug [common] ; custom build options are: @@ -12,17 +11,12 @@ default_envs = release ; -DTESTS ; -DCRASH ; -DFORCE_SERIAL -; -DLOGICANALYZER custom_flags = ;general_flags = -DNO_GLOBAL_EEPROM -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH -DBEARSSL_SSL_BASIC general_flags = -DNO_GLOBAL_EEPROM [env] -; board = esp12e -; board = nodemcu -; board = nodemcu2 -board = d1_mini framework = arduino platform = espressif8266 lib_deps = @@ -47,20 +41,31 @@ monitor_speed = 115200 upload_protocol = espota upload_port = ems-esp.local +# Special build for CI test +[env:travis] +board = esp12e +build_flags = ${common.general_flags} + +[env:esp12e] +board = esp12e +build_flags = ${common.general_flags} + +[env:d1_mini] +board = d1_mini +build_flags = ${common.general_flags} + +[env:nodemcuv2] +board = nodemcuv2 +build_flags = ${common.general_flags} + +[env:nodemcu] +board = nodemcu +build_flags = ${common.general_flags} + [env:debug] +board = d1_mini build_type = debug -build_flags = ${common.general_flags} ${common.custom_flags} -DTESTS +build_flags = ${common.general_flags} ${common.custom_flags} extra_scripts = pre:scripts/rename_fw.py pre:scripts/buildweb.py - -[env:release] -build_flags = ${common.general_flags} ${common.custom_flags} -extra_scripts = - pre:scripts/rename_fw.py - pre:scripts/buildweb.py - -[env:checkcode] -build_type = debug -build_flags = ${common.general_flags} -Wall -extra_scripts = scripts/checkcode.py diff --git a/scripts/build.sh b/scripts/build.sh index 392b01ac3..d07a51e09 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -135,7 +135,10 @@ if [ ${par_thread} -ge ${par_total_threads} ]; then exit fi +# travis platformio target is used for nightly Test travis=$(list_envs | grep travis | sort) + +# get all taregts, excluding travis and debug available=$(list_envs | grep -Ev -- 'travis|debug' | sort) export PLATFORMIO_BUILD_FLAGS="${PLATFORMIO_BUILD_FLAGS}" diff --git a/scripts/rename_fw.py b/scripts/rename_fw.py index 3e0e763fa..594b6d4d4 100644 --- a/scripts/rename_fw.py +++ b/scripts/rename_fw.py @@ -40,7 +40,7 @@ env.AddPreAction("buildprog", build_web) # build filename, replacing . with _ for the version #env.Replace(PROGNAME="firmware_%s" % branch + "_" + app_version.replace(".", "_")) -env.Replace(PROGNAME=app_name + "-" + app_version.replace(".", "_") + "-" + board + "-" + branch) -#env.Replace(PROGNAME=app_name + "-" + app_version) +#env.Replace(PROGNAME=app_name + "-" + app_version.replace(".", "_") + "-" + board + "-" + branch) +env.Replace(PROGNAME=app_name + "-" + app_version.replace(".", "_") + "-" + board)