From d45daccc8a72186d3c5f51f14e03d824e58c94a0 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Mon, 8 Jan 2018 12:38:47 -0500 Subject: [PATCH] add travis folding commands --- .travis.yml | 3 +- Dockerfile | 2 +- scripts/run.linux.sh | 92 +++++++++++++++++++++++++------------------- 3 files changed, 54 insertions(+), 43 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2260b5e6..7dad9b94 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,9 +34,8 @@ before_install: script: - export SOL2_DIR=${TRAVIS_BUILD_DIR} -- sudo docker image pull ThePhD/sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} +- sudo docker image pull thephd/sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} - sudo docker run --rm --interactive --tty --name "sol2.test" -v "${SOL2_DIR}:/root/sol2" --env "CI=${CI}" --env "LUA_VERSION=${LUA_VERSION}" --env "GCC_VERSION=${GCC_VERSION}" --env "LLVM_VERSION=${LLVM_VERSION}" thephd/sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} -- sudo docker rm $(sudo docker ps -a -q) - sudo docker rmi $(sudo docker image ls -q) matrix: diff --git a/Dockerfile b/Dockerfile index 303903b2..d2252b0f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -63,4 +63,4 @@ RUN ["/usr/bin/env", "zsh", "-e", "/root/sol2-scripts/preparation.linux.sh"] # gets "saved" in... # it only runs the last CMD/ENTRYPOINT as the default behavior: # multiple CMDs will not be respected -ENTRYPOINT ["/usr/bin/env", "zsh", "-x", "-e", "/root/sol2-scripts/run.linux.sh"] +ENTRYPOINT ["/usr/bin/env", "zsh", "-e", "/root/sol2-scripts/run.linux.sh"] diff --git a/scripts/run.linux.sh b/scripts/run.linux.sh index 8b4de755..8b4b4413 100644 --- a/scripts/run.linux.sh +++ b/scripts/run.linux.sh @@ -22,55 +22,67 @@ # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -if [ -z "${SOL2_DIR}"] -then - if [ ${CI} = true ] +echo -en "travis_fold:start:build_preparation.1\r" + if [ -z "${SOL2_DIR}"] then - export SOL2_DIR=~/sol2 - else - export SOL2_DIR=../.. + if [ ${CI} = true ] + then + export SOL2_DIR=~/sol2 + else + export SOL2_DIR=../.. + fi fi -fi -if [ -z "${LUA_VERSION}"] -then - export LUA_VERSION=5.3.4 -fi + if [ -z "${LUA_VERSION}"] + then + export LUA_VERSION=5.3.4 + fi -mkdir -p build-sol2 -cd build-sol2 + mkdir -p build-sol2 + cd build-sol2 -build_dir=$(pwd) + build_dir=$(pwd) -if [ -f "sol2.compiler.vars" ] -then - source ./sol2.compiler.vars -fi + if [ -f "sol2.compiler.vars" ] + then + source ./sol2.compiler.vars + fi -# This script runs the actual project -mkdir -p Debug Release + # This script runs the actual project + mkdir -p Debug Release + + export build_type_cc=-DCMAKE_C_COMPILER\=${CC} + export build_type_cxx=-DCMAKE_CXX_COMPILER\=${CXX} +echo -en "travis_fold:end:build_preparation.1\r" -export build_type_cc=-DCMAKE_C_COMPILER\=${CC} -export build_type_cxx=-DCMAKE_CXX_COMPILER\=${CXX} # show the tool and compiler versions we're using -echo "=== Compiler and tool variables ===" -ninja --version -cmake --version -${CC} --version -${CXX} --version -echo build_type_cc : "${build_type_cc}" -echo build_type_cxx: "${build_type_cxx}" +echo -en "travis_fold:start:build_preparation.2\r" + echo "=== Compiler and tool variables ===" + ninja --version + cmake --version + ${CC} --version + ${CXX} --version + echo build_type_cc : "${build_type_cc}" + echo build_type_cxx: "${build_type_cxx}" +echo -en "travis_fold:end:build_preparation.2\r" +echo -en "travis_fold:start:build.debug\r" + cd Debug + cmake ${SOL2_DIR} -G Ninja -DCMAKE_BUILD_TYPE=Debug ${build_type_cc} ${build_type_cxx} -DLUA_VERSION="${LUA_VERSION}" -DBUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DTESTS=ON -DEXAMPLES=ON -DSINGLE=ON -DTESTS_EXAMPLES=ON -DEXAMPLES_SINGLE=ON -DTESTS_SINGLE=ON -DCI=ON + cmake --build . --config Debug +echo -en "travis_fold:end:build.debug\r" +echo -en "travis_fold:start:test.debug\r" + ctest --build-config Debug --output-on-failure + cd .. +echo -en "travis_fold:end:test.debug\r" -cd Debug -cmake ${SOL2_DIR} -G Ninja -DCMAKE_BUILD_TYPE=Debug ${build_type_cc} ${build_type_cxx} -DLUA_VERSION="${LUA_VERSION}" -DBUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DTESTS=ON -DEXAMPLES=ON -DSINGLE=ON -DTESTS_EXAMPLES=ON -DEXAMPLES_SINGLE=ON -DTESTS_SINGLE=ON -DCI=ON -cmake --build . --config Debug -ctest --build-config Debug --output-on-failure -cd .. - -cd Release -cmake ${SOL2_DIR} -G Ninja -DCMAKE_BUILD_TYPE=Release ${build_type_cc} ${build_type_cxx} -DLUA_VERSION="${LUA_VERSION}" -DBUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DTESTS=ON -DEXAMPLES=ON -DSINGLE=ON -DTESTS_EXAMPLES=ON -DEXAMPLES_SINGLE=ON -DTESTS_SINGLE=ON -DCI=ON -cmake --build . --config Release -ctest --build-config Release --output-on-failure -cd .. +echo "travis_fold:start:build.release\r" + cd Release + cmake ${SOL2_DIR} -G Ninja -DCMAKE_BUILD_TYPE=Release ${build_type_cc} ${build_type_cxx} -DLUA_VERSION="${LUA_VERSION}" -DBUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DTESTS=ON -DEXAMPLES=ON -DSINGLE=ON -DTESTS_EXAMPLES=ON -DEXAMPLES_SINGLE=ON -DTESTS_SINGLE=ON -DCI=ON + cmake --build . --config Release +echo -en "travis_fold:end:build.release\r" +echo -en "travis_fold:start:test.release\r" + ctest --build-config Release --output-on-failure + cd .. +echo -en "travis_fold:end:test.release\r"