Update Travis CI config, add AppVeyor for Windows CI coverage.

This commit is contained in:
costan 2017-06-27 11:11:16 -07:00 committed by Victor Costan
parent f24f9d2d97
commit e9720a001d
3 changed files with 93 additions and 15 deletions

View File

@ -1,16 +1,53 @@
language: generic
# Build matrix / environment variables are explained on:
# http://about.travis-ci.org/docs/user/build-configuration/
# This file can be validated on: http://lint.travis-ci.org/
sudo: false
dist: trusty
language: cpp
compiler:
- gcc
- clang
os:
- linux
- osx
env:
- BUILD_TYPE=Debug
- BUILD_TYPE=RelWithDebInfo
matrix:
include:
- os: linux
dist: trusty # For Docker.
sudo: required # For Docker.
script:
- echo "Testing branch $TRAVIS_BRANCH of $REPOSITORY_NAME"
- docker run --rm -i -v $CI_SOURCE_PATH:$CI_SOURCE_PATH -e "CI_SOURCE_PATH=$CI_SOURCE_PATH" -e "HOME=$HOME" -t ubuntu:xenial sh -c "cd $CI_SOURCE_PATH; apt-get -qq update && apt-get -qq install build-essential cmake libgtest-dev; mkdir build && cd build && cmake ../ && make all && make test"
- os: osx
script:
- echo "Testing branch $TRAVIS_BRANCH of $REPOSITORY_NAME"
- mkdir build && cd build && cmake ../ && make all && make test
before_install:
- export CI_SOURCE_PATH=$(pwd)
- export REPOSITORY_NAME=${PWD##*/}
allow_failures:
- compiler: clang
env: BUILD_TYPE=RelWithDebInfo
addons:
apt:
# List of whitelisted in travis packages for ubuntu-precise can be found here:
# https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
# List of whitelisted in travis apt-sources:
# https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
packages:
- cmake
- gcc-6
- g++-6
- clang-4.0
install:
# Travis doesn't have a nice way to install homebrew packages yet.
# https://github.com/travis-ci/travis-ci/issues/5377
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install gcc@6; fi
# /usr/bin/gcc is stuck to old versions by on both Linux and OSX.
- if [ "$CXX" = "g++" ]; then export CXX="g++-6" CC="gcc-6"; fi
- echo ${CC}
- echo ${CXX}
- ${CXX} --version
script:
- mkdir -p build && cd build && cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE &&
CTEST_OUTPUT_ON_FAILURE=1 make all test

38
appveyor.yml Normal file
View File

@ -0,0 +1,38 @@
# Build matrix / environment variables are explained on:
# https://www.appveyor.com/docs/appveyor-yml/
# This file can be validated on: https://ci.appveyor.com/tools/validate-yaml
version: "{build}"
environment:
matrix:
# AppVeyor currently has no custom job name feature.
# http://help.appveyor.com/discussions/questions/1623-can-i-provide-a-friendly-name-for-jobs
- JOB: Visual Studio 2017
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CMAKE_GENERATOR: Visual Studio 15 2017
- JOB: Visual Studio 2015
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
CMAKE_GENERATOR: Visual Studio 14 2015
platform:
- x86
- x64
configuration:
- RelWithDebInfo
- Debug
build:
verbosity: minimal
build_script:
- git submodule update --init --recursive
- mkdir out
- cd out
- cmake .. -G "%CMAKE_GENERATOR%"
-DCMAKE_CONFIGURATION_TYPES="Debug;RelWithDebInfo"
- cmake --build . --config %CONFIGURATION%
test_script:
- ctest -C %CONFIGURATION% --output-on-failure

View File

@ -33,6 +33,9 @@
#endif
#ifdef HAVE_WINDOWS_H
// Needed to be able to use std::max without workarounds in the source code.
// https://support.microsoft.com/en-us/help/143208/prb-using-stl-in-windows-program-can-cause-min-max-conflicts
#define NOMINMAX
#include <windows.h>
#endif