aboutsummaryrefslogtreecommitdiff
path: root/.travis.yml
blob: 3b36e9e7f7c3acec94c7fd25b5df741a7a6fe095 (plain)
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
# Linux Build Configuration for Travis

sudo: false # Use Travis docker infrastructure

language: cpp

os:
  - linux

env:
  matrix:
    # Each line is a set of environment variables set before a build.
    # Thus each line represents a different build configuration.
    - SHADERC_BUILD_TYPE=Release SHADERC_CODE_COVERAGE=OFF
    - SHADERC_BUILD_TYPE=Debug SHADERC_CODE_COVERAGE=OFF
    - SHADERC_BUILD_TYPE=Debug SHADERC_CODE_COVERAGE=ON

compiler:
  - clang
  - gcc

cache:
  apt: true

branches:
  only:
    - master

# Travis CI is powered with Ubuntu 12.04, whose toolchain is outdated.
addons:
  apt:
    # Travis white list of ppa.
    # https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
    sources:
      - ubuntu-toolchain-r-test     # For gcc 4.8
      - kubuntu-backports           # For cmake 2.8.12
      - llvm-toolchain-precise-3.6  # For clang 3.6
    # Travis whitelist of packages.
    # https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
    packages:
      - cmake
      - g++-4.8
      - clang-3.6
      - ninja-build
      - lcov

install:
  - pip install --user nose
  - pip install --user cpp-coveralls

  - export PATH=$HOME/.local/bin:$PATH # Make sure we can find the above Python packages
  - if [ "$CC" = "gcc"   ]; then export CC=gcc-4.8 CXX=g++-4.8; fi       # Make sure that gcc-4.8 is selected.
  - if [ "$CC" = "clang" ]; then export CC=clang-3.6 CXX=clang++-3.6; fi # Make sure that clang-3.6 is selected.

before_script:
  - git clone https://github.com/google/googletest.git third_party/googletest
  - git clone https://github.com/google/glslang.git third_party/glslang

script:
  - mkdir build && cd build
  - cmake -GNinja -DCMAKE_BUILD_TYPE=${SHADERC_BUILD_TYPE} -DENABLE_CODE_COVERAGE=${SHADERC_CODE_COVERAGE} ..
  - ninja && ctest -j`nproc` --output-on-failure

after_success:
  # Collect coverage and push to coveralls.info.
  # Ignore third party source code and tests.
  - if [ "$CC" = "gcc-4.8" -a "$SHADERC_CODE_COVERAGE" = "ON" ]; then
      coveralls
        --root ../
        --build-root ./
        --exclude-pattern '.+/third_party/'
        --exclude-pattern '.+/.+_test\.cc'
        --exclude-pattern '.+/CMakeFiles/'
        --gcov /usr/bin/gcov-4.8
        --gcov-options '\--long-file-names --preserve-paths'
        --verbose;
    fi


notifications:
  email:
    recipients:
      - antiagainst@google.com
      - awoloszyn@google.com
      - deki@google.com
      - dneto@google.com
    on_success: change
    on_failure: always