Permalink
Fetching contributors…
Cannot retrieve contributors at this time
136 lines (117 sloc) 3.13 KB
language: cpp
matrix:
include:
# Ubuntu 14.04 Trusty Tahr
- os: linux
dist: trusty
sudo: required
compiler: gcc
# macOS 10.11 El Capitan
- os: osx
osx_image: xcode7.3
compiler: clang
# Xcode 8 beta
- os: osx
osx_image: xcode8
compiler: clang
# Linux dependencies
# See: https://github.com/gosu/gosu/wiki/Getting-Started-on-Linux
addons:
apt:
packages:
- libsdl2-dev
- libgl1-mesa-dev
- libfontconfig1-dev
- libopenal-dev
- libsndfile1-dev
- libmpg123-dev
# For Ruby
- ruby-dev
- rake
# For C++
- cmake
# For Linux Soundtests (like xvfb for sound: lets us headlessly run audio tests)
- alsa-base
before_install:
# Cause multi-line snippets to fail on first error.
- set -ev
# Print the Ruby configuration to see what's defined in CXXFLAGS etc.
- ruby -rrbconfig -e 'RbConfig::CONFIG.each { |k, v| puts [k, v].join("=") }'
# Do some macOS-specific preparations
- |
if [ $TRAVIS_OS_NAME == osx ]; then
# Do not use RVM - it's been a mess for compiling Gosu on macOS.
rvm use system
# Mac dependencies
# See: https://github.com/gosu/gosu/wiki/Getting-Started-on-OS-X
brew update
brew install ruby sdl2
# Update the system RubyGems on macOS and install CocoaPods.
gem update --system
gem install cocoapods
fi
# Dependencies for 'rake gem' (not for actually using Gosu)
- gem install rake-compiler minitest --no-ri --no-rdoc
before_script:
# Enable "dummy" devices for audio and video on Linux.
- |
if [ $TRAVIS_OS_NAME != osx ]; then
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
sleep 3
sudo modprobe snd-dummy
sudo usermod -a -G audio $USER
fi
# Minimal git coverage.
branches:
only:
- master
git:
depth: 1
env:
global:
# 'rake gem' relies on this.
- GOSU_RELEASE_VERSION=9.9.9
# To silence this warning:
# "WARNING: CocoaPods requires your terminal to be using UTF-8 encoding."
- LANG=en_US.UTF-8
install:
# Install Ruby/Gosu using RubyGems.
- |
rake gem
gem install pkg/gosu-9.9.9.gem --no-ri --no-rdoc
# Install Gosu for C++ using CMake.
- |
mkdir -p cmake/build
cd cmake/build
cmake ..
make
sudo make install
cd ../..
# Compile Gosu for macOS and iOS using CocoaPods.
- |
if [ $TRAVIS_OS_NAME == osx ]; then
cd examples/Tutorial
pod install
xcodebuild build -workspace Tutorial.xcworkspace -scheme Tutorial
cd ../Tutorial-Touch
pod install
xcodebuild build -workspace Tutorial-Touch.xcworkspace -scheme Tutorial-Touch -destination 'platform=iOS Simulator,name=iPad Air'
cd ../..
fi
script:
# Run Ruby/Gosu tests and compile C++ examples.
- |
if [ $TRAVIS_OS_NAME == osx ]; then
rake -rgosu test
else
sg audio 'rake -rgosu test'
fi
# Compile C++ examples using CMake.
- |
mkdir -p examples/build &&
cd examples/build &&
cmake .. &&
make
# Reset the 'e' option to avoid a shell_session_update error from Travis.
- set +ev