Travis CI: mark build as finished once a job failed.
[platform/upstream/SPIRV-Tools.git] / .travis.yml
1 # Linux Build Configuration for Travis
2
3 language: cpp
4
5 os:
6   - linux
7   - osx
8
9 # Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment.
10 sudo: required
11 dist: trusty
12
13 # Use OS X 10.11 with XCode 7.2
14 # https://docs.travis-ci.com/user/osx-ci-environment/#OS-X-Version
15 osx_image: xcode7.2
16
17 env:
18   # Each line is a set of environment variables set before a build.
19   # Thus each line represents a different build configuration.
20   - BUILD_TYPE=Release
21   - BUILD_TYPE=Debug
22
23 compiler:
24   - clang
25   - gcc
26
27 matrix:
28   fast_finish: true
29   include:
30     # Additional build using Android NDK
31     - env: BUILD_NDK=ON
32   exclude:
33     # Skip GCC builds on Mac OS X.
34     - os: osx
35       compiler: gcc
36
37 cache:
38   apt: true
39
40 branches:
41   only:
42     - master
43
44 addons:
45   apt:
46     packages:
47       - ninja-build
48
49 before_install:
50   # Install cmake & ninja on Mac OS X.
51   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew install cmake ninja; fi
52   - if [[ "$BUILD_NDK" == "ON" ]]; then
53       git clone --depth=1 https://github.com/urho3d/android-ndk.git $HOME/android-ndk;
54       export ANDROID_NDK=$HOME/android-ndk;
55       git clone --depth=1 https://github.com/taka-no-me/android-cmake.git $HOME/android-cmake;
56       export TOOLCHAIN_PATH=$HOME/android-cmake/android.toolchain.cmake;
57     fi
58
59 before_script:
60   - git clone https://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers
61   - git clone https://github.com/google/googletest.git external/googletest
62
63 script:
64   - mkdir build && cd build
65   - if [[ "$BUILD_NDK" == "ON" ]]; then
66       cmake -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_PATH}
67             -DANDROID_NATIVE_API_LEVEL=android-9
68             -DCMAKE_BUILD_TYPE=Release
69             -DANDROID_ABI="armeabi-v7a with NEON"
70             -DSPIRV_SKIP_TESTS=ON
71             -GNinja ..;
72     else
73       cmake -GNinja -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ..;
74     fi
75   - ninja
76   - if [[ "$BUILD_NDK" != "ON" ]]; then ctest -j`nproc` --output_on_failure; fi
77
78
79 notifications:
80   email:
81     recipients:
82       - antiagainst@google.com
83       - awoloszyn@google.com
84       - deki@google.com
85       - dneto@google.com
86       - qining@google.com
87     on_success: change
88     on_failure: always