forked from microsoft/bond
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
92 lines (88 loc) · 3.87 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
sudo: false
language: csharp
os:
- linux
- osx
cache:
directories:
- compiler/.cabal-sandbox
- cs/packages
env:
- BOND_LANG=cpp-clang
- BOND_LANG=cpp-gcc
- BOND_LANG=cs
- BOND_LANG=py-clang
- BOND_LANG=py-gcc
- BOND_GHC_VERSION=-7.8.4
- BOND_GHC_VERSION=-7.6.3
addons:
apt:
sources:
- boost-latest
- ubuntu-toolchain-r-test
- hvr-ghc
packages:
- g++-4.8
- libboost1.55-all-dev
- cabal-install-1.22
- ghc-7.8.4
- ghc-7.6.3
- ghc
matrix:
exclude:
# linux VM is too small to build C++ unit tests with g++
- os: linux
env: BOND_LANG=cpp-gcc
# linux C++ build/test already includes Python
- os: linux
env: BOND_LANG=py-clang
# don't test non-default versions of GHC on OSX
- os: osx
env: BOND_GHC_VERSION=-7.8.4
- os: osx
env: BOND_GHC_VERSION=-7.6.3
# on OS X g++ and clang++ are the same compiler
- os: osx
env: BOND_LANG=cpp-gcc
- os: osx
env: BOND_LANG=py-gcc
before_install:
# select C++ compiler
- export CXX="clang++" CC="clang"
- if [[ $BOND_LANG == *gcc ]]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
# linux prereqisite packages
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then wget --no-check-certificate https://www.cmake.org/files/v3.2/cmake-3.2.3-Linux-x86_64.tar.gz; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then tar -xzvf cmake-3.2.3-Linux-x86_64.tar.gz; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then export PATH=$PWD/cmake-3.2.3-Linux-x86_64/bin:$PATH; fi
# OS X prerequisite packages
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install ghc cabal-install; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [[ $BOND_LANG == py* ]]; then brew unlink boost; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [[ $BOND_LANG == py* ]]; then brew install boost boost-python; fi
# nunit installation
- if [ "$BOND_LANG" == "cs" ]; then travis_retry nuget install NUnit.Runners -version 2.6.4; fi
- export PATH=/opt/cabal/1.22/bin:/opt/ghc/${BOND_GHC_VERSION#?}/bin:$PATH
- cabal update
- cabal install happy
before_script:
# restore nuget packages for solution
- if [ "$BOND_LANG" == "cs" ]; then travis_retry nuget restore cs/cs.sln; fi
script:
- mkdir build && cd build
- cmake ..
- if [ "$BOND_LANG" == "cs" ]; then make --jobs 2 DESTDIR=$HOME install; fi
- if [ "$BOND_LANG" == "cs" ]; then export BOND_COMPILER_PATH=$HOME/usr/local/bin; fi
- if [[ $BOND_LANG == cpp* ]]; then make --jobs 2 check; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then export BOND_PYTHON_TARGETS="python_unit_test python_extension" BOND_PYTHON_TESTS=python_unit_test; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then export BOND_PYTHON_TARGETS="python_compatibility_test python_unit_test python_extension compatibility_test" BOND_PYTHON_TESTS=".*python.*"; fi
- if [[ $BOND_LANG == py* ]]; then make $BOND_PYTHON_TARGETS; fi
- if [[ $BOND_LANG == py* ]]; then ctest --tests-regex $BOND_PYTHON_TESTS --output-on-failure; fi
- if [ "$BOND_GHC_VERSION" != "" ]; then make gbc-tests; fi
- cd ..
- if [ "$BOND_LANG" == "cs" ]; then xbuild /p:Configuration=Debug cs/cs.sln; fi
- if [ "$BOND_LANG" == "cs" ]; then xbuild /p:Configuration=Fields cs/cs.sln; fi
- if [ "$BOND_LANG" == "cs" ]; then mono NUnit.Runners.2.6.4/tools/nunit-console.exe -framework=mono-4.5 -labels cs/test/core/bin/debug/net45/Properties/Bond.UnitTest.dll cs/test/core/bin/debug/net45/Fields/Bond.UnitTest.dll cs/test/internal/bin/debug/net45/Bond.InternalTest.dll; fi
- if [ "$BOND_GHC_VERSION" != "" ]; then cd compiler; fi
- if [ "$BOND_GHC_VERSION" != "" ]; then ../build/compiler/build/gbc-tests/gbc-tests; fi
before_cache:
- if [ "$BOND_GHC_VERSION" != "" ]; then rm -rf compiler/.cabal-sandbox; fi