From 9842a8ef830d52854b514170ef3169b4883f4bd4 Mon Sep 17 00:00:00 2001 From: Gregor Hartmann Date: Tue, 9 Apr 2019 15:37:47 +0200 Subject: [PATCH] Add building luac.cross to travis ci builds (#2682) Add building luac.cross to travis ci builds --- .travis.yml | 36 +++++++++++++++++++---------- tools/travis/ci-build-linux.sh | 23 ++++++++++++++++++ tools/travis/ci-build-windows-ms.sh | 11 +++++++++ tools/{ => travis}/pr-build.sh | 4 ---- 4 files changed, 58 insertions(+), 16 deletions(-) create mode 100644 tools/travis/ci-build-linux.sh create mode 100644 tools/travis/ci-build-windows-ms.sh rename tools/{ => travis}/pr-build.sh (90%) 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 )