Don't source steps/script.sh.

Travis runs all commands in .travis.yml in its own wrapper script, so by sourcing steps/script.sh and then using exit explicitly, it resulted in the entire travis wrapper immediately terminating.  With steps/script.sh no longer sourced, using exit works as expected again, and only exits steps/script.sh rather than quitting everything. Another solution, should sourcing steps/script.sh become necessary, is to use return instead of exit.

With that addressed, it's then possible to re-add printing the ccache statistics after the build ends while also making sure that the script exits with the return code of the xcodebuild/cmake+make command rather than the return code of the ccache statistics commands.
This commit is contained in:
pentarctagon 2018-03-03 16:51:19 -06:00 committed by Pentarctagon
parent 18ee8b767c
commit abf93216ac
3 changed files with 13 additions and 2 deletions

View file

@ -42,7 +42,7 @@ install:
- . ./utils/travis/steps/install.sh
script:
- . ./utils/travis/steps/script.sh
- ./utils/travis/steps/script.sh
notifications:
email: false

View file

@ -54,11 +54,15 @@ else
echo "compiler_check = content" >> $HOME/.ccache/ccache.conf
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GAME=true -DENABLE_SERVER=true -DENABLE_CAMPAIGN_SERVER=true -DENABLE_TESTS=true -DENABLE_NLS=false -DEXTRA_FLAGS_CONFIG="-pipe" -DEXTRA_FLAGS_RELEASE="$EXTRA_FLAGS_RELEASE" -DENABLE_STRICT_COMPILATION="$STRICT" -DENABLE_LTO=false -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache && make VERBOSE=1 -j2
BUILD_RET=$?
ccache -s
ccache -z
else
scons wesnoth wesnothd campaignd boost_unit_tests build=release ctool=$CC cxxtool=$CXX --debug=time extra_flags_config="-pipe" extra_flags_release="$EXTRA_FLAGS_RELEASE" strict="$STRICT" cxx_std=$CXXSTD nls=false jobs=2 enable_lto=false
BUILD_RET=$?
fi
BUILD_RET=$?
if [ $BUILD_RET != 0 ]; then
exit $BUILD_RET
fi

View file

@ -12,6 +12,13 @@ if [ "$TRAVIS_OS_NAME" = "osx" ]; then
export CCACHE_COMPILERCHECK=content
xcodebuild -project Wesnoth.xcodeproj -target Wesnoth
BUILD_RET=$?
ccache -s
ccache -z
exit $BUILD_RET
else
ln -s build-cache/ build
./utils/travis/check_utf8.sh