blob: be9ec292dd29f2f1c4f27f915554af344756c88b [file] [log] [blame]
Primiano Tuccid770e572017-10-01 05:28:39 -07001# Copyright (C) 2017 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
Primiano Tucci185c8a52017-11-09 21:27:44 +000015notifications:
16 email:
17 on_success: never
18 on_failure: always
19
Primiano Tuccid770e572017-10-01 05:28:39 -070020language: cpp
21
Primiano Tucci7278dea2017-10-31 11:50:32 +000022# The |CFG| variable name is hooked up by the perfetto-ci.appspot.com frontend.
23# Please keep infra/perfetto-ci.appspot.com/ updated when adding/removing
24# entries below.
Primiano Tuccid770e572017-10-01 05:28:39 -070025matrix:
26 include:
27 - os: osx
28 osx_image: xcode8.3
29 compiler: clang
30 env: CFG=mac-clang-x86_64-release GN_ARGS="is_debug=false"
31 - os: osx
32 osx_image: xcode8.3
33 compiler: clang
34 env: CFG=mac-clang-x86_64-debug GN_ARGS="is_debug=true"
35 - os: osx
36 osx_image: xcode8.3
37 compiler: clang
38 env: CFG=mac-clang-x86_64-asan GN_ARGS="is_debug=false is_asan=true"
39 - os: osx
40 osx_image: xcode8.3
41 compiler: clang
42 env: CFG=mac-clang-x86_64-tsan GN_ARGS="is_debug=false is_tsan=true"
43 - os: osx
44 osx_image: xcode8.3
45 compiler: clang
46 env: CFG=mac-clang-x86_64-ubsan GN_ARGS="is_debug=false is_ubsan=true"
47 - os: linux
48 dist: trusty
49 sudo: false
Primiano Tucci24b96722017-10-30 17:49:11 +000050 # When setting compiler: clang Travis pull a newer version of clang than
51 # the version that is shipped with Trusty. This is good for all the other
52 # configs, but we want to keep at least one target in the matrix to match
53 # the default version of clang that we have on our workstations.
54 addons:
55 apt:
56 packages:
57 - clang
Primiano Tuccid770e572017-10-01 05:28:39 -070058 env: CFG=linux_trusty-clang-x86_64-debug GN_ARGS="is_debug=true"
59 - os: linux
60 dist: trusty
61 sudo: false
62 compiler: clang
63 env: CFG=linux_trusty-clang-x86_64-asan GN_ARGS="is_debug=false is_asan=true"
64 - os: linux
65 dist: trusty
66 sudo: false
67 compiler: clang
68 env: CFG=linux_trusty-clang-x86_64-tsan GN_ARGS="is_debug=false is_tsan=true"
69 - os: linux
70 dist: trusty
71 sudo: false
72 compiler: clang
73 env: CFG=linux_trusty-clang-x86_64-msan GN_ARGS="is_debug=false is_msan=true"
74 - os: linux
75 dist: trusty
76 sudo: false
77 compiler: clang
78 env: CFG=linux_trusty-clang-x86_64-lsan GN_ARGS="is_debug=false is_lsan=true"
79 - os: linux
80 dist: trusty
81 sudo: false
82 compiler: clang
83 env: CFG=linux_trusty-clang-x86_64-ubsan GN_ARGS="is_debug=false is_ubsan=true"
84 - os: linux
85 dist: trusty
86 sudo: false
Primiano Tuccid770e572017-10-01 05:28:39 -070087 addons:
88 apt:
89 sources:
90 - ubuntu-toolchain-r-test
91 packages:
92 - g++-7
Primiano Tucci7278dea2017-10-31 11:50:32 +000093 env: CFG=linux_trusty-gcc7-x86_64-release GN_ARGS="is_debug=false is_clang=false use_custom_libcxx=false cc=\"gcc-7\" cxx=\"g++-7\""
Primiano Tuccid770e572017-10-01 05:28:39 -070094 - os: linux
95 dist: trusty
96 sudo: false
97 compiler: clang
98 env: CFG=android-clang-arm-release GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\""
99 - os: linux
100 dist: trusty
101 sudo: false
102 compiler: clang
103 env: CFG=android-clang-arm64-release GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm64\""
104 - os: linux
105 dist: trusty
106 sudo: false
107 compiler: clang
108 env: CFG=android-clang-arm-asan GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\" is_asan=true"
109 - os: linux
110 dist: trusty
111 sudo: false
112 compiler: clang
Primiano Tuccid770e572017-10-01 05:28:39 -0700113 env: CFG=android-clang-arm64-asan GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm64\" is_asan=true"
Primiano Tuccid770e572017-10-01 05:28:39 -0700114
Primiano Tucci636ede12017-10-30 16:03:07 +0000115# Cache the deps that get git-pulled to avoid hitting quota limits (b/68252114).
116# Do not cache NDK/SDK and things that come from .zip files rather than git.
117# Doing that is discouraged (https://docs.travis-ci.com/user/caching/).
118cache:
119 timeout: 1800 # 30 mins
120 directories:
121 - buildtools/benchmark
122 - buildtools/googletest
123 - buildtools/libcxx
124 - buildtools/libcxxabi
Primiano Tucci7278dea2017-10-31 11:50:32 +0000125 - buildtools/libunwind
Primiano Tuccid770e572017-10-01 05:28:39 -0700126
127before_install:
128 - set -e
129 - echo "$CFG" && echo "$GN_ARGS"
130 - ASAN_SYMBOLIZER_PATH="$(which llvm-symbolizer || echo /usr/bin/llvm-symbolizer-*)"
131
132install:
133 - |
134 if [[ "$CFG" != android-* ]]; then
135 build/install-build-deps --no-android
136 else
137 build/install-build-deps
138 fi
139
140script:
141 - build/gn gen out/dist --args="${GN_ARGS}" --check
142 - build/ninja -C out/dist -j8 all
143 - |
Primiano Tucci7278dea2017-10-31 11:50:32 +0000144 TEST_TARGETS="
145 base_unittests
146 protozero_unittests
147 tracing_unittests
148 tracing_benchmarks
149 sanitizers_unittests
Hector Dearman72a49052017-11-08 14:12:55 +0000150 ftrace_reader_unittests
Primiano Tucci7278dea2017-10-31 11:50:32 +0000151 "
152
Primiano Tuccid770e572017-10-01 05:28:39 -0700153 if [[ "$CFG" != android-* ]]; then
Primiano Tucci7278dea2017-10-31 11:50:32 +0000154 for TEST_TARGET in $TEST_TARGETS; do
155 "out/dist/$TEST_TARGET"
156 done
Primiano Tuccid770e572017-10-01 05:28:39 -0700157 else
158 TARGET_ARCH=$(echo $CFG | cut -d- -f3)
159 build/run_android_emulator $TARGET_ARCH --pid /tmp/emulator.pid -v &
Primiano Tucci7278dea2017-10-31 11:50:32 +0000160 for TEST_TARGET in $TEST_TARGETS; do
161 build/run_android_test out/dist "$TEST_TARGET"
162 done
Primiano Tuccid770e572017-10-01 05:28:39 -0700163 fi
164
165after_script:
166 - test -f /tmp/emulator.pid && kill -9 $(cat /tmp/emulator.pid); true