Since g++-4.9 has an ICE occasionally in travis add a retry.
[platform/upstream/SPIRV-Tools.git] / .travis.yml
1 # Linux Build Configuration for Travis
2
3 sudo: false # Use Travis docker infrastructure
4
5 language: cpp
6
7 os:
8   - linux
9
10 env:
11   matrix:
12     # Each line is a set of environment variables set before a build.
13     # Thus each line represents a different build configuration.
14     - BUILD_TYPE=Release
15     - BUILD_TYPE=Debug
16
17 compiler:
18   - clang
19   - gcc
20
21 cache:
22   apt: true
23
24 branches:
25   only:
26     - master
27
28 # Travis CI is powered with Ubuntu 12.04, whose toolchain is outdated.
29 addons:
30   apt:
31     # Travis white list of ppa.
32     # https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
33     sources:
34       - ubuntu-toolchain-r-test     # For gcc 4.9
35       - kubuntu-backports           # For cmake 2.8.12
36       - llvm-toolchain-precise-3.7  # For clang 3.7
37     # Travis whitelist of packages.
38     # https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
39     packages:
40       - cmake
41       - g++-4.9
42       - clang-3.7
43       - ninja-build
44
45 install:
46   - if [ "$CC" = "gcc"   ]; then export CC=gcc-4.9 CXX=g++-4.9; fi       # Make sure that gcc-4.9 is selected.
47   - if [ "$CC" = "clang" ]; then export CC=clang-3.7 CXX=clang++-3.7; fi # Make sure that clang-3.7 is selected.
48
49 before_script:
50   - git clone https://github.com/google/googletest.git external/googletest
51
52 script:
53   - mkdir build && cd build
54   - cmake -GNinja -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ..
55     # Sometimes g++-4.9 flakes with an ICE. This may be an OOM thing when
56     # expanding many templates.
57     # If we fail the build the first time, then try to continue in
58     # single-process mode.
59   - ninja || ninja -j 1
60   - ./UnitSPIRV --gtest_break_on_failure
61
62
63 notifications:
64   email:
65     recipients:
66       - antiagainst@google.com
67       - awoloszyn@google.com
68       - deki@google.com
69       - dneto@google.com
70       - qining@google.com
71     on_success: change
72     on_failure: always