travis: Refactor script.

This commit is contained in:
orbea 2019-10-06 18:51:25 -07:00 committed by Rafael Kitover
parent abff89e4fb
commit 65fceab75a
1 changed files with 57 additions and 96 deletions

View File

@ -1,115 +1,76 @@
--- ---
cache: ccache
dist: trusty
language: cpp
services: xvfb
sudo: required sudo: required
services:
- xvfb
matrix: matrix:
fast_finish: true fast_finish: true
include: include:
- env: BUILD_ENV=ubuntu-bionic - env: BUILD_ENV=ubuntu-bionic
language: cpp
os: linux
dist: bionic dist: bionic
before_script: # xvfb fails on bionic for some reason
- ./installdeps
script:
- mkdir build
- cd build
- cmake .. -DENABLE_SDL=ON
- make -j2
# xvfb fails on bionic for some reason
# - xvfb-run ./visualboyadvance-m --help
cache:
directories:
- "$HOME/.ccache"
- env: BUILD_ENV=ubuntu-xenial - env: BUILD_ENV=ubuntu-xenial
language: cpp
os: linux
dist: xenial dist: xenial
before_script: # xvfb fails on xenial too
- ./installdeps - env: BUILD_ENV=ubuntu-trusty XVFB_RUN=1
script:
- mkdir build
- cd build
- cmake .. -DENABLE_SDL=ON
- make -j2
# xvfb fails on xenial too
# - xvfb-run ./visualboyadvance-m --help
cache:
directories:
- "$HOME/.ccache"
- env: BUILD_ENV=ubuntu-trusty
language: cpp
os: linux
dist: trusty
before_script:
- ./installdeps
script:
- mkdir build
- cd build
- cmake .. -DENABLE_SDL=ON
- make -j2
- xvfb-run ./visualboyadvance-m --help
cache:
directories:
- "$HOME/.ccache"
- env: BUILD_ENV=mingw-w64 - env: BUILD_ENV=mingw-w64
language: cpp
os: linux
dist: trusty
before_script:
- ./installdeps MinGW-w64-x86_64
script:
- mkdir build
- cd build
- /usr/lib/mxe/usr/bin/x86_64-w64-mingw32.static-cmake .. -DENABLE_SDL=ON
- make -j2
cache:
directories:
- "$HOME/.ccache"
- env: BUILD_ENV=mingw-w32 - env: BUILD_ENV=mingw-w32
language: cpp
os: linux
dist: trusty
before_script:
- ./installdeps MinGW-w64-i686
script:
- mkdir build
- cd build
- /usr/lib/mxe/usr/bin/i686-w64-mingw32.static-cmake .. -DENABLE_SDL=ON
- make -j2
cache:
directories:
- "$HOME/.ccache"
- env: BUILD_ENV=libretro - env: BUILD_ENV=libretro
language: cpp
os: linux
dist: trusty
before_install:
- sudo apt-get -qqy update
- sudo apt-get -qqy install build-essential ccache
script:
- cd src/libretro
- make -j2 CXX="ccache g++" CC="ccache gcc"
cache:
directories:
- "$HOME/.ccache"
- env: BUILD_ENV=mac - env: BUILD_ENV=mac
language: cpp
os: osx os: osx
osx_image: xcode10.2 osx_image: xcode10.2
before_script: install: export PATH="/usr/local/opt/ccache/libexec:$PATH"
- ./installdeps
script: before_install:
- mkdir build - |
- cd build case "$BUILD_ENV" in
- cmake .. -DENABLE_SDL=ON mingw-w64 )
- make -j2 ARG=MinGW-w64-x86_64
# - ./visualboyadvance-m.app/Contents/MacOS/visualboyadvance-m --help CMAKE=/usr/lib/mxe/usr/bin/x86_64-w64-mingw32.static-cmake
cache: ;;
directories: mingw-w32 )
- "$HOME/.ccache" ARG=MinGW-w64-i686
CMAKE=/usr/lib/mxe/usr/bin/i686-w64-mingw32.static-cmake
;;
* )
CMAKE=cmake
;;
esac
- |
if [ "$BUILD_ENV" != libretro ]; then
./installdeps $ARG
fi
before_script:
- |
if [ -n "$ENABLE_SDL" ]; then
CMAKE_ARGS="$CMAKE_ARGS -DENABLE_SDL=ON"
fi
- |
if [ "$BUILD_ENV" = libretro ]; then
cd src/libretro
else
mkdir -p build
cd build
fi
script:
- if [ "$BUILD_ENV" != libretro ]; then $CMAKE $CMAKE_ARGS ..; fi
- make
- |
if [ -n "$XVFB_RUN" ]; then
xvfb-run ./visualboyadvance-m --help
#elif [ "$BUILD_ENV" = mac ]; then
# - ./visualboyadvance-m.app/Contents/MacOS/visualboyadvance-m --help
fi
env:
global:
- CMAKE_ARGS=""
- ENABLE_SDL=1
- MAKEFLAGS="-j2"
notifications: notifications:
webhooks: webhooks: