From 7876ae861b65594e7d0ba4720a7afa4fc0904fe8 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 5 Jul 2018 20:50:56 -0700 Subject: [PATCH] Travis: Use docker containers for applicable builds --- .travis-deps.sh | 9 +-------- .travis.yml | 33 +++++++++++++++++++++++---------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/.travis-deps.sh b/.travis-deps.sh index 13952a3f4..7173f255f 100755 --- a/.travis-deps.sh +++ b/.travis-deps.sh @@ -1,12 +1,5 @@ #!/bin/sh if [ $TRAVIS_OS_NAME = "osx" ]; then brew update - brew install qt5 ffmpeg imagemagick sdl2 libzip libpng -else - sudo apt-get clean - sudo apt-get update - sudo apt-get install -y -q cmake libedit-dev libmagickwand-dev \ - libpng-dev libsdl2-dev libzip-dev qtbase5-dev \ - libqt5opengl5-dev qtmultimedia5-dev libavcodec-dev \ - libavutil-dev libavformat-dev libavresample-dev libswscale-dev + brew install qt5 ffmpeg imagemagick sdl2 libedit libpng libzip fi diff --git a/.travis.yml b/.travis.yml index 995e09a8b..e3b77c343 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,30 @@ +if: type = pull_request OR NOT branch =~ /^(master$|optimization)/ OR fork language: c sudo: required +services: +- docker +os: linux +env: +- DOCKER_TAG=ubuntu:xenial +- DOCKER_TAG=ubuntu:artful +- DOCKER_TAG=ubuntu:bionic +- DOCKER_TAG=3ds +- DOCKER_TAG=wii +- DOCKER_TAG=vita +- DOCKER_TAG=windows:w32 +- DOCKER_TAG=windows:w64 + matrix: include: - - os: linux - dist: trusty - compiler: clang - - os: linux - dist: trusty - compiler: gcc - - os: osx - compiler: clang + - os: osx + compiler: clang + env: DOCKER_TAG= before_install: - - source ./.travis-deps.sh +- '[ -z "$DOCKER_TAG" ] || docker pull mgba/$DOCKER_TAG' +- '[ "$TRAVIS_OS_NAME" != "osx" ] || . ./.travis-deps.sh' +- 'mkdir build && chmod 777 build' -script: mkdir build && cd build && cmake -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 .. && make +script: +- '[ -z "$DOCKER_TAG" ] || docker run -e BUILD_DIR=build -e MAKEFLAGS=-j2 -v $PWD:/home/mgba/src mgba/$DOCKER_TAG' +- '[ "$TRAVIS_OS_NAME" != "osx" ] || (cd build && cmake -DCMAKE_PREFIX_PATH="/usr/local/opt/qt5" .. && make -j2)'