diff --git a/.travis.yml b/.travis.yml index 7537533a..7d34f845 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,8 @@ script: - cd bin/ - file_name_integer="nodemcu_integer_${TRAVIS_TAG}.bin" - srec_cat -output ${file_name_integer} -binary 0x00000.bin -binary -fill 0xff 0x00000 0x10000 0x10000.bin -binary -offset 0x10000 +# http://docs.travis-ci.com/user/environment-variables/#Convenience-Variables +- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash "$TRAVIS_BUILD_DIR"/tools/pr-build.sh; fi deploy: provider: releases api_key: diff --git a/tools/pr-build.sh b/tools/pr-build.sh new file mode 100644 index 00000000..c7b310f3 --- /dev/null +++ b/tools/pr-build.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +set -e + +echo "Running PR build (all modules, SSL disabled)" +( +cd "$TRAVIS_BUILD_DIR"/app/include || exit +# uncomment disabled modules e.g. '//#define LUA_USE_MODULES_UCG' -> '#define LUA_USE_MODULES_UCG' +sed -E -i.bak 's@(//.*)(#define *LUA_USE_MODULES_.*)@\2@g' user_modules.h +cat user_modules.h + +# disable SSL +sed -i.bak 's@#define CLIENT_SSL_ENABLE@//#define CLIENT_SSL_ENABLE@' user_config.h +cat user_config.h + +# change to "root" directory no matter where the script was started from +cd "$TRAVIS_BUILD_DIR" || exit +make clean +make +)