diff --git a/.travis.yml b/.travis.yml index 6e69a80c..6a808926 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,20 @@ +#os: +# - windows +# - linux + language: cpp + +matrix: + include: + - os: linux + env: + - OS="$TRAVIS_OS_NAME" + - LUACC=./luac.cross + - os: windows + env: + - MSBUILD_PATH="c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin" + - OS="$TRAVIS_OS_NAME" + - LUACC=msvc/luac-cross/x64/Debug/luac.cross.exe addons: apt: packages: @@ -8,16 +24,12 @@ cache: - directories: - cache script: -- export BUILD_DATE=$(date +%Y%m%d) -- make EXTRA_CCFLAGS="-DBUILD_DATE='\"'$BUILD_DATE'\"'" all -- cd bin/ -- file_name_float="nodemcu_float_${TRAVIS_TAG}.bin" -- srec_cat -output ${file_name_float} -binary 0x00000.bin -binary -fill 0xff 0x00000 0x10000 0x10000.bin -binary -offset 0x10000 -- cd ../ -- make clean -- make EXTRA_CCFLAGS="-DLUA_NUMBER_INTEGRAL -DBUILD_DATE='\"'$BUILD_DATE'\"'" -- 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 +- echo OS is $OS $TRAVIS_OS_NAME # 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 +- if [ "$OS" = "linux" ]; then bash "$TRAVIS_BUILD_DIR"/tools/travis/ci-build-linux.sh; fi +- if [ "$OS" = "windows" ]; then bash "$TRAVIS_BUILD_DIR"/tools/travis/ci-build-windows-ms.sh; fi +- if [ "$OS" = "linux" -a "$TRAVIS_PULL_REQUEST" != "false" ]; then bash "$TRAVIS_BUILD_DIR"/tools/travis/pr-build.sh; fi +- cd "$TRAVIS_BUILD_DIR" +- LUA_FILES=`find lua_modules lua_examples -iname "*.lua"` +- echo checking $LUA_FILES +- $LUACC -p $LUA_FILES diff --git a/tools/travis/ci-build-linux.sh b/tools/travis/ci-build-linux.sh new file mode 100644 index 00000000..cb728eed --- /dev/null +++ b/tools/travis/ci-build-linux.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +set -e + +echo "Running ci build for linux" +( + cd "$TRAVIS_BUILD_DIR" || exit + export BUILD_DATE=$(date +%Y%m%d) + + # build integer firmware + make EXTRA_CCFLAGS="-DLUA_NUMBER_INTEGRAL -DBUILD_DATE='\"'$BUILD_DATE'\"'" + cd bin/ || exit + 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 + cd ../ || exit + + # build float firmware + make clean + make EXTRA_CCFLAGS="-DBUILD_DATE='\"'$BUILD_DATE'\"'" all + cd bin/ || exit + file_name_float="nodemcu_float_${TRAVIS_TAG}.bin" + srec_cat -output ${file_name_float} -binary 0x00000.bin -binary -fill 0xff 0x00000 0x10000 0x10000.bin -binary -offset 0x10000 +) diff --git a/tools/travis/ci-build-windows-ms.sh b/tools/travis/ci-build-windows-ms.sh new file mode 100644 index 00000000..904107ab --- /dev/null +++ b/tools/travis/ci-build-windows-ms.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +echo "Running ci build for windows msbuild (supports only hosttools)" +( + cd "$TRAVIS_BUILD_DIR"/msvc || exit + export PATH=$MSBUILD_PATH:$PATH + msbuild.exe hosttools.sln +) + diff --git a/tools/pr-build.sh b/tools/travis/pr-build.sh similarity index 90% rename from tools/pr-build.sh rename to tools/travis/pr-build.sh index 0670c741..f7866f71 100644 --- a/tools/pr-build.sh +++ b/tools/travis/pr-build.sh @@ -29,8 +29,4 @@ cd "$TRAVIS_BUILD_DIR"/ld || exit cd "$TRAVIS_BUILD_DIR" || exit make clean make - -LUA_FILES=`find lua_modules lua_examples -iname "*.lua"` -echo checking $LUA_FILES -./luac.cross -p $LUA_FILES )