Move the logic for the install and script steps into their own files.
Also merges the before_install and install steps.
This commit is contained in:
parent
4bccc19ebc
commit
ea06cdc63a
3 changed files with 60 additions and 55 deletions
57
.travis.yml
57
.travis.yml
|
@ -38,64 +38,11 @@ matrix:
|
|||
osx_image: xcode9.2
|
||||
env: TOOL=xcodebuild
|
||||
|
||||
before_install:
|
||||
- export EXTRA_FLAGS_RELEASE=""
|
||||
- export WML_TESTS=true
|
||||
- export PLAY_TEST=true
|
||||
- export MP_TEST=true
|
||||
- export WML_TEST_TIME=15
|
||||
- export BOOST_TEST=true
|
||||
|
||||
- if [ "$OPT" = "-O0" ]; then
|
||||
export EXTRA_FLAGS_RELEASE="-O0";
|
||||
export PLAY_TEST=false;
|
||||
export MP_TEST=false;
|
||||
export WML_TEST_TIME=20;
|
||||
fi
|
||||
|
||||
install:
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
if [ "$TOOL" = "xcodebuild" ]; then
|
||||
brew install ccache;
|
||||
travis_wait ./projectfiles/Xcode/Fix_Xcode_Dependencies;
|
||||
else
|
||||
travis_wait ./utils/travis/install_deps.sh;
|
||||
export CXXFLAGS="-I/usr/local/opt/openssl/include $CFLAGS";
|
||||
export LDFLAGS="-L/usr/local/opt/openssl/lib $LDFLAGS";
|
||||
fi
|
||||
else
|
||||
docker build -t wesnoth-repo:16.04 -f docker/Dockerfile-travis .;
|
||||
fi
|
||||
- . ./utils/travis/steps/install.sh
|
||||
|
||||
script:
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
if [ "$TOOL" = "xcodebuild" ]; then
|
||||
export PATH="/usr/local/opt/ccache/libexec:$PWD/utils/travis:$PATH";
|
||||
export CC=ccache-clang;
|
||||
export CXX=ccache-clang++;
|
||||
|
||||
cd ./projectfiles/Xcode;
|
||||
|
||||
export CCACHE_MAXSIZE=2G;
|
||||
export CCACHE_COMPILERCHECK=content;
|
||||
|
||||
xcodebuild -project Wesnoth.xcodeproj -target Wesnoth;
|
||||
|
||||
ccache -s;
|
||||
ccache -z;
|
||||
else
|
||||
ln -s build-cache/ build;
|
||||
./utils/travis/check_utf8.sh;
|
||||
./utils/travis/utf8_bom_dog.sh;
|
||||
"$CXX" --version;
|
||||
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=true cxx_std="$CXXSTD" nls="$NLS" jobs=2 enable_lto=false;
|
||||
fi
|
||||
else
|
||||
export DISPLAY=:99.0;
|
||||
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1024x768x24;
|
||||
|
||||
docker run -v "$PWD"/build-cache:/home/wesnoth-travis/build -v "$HOME"/.ccache:/root/.ccache wesnoth-repo:16.04 bash -c './utils/travis/docker_run.sh "$@"' bash "$NLS" "$TOOL" "$CC" "$CXX" "$CXXSTD" "$EXTRA_FLAGS_RELEASE" "$WML_TESTS" "$WML_TEST_TIME" "$PLAY_TEST" "$MP_TEST" "$BOOST_TEST";
|
||||
fi
|
||||
- . ./utils/travis/steps/script.sh
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
|
28
utils/travis/steps/install.sh
Executable file
28
utils/travis/steps/install.sh
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash
|
||||
|
||||
export EXTRA_FLAGS_RELEASE=""
|
||||
export WML_TESTS=true
|
||||
export PLAY_TEST=true
|
||||
export MP_TEST=true
|
||||
export WML_TEST_TIME=15
|
||||
export BOOST_TEST=true
|
||||
|
||||
if [ "$OPT" = "-O0" ]; then
|
||||
export EXTRA_FLAGS_RELEASE="-O0"
|
||||
export PLAY_TEST=false
|
||||
export MP_TEST=false
|
||||
export WML_TEST_TIME=20
|
||||
fi
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
if [ "$TOOL" = "xcodebuild" ]; then
|
||||
brew install ccache
|
||||
travis_wait ./projectfiles/Xcode/Fix_Xcode_Dependencies
|
||||
else
|
||||
travis_wait ./utils/travis/install_deps.sh
|
||||
export CXXFLAGS="-I/usr/local/opt/openssl/include $CFLAGS"
|
||||
export LDFLAGS="-L/usr/local/opt/openssl/lib $LDFLAGS"
|
||||
fi
|
||||
else
|
||||
docker build -t wesnoth-repo:16.04 -f docker/Dockerfile-travis .
|
||||
fi
|
30
utils/travis/steps/script.sh
Executable file
30
utils/travis/steps/script.sh
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
if [ "$TOOL" = "xcodebuild" ]; then
|
||||
export PATH="/usr/local/opt/ccache/libexec:$PWD/utils/travis:$PATH"
|
||||
export CC=ccache-clang
|
||||
export CXX=ccache-clang++
|
||||
|
||||
cd ./projectfiles/Xcode
|
||||
|
||||
export CCACHE_MAXSIZE=2G
|
||||
export CCACHE_COMPILERCHECK=content
|
||||
|
||||
xcodebuild -project Wesnoth.xcodeproj -target Wesnoth
|
||||
|
||||
ccache -s
|
||||
ccache -z
|
||||
else
|
||||
ln -s build-cache/ build
|
||||
./utils/travis/check_utf8.sh
|
||||
./utils/travis/utf8_bom_dog.sh
|
||||
"$CXX" --version
|
||||
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=true cxx_std="$CXXSTD" nls="$NLS" jobs=2 enable_lto=false
|
||||
fi
|
||||
else
|
||||
export DISPLAY=:99.0
|
||||
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1024x768x24
|
||||
|
||||
docker run -v "$PWD"/build-cache:/home/wesnoth-travis/build -v "$HOME"/.ccache:/root/.ccache wesnoth-repo:16.04 bash -c './utils/travis/docker_run.sh "$@"' bash "$NLS" "$TOOL" "$CC" "$CXX" "$CXXSTD" "$EXTRA_FLAGS_RELEASE" "$WML_TESTS" "$WML_TEST_TIME" "$PLAY_TEST" "$MP_TEST" "$BOOST_TEST"
|
||||
fi
|
Loading…
Add table
Reference in a new issue