Enable cross-platform CI on 0.8 branch

0.8
Bruno Van de Velde 2016-09-14 20:54:25 +02:00
parent 939564381a
commit 047daf2f2a
5 changed files with 147 additions and 31 deletions

82
.appveyor.yml Normal file
View File

@ -0,0 +1,82 @@
#---------------------------------#
# general configuration #
#---------------------------------#
version: 0.8-build-{build}
#---------------------------------#
# environment configuration #
#---------------------------------#
environment:
matrix:
- SFML_ROOT: C:\SFML-VS2015
SFML_VERSION: master
GENERATOR: Visual Studio 14 2015 Win64
BUILD_TYPE: Debug
SHARED_LIBS: FALSE
BUILD_TESTS: TRUE
BUILD_EXAMPLES: FALSE
BUILD_FOLDER: build-VS2015-Win64
- SFML_ROOT: C:\SFML-VS2013
SFML_VERSION: 2.4.0
GENERATOR: Visual Studio 12 2013
BUILD_TYPE: Release
SHARED_LIBS: TRUE
BUILD_TESTS: FALSE
BUILD_EXAMPLES: TRUE
BUILD_FOLDER: build-VS2013-Win32
clone_depth: 3
cache:
- C:\SFML-VS2013 -> appveyor.yml
- C:\SFML-VS2015 -> appveyor.yml
install:
- IF NOT EXIST %SFML_ROOT% (
cd C:\ &&
appveyor DownloadFile https://github.com/SFML/SFML/archive/%SFML_VERSION%.zip -FileName C:\SFML.zip &&
7z x C:\SFML.zip &&
move SFML-%SFML_VERSION% %SFML_ROOT% &&
cd %SFML_ROOT% &&
mkdir lib &&
mkdir %BUILD_FOLDER% &&
cd %BUILD_FOLDER% &&
cmake -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DBUILD_SHARED_LIBS=%SHARED_LIBS% .. &&
msbuild SFML.sln /p:Configuration=%BUILD_TYPE% /m &&
xcopy lib\%BUILD_TYPE% %SFML_ROOT%\lib\ &&
cd ..
)
#---------------------------------#
# build configuration #
#---------------------------------#
build_script:
- cd C:\projects\tgui
- mkdir %BUILD_FOLDER%
- cd %BUILD_FOLDER%
- cmake -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DTGUI_SHARED_LIBS=%SHARED_LIBS% -DTGUI_BUILD_TESTS=%BUILD_TESTS% -DTGUI_BUILD_EXAMPLES=%BUILD_EXAMPLES% -DSFML_ROOT=%SFML_ROOT% ..
- msbuild tgui.sln /p:Configuration=%BUILD_TYPE% /m
- cd ..
- IF %BUILD_TESTS%==TRUE (
cd %BUILD_FOLDER%\tests\%BUILD_TYPE% &&
tests.exe &&
cd ..\..\..
)
#---------------------------------#
# notifications #
#---------------------------------#
notifications:
- provider: Webhook
url: https://webhooks.gitter.im/e/1feed1f155b2a41e6a62
on_build_success: false
on_build_failure: true
on_build_status_changed: true

View File

@ -4,21 +4,34 @@ language: cpp
git:
depth: 1
os: linux
compiler: g++-6
env: COMPILER=g++-6
cache:
directories:
- $HOME/SFML_LINUX
matrix:
include:
- os: linux
compiler: g++-4.7
env: COMPILER=g++-4.7
cache:
directories:
- $HOME/SFML_LINUX
- os: linux
compiler: g++-6
env: COMPILER=g++-6
cache:
directories:
- $HOME/SFML-2.4.0_LINUX
- os: osx
cache:
directories:
- $HOME/SFML_OSX
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.7
- g++-6
- valgrind
- libfreetype6-dev
- libjpeg-dev
- libx11-dev
@ -35,19 +48,43 @@ addons:
- libvorbisfile3
- libopenal-dev
- libpthread-stubs0-dev
- libglew-dev
- libgpgme11-dev
- libsndfile1-dev
- libudev-dev
script:
- CXX=$COMPILER;
- chmod +x tests/travis_linux_tests.sh
- tests/travis_linux_tests.sh
- >
CXX=$COMPILER;
if [[ $TRAVIS_OS_NAME == 'linux' ]]; then
if [[ $CXX == g++-4.7 ]]; then
chmod +x tests/travis_linux.sh
tests/travis_linux.sh
elif [[ $CXX == g++-6 ]]; then
chmod +x tests/travis_linux_tests.sh
tests/travis_linux_tests.sh
else
echo 'Invalid compiler'
exit 1
fi
elif [[ $TRAVIS_OS_NAME == 'osx' ]]; then
chmod +x tests/travis_osx.sh
tests/travis_osx.sh
else
echo 'Invalid OS'
exit 1
fi
after_success:
- >
if [[ $TRAVIS_OS_NAME == 'linux' && $CXX == g++-6 ]]; then
bash <(curl -s https://codecov.io/bash) -x gcov-6 -a "-s /home/travis/build/texus/TGUI -pr"
fi
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/66857e210e9200bcb6b7
on_success: change
on_failure: always
on_start: never

View File

@ -3,8 +3,8 @@ set -e
export SFML_ROOT=$HOME/SFML_LINUX
git clone --depth 1 https://github.com/SFML/SFML
cd SFML
if [[ ! -d "$SFML_ROOT/lib" || ! -f "$SFML_ROOT/revision_cache" || `git rev-parse HEAD` != `cat "$SFML_ROOT/revision_cache"` ]]; then
if [[ ! -d "$SFML_ROOT/lib" ]]; then
echo "$(tput setaf 3)Rebuilding SFML: no cache available$(tput sgr 0)"
@ -21,8 +21,8 @@ else
fi
cd ..
mkdir build_gcc-4.7
cd build_gcc-4.7
mkdir build_gcc-$CXX
cd build_gcc-$CXX
cmake -DCMAKE_BUILD_TYPE=Release -DTGUI_BUILD_EXAMPLES=TRUE ..
make -j2
cd ..

View File

@ -1,30 +1,26 @@
set -eo pipefail
export SFML_ROOT=$HOME/SFML_LINUX
export SFML_VERSION=2.4.0
export SFML_ROOT=$HOME/SFML-${SFML_VERSION}_LINUX
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
git clone --depth 1 https://github.com/SFML/SFML
if [[ ! -d "$SFML_ROOT/lib" ]]; then
echo "$(tput setaf 3)Rebuilding SFML: no cache available$(tput sgr 0)"
cd SFML
if [[ ! -d "$SFML_ROOT/lib" || ! -f "$SFML_ROOT/revision_cache" || `git rev-parse HEAD` != `cat "$SFML_ROOT/revision_cache"` ]]; then
if [[ ! -d "$SFML_ROOT/lib" ]]; then
echo "$(tput setaf 3)Rebuilding SFML: no cache available$(tput sgr 0)"
else
echo "$(tput setaf 3)Rebuilding SFML: updating version$(tput sgr 0)"
fi
git rev-parse HEAD > "$SFML_ROOT/revision_cache"
wget -O SFML.tar.gz https://github.com/SFML/SFML/archive/${SFML_VERSION}.tar.gz
tar -xzf SFML.tar.gz
cd SFML-${SFML_VERSION}
cmake -DCMAKE_INSTALL_PREFIX=$SFML_ROOT .
make -j2
make install
cd ..
else
echo "$(tput setaf 2)Using cached SFML directory$(tput sgr 0)"
fi
cd ..
mkdir build
cd build
mkdir build_$CXX
cd build_$CXX
cmake -DCMAKE_BUILD_TYPE=Debug -DTGUI_BUILD_TESTS=TRUE -DTGUI_USE_GCOV=TRUE ..
make -j2
cd tests/

View File

@ -1,14 +1,15 @@
set -e
mkdir build
export SFML_VERSION=2.4.0
export SFML_ROOT=$HOME/SFML_OSX
if [[ ! -d "$SFML_ROOT/lib" ]]; then
echo "$(tput setaf 3)Rebuilding SFML: no cache available$(tput sgr 0)"
wget -O SFML.tar.gz https://github.com/SFML/SFML/archive/2.3.2.tar.gz
wget -O SFML.tar.gz https://github.com/SFML/SFML/archive/${SFML_VERSION}.tar.gz
tar -xzf SFML.tar.gz
cd SFML-2.3.2
cd SFML-${SFML_VERSION}
cmake -DCMAKE_INSTALL_PREFIX=$SFML_ROOT -DCMAKE_INSTALL_FRAMEWORK_PREFIX=$SFML_ROOT/lib -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" -DSFML_BUILD_FRAMEWORKS=TRUE .
make -j2
make install