Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
125 lines (109 sloc) 2.81 KB
language: cpp
matrix:
include:
# Ubuntu 18.04 Bionic Beaver
- os: linux
dist: bionic
sudo: required
compiler: gcc
# macOS 10.15 Catalina with Xcode 12.2
- os: osx
osx_image: xcode12.2
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
- libgtest-dev
# For Linux tests (like xvfb for sound: lets us run headless audio tests)
- pulseaudio
services:
- xvfb
before_install:
# 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
rvm use ruby
# Mac dependencies
# See: https://github.com/gosu/gosu/wiki/Getting-Started-on-OS-X
brew update
brew install sdl2 googletest
# 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 update --system
- gem install rake-compiler minitest --no-doc
before_script:
# Enable "dummy" devices for audio and video on Linux.
- |
if [ $TRAVIS_OS_NAME != osx ]; then
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-doc
# Install Gosu for C++ using CMake (running tests on the way).
- |
mkdir -p build
cd build
cmake ..
make
make test
sudo make install
cd ..
# Compile the C++ examples using CMake, outside of the main Gosu build tree.
- |
mkdir -p examples/build &&
cd examples/build &&
cmake .. &&
make
# 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.
- |
if [ $TRAVIS_OS_NAME == osx ]; then
rake -rgosu test
else
sg audio 'rake -rgosu test'
fi