forked from google/shaderc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
82 lines (69 loc) · 3 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
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
install:
# Travis CI is powered with Ubuntu 12.04, whose toolchain is outdated.
- sudo add-apt-repository --yes ppa:smspillaz/cmake-2.8.12
- sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
- if [ "$CC" = "clang" ]; then wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -; fi
- if [ "$CC" = "clang" ]; then sudo add-apt-repository --yes 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.6 main'; fi
- sudo apt-get update -qq
# Update to CMake 2.8.12 and install required packages.
- sudo apt-get install cmake cmake-data lcov ninja-build
# Also update to GCC 4.8 if we are building using GCC.
- if [ "$CC" = "gcc" ]; then sudo apt-get install g++-4.8; fi
- if [ "$CC" = "gcc" ]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 90; fi
- if [ "$CC" = "gcc" ]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90; fi
# Also update to Clang 3.6 if we are building using Clang.
- if [ "$CC" = "clang" ]; then sudo apt-get install clang-3.6; fi
- if [ "$CC" = "clang" ]; then sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.6 90; fi
- if [ "$CC" = "clang" ]; then sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.6 90; fi
- sudo pip install nose
- sudo pip install cpp-coveralls
before_script:
- git clone -b release-1.7.0 https://github.com/google/googlemock.git third_party/gmock-1.7.0
- git clone -b release-1.7.0 https://github.com/google/googletest.git third_party/gmock-1.7.0/gtest
- git clone https://github.com/google/glslang.git third_party/glslang
script:
- if [ "$CC" = "clang" ]; then export PATH=/usr/bin:$PATH; fi # Make sure that clang-3.6 is selected.
- 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" -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:
on_success: change
on_failure: always