add travis folding commands

This commit is contained in:
ThePhD 2018-01-08 12:38:47 -05:00
parent a98e0633ce
commit d45daccc8a
3 changed files with 54 additions and 43 deletions

View File

@ -34,9 +34,8 @@ before_install:
script: script:
- export SOL2_DIR=${TRAVIS_BUILD_DIR} - 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 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) - sudo docker rmi $(sudo docker image ls -q)
matrix: matrix:

View File

@ -63,4 +63,4 @@ RUN ["/usr/bin/env", "zsh", "-e", "/root/sol2-scripts/preparation.linux.sh"]
# gets "saved" in... # gets "saved" in...
# it only runs the last CMD/ENTRYPOINT as the default behavior: # it only runs the last CMD/ENTRYPOINT as the default behavior:
# multiple CMDs will not be respected # 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"]

View File

@ -22,55 +22,67 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # 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. # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
if [ -z "${SOL2_DIR}"] echo -en "travis_fold:start:build_preparation.1\r"
then if [ -z "${SOL2_DIR}"]
if [ ${CI} = true ]
then then
export SOL2_DIR=~/sol2 if [ ${CI} = true ]
else then
export SOL2_DIR=../.. export SOL2_DIR=~/sol2
else
export SOL2_DIR=../..
fi
fi fi
fi
if [ -z "${LUA_VERSION}"] if [ -z "${LUA_VERSION}"]
then then
export LUA_VERSION=5.3.4 export LUA_VERSION=5.3.4
fi fi
mkdir -p build-sol2 mkdir -p build-sol2
cd build-sol2 cd build-sol2
build_dir=$(pwd) build_dir=$(pwd)
if [ -f "sol2.compiler.vars" ] if [ -f "sol2.compiler.vars" ]
then then
source ./sol2.compiler.vars source ./sol2.compiler.vars
fi fi
# This script runs the actual project # This script runs the actual project
mkdir -p Debug Release 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 # show the tool and compiler versions we're using
echo "=== Compiler and tool variables ===" echo -en "travis_fold:start:build_preparation.2\r"
ninja --version echo "=== Compiler and tool variables ==="
cmake --version ninja --version
${CC} --version cmake --version
${CXX} --version ${CC} --version
echo build_type_cc : "${build_type_cc}" ${CXX} --version
echo build_type_cxx: "${build_type_cxx}" 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 echo "travis_fold:start:build.release\r"
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 cd Release
cmake --build . --config Debug 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
ctest --build-config Debug --output-on-failure cmake --build . --config Release
cd .. echo -en "travis_fold:end:build.release\r"
echo -en "travis_fold:start:test.release\r"
cd Release ctest --build-config Release --output-on-failure
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 cd ..
cmake --build . --config Release echo -en "travis_fold:end:test.release\r"
ctest --build-config Release --output-on-failure
cd ..