blob: fa3f3497b06e06187fde79c9fb2354ccd3a6939c [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:
Primiano Tucci2a77fe52017-12-11 10:33:45 +000016 email: false
Primiano Tucci185c8a52017-11-09 21:27:44 +000017
Primiano Tuccid770e572017-10-01 05:28:39 -070018language: cpp
19
Primiano Tucci7278dea2017-10-31 11:50:32 +000020# The |CFG| variable name is hooked up by the perfetto-ci.appspot.com frontend.
21# Please keep infra/perfetto-ci.appspot.com/ updated when adding/removing
22# entries below.
Primiano Tuccid770e572017-10-01 05:28:39 -070023matrix:
24 include:
Florian Mayerb112e9f2018-01-26 13:16:10 +000025# OS X builds are processing too slow and block the queue.
26# Commenting out until the problem is resolved.
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"
Primiano Tuccid770e572017-10-01 05:28:39 -070047 - 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
Florian Mayer6bbffa42018-01-18 19:04:52 +000058 env: CFG=linux_trusty-clang-x86_64-debug GN_ARGS="is_debug=true is_hermetic_clang=false"
Primiano Tuccid770e572017-10-01 05:28:39 -070059 - os: linux
60 dist: trusty
Primiano Tuccid770e572017-10-01 05:28:39 -070061 sudo: false
62 compiler: clang
63 env: CFG=linux_trusty-clang-x86_64-tsan GN_ARGS="is_debug=false is_tsan=true"
64 - os: linux
65 dist: trusty
66 sudo: false
67 compiler: clang
68 env: CFG=linux_trusty-clang-x86_64-msan GN_ARGS="is_debug=false is_msan=true"
69 - os: linux
70 dist: trusty
Florian Mayer5664ea62018-01-10 16:28:35 +000071 sudo: true
Primiano Tuccid770e572017-10-01 05:28:39 -070072 compiler: clang
Florian Mayere96d6612018-02-12 16:24:35 +000073 env: CFG=linux_trusty-clang-x86_64-ubsan_asan_lsan GN_ARGS="is_debug=false is_ubsan=true is_asan=true is_lsan=true"
Primiano Tuccid770e572017-10-01 05:28:39 -070074 - os: linux
75 dist: trusty
76 sudo: false
Primiano Tuccid770e572017-10-01 05:28:39 -070077 addons:
78 apt:
79 sources:
80 - ubuntu-toolchain-r-test
81 packages:
82 - g++-7
Primiano Tucci7278dea2017-10-31 11:50:32 +000083 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 -070084 - os: linux
85 dist: trusty
86 sudo: false
87 compiler: clang
88 env: CFG=android-clang-arm-release GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\""
89 - os: linux
90 dist: trusty
Florian Mayer5664ea62018-01-10 16:28:35 +000091 sudo: true
Primiano Tuccid770e572017-10-01 05:28:39 -070092 compiler: clang
93 env: CFG=android-clang-arm-asan GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\" is_asan=true"
Florian Mayer4c3580f2018-02-12 15:59:55 +000094 - os: linux
95 dist: trusty
96 sudo: true
97 compiler: clang
98 env: CFG=linux_trusty-clang-x86_64-libfuzzer GN_ARGS="is_clang=true is_debug=false use_libfuzzer=true is_asan=true"
Primiano Tuccife199902018-06-04 12:33:04 +020099 - os: linux
100 dist: trusty
101 sudo: false
102 compiler: clang
103 env: CFG=ui-clang-x86_64-release GN_ARGS="is_debug=false is_clang=true"
Hector Dearman95b4f942018-07-11 13:29:04 +0100104 - os: linux
105 dist: trusty
106 sudo: false
107 compiler: clang
108 env: CFG=ui-clang-x86_64-debug GN_ARGS="is_debug=true is_clang=true"
109
Primiano Tuccid770e572017-10-01 05:28:39 -0700110
Primiano Tucci636ede12017-10-30 16:03:07 +0000111# Cache the deps that get git-pulled to avoid hitting quota limits (b/68252114).
112# Do not cache NDK/SDK and things that come from .zip files rather than git.
113# Doing that is discouraged (https://docs.travis-ci.com/user/caching/).
114cache:
115 timeout: 1800 # 30 mins
116 directories:
117 - buildtools/benchmark
Lalit Maganti367fcd52018-02-05 16:06:13 +0000118 - buildtools/emulator
Primiano Tucci636ede12017-10-30 16:03:07 +0000119 - buildtools/googletest
Primiano Tucci0d72a312018-08-07 14:42:45 +0100120 - buildtools/jsoncpp
Primiano Tucci38faa6f2018-04-01 20:12:08 +0200121 - buildtools/libbacktrace
Primiano Tucci636ede12017-10-30 16:03:07 +0000122 - buildtools/libcxx
123 - buildtools/libcxxabi
Primiano Tucci7278dea2017-10-31 11:50:32 +0000124 - buildtools/libunwind
Primiano Tuccid770e572017-10-01 05:28:39 -0700125
126before_install:
127 - set -e
128 - echo "$CFG" && echo "$GN_ARGS"
Florian Mayer52e594e2018-01-10 18:23:55 +0000129 - export ASAN_SYMBOLIZER_PATH="$(which llvm-symbolizer
130 || echo /usr/bin/llvm-symbolizer-*)"
Primiano Tuccid770e572017-10-01 05:28:39 -0700131
132install:
133 - |
Primiano Tuccife199902018-06-04 12:33:04 +0200134 if [[ "$CFG" == android-* ]]; then
Lalit Maganti367fcd52018-02-05 16:06:13 +0000135 tools/install-build-deps
Primiano Tuccife199902018-06-04 12:33:04 +0200136 elif [[ "$CFG" == ui-* ]]; then
137 tools/install-build-deps --no-android --ui
138 else
139 tools/install-build-deps --no-android
Primiano Tuccid770e572017-10-01 05:28:39 -0700140 fi
Florian Mayer52e594e2018-01-10 18:23:55 +0000141 - |
142 if [[ -e buildtools/clang/bin/llvm-symbolizer ]]; then
143 export ASAN_SYMBOLIZER_PATH="buildtools/clang/bin/llvm-symbolizer"
144 fi
Primiano Tuccid770e572017-10-01 05:28:39 -0700145
146script:
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000147 - tools/gn gen out/dist --args="${GN_ARGS}" --check
Primiano Tuccife199902018-06-04 12:33:04 +0200148 - |
149 if [[ "$CFG" == ui-* ]]; then
150 tools/ninja -C out/dist -j8 ui 2>&1 | grep -v "no version information available"
151 else
152 tools/ninja -C out/dist -j8
153 fi
Primiano Tuccid770e572017-10-01 05:28:39 -0700154 - |
Primiano Tucci7278dea2017-10-31 11:50:32 +0000155 TEST_TARGETS="
Lalit Maganti367fcd52018-02-05 16:06:13 +0000156 perfetto_integrationtests
Lalit Maganti79f2d7b2018-01-23 18:27:33 +0000157 perfetto_unittests
Primiano Tucci7278dea2017-10-31 11:50:32 +0000158 "
Primiano Tuccife199902018-06-04 12:33:04 +0200159 if [[ "$CFG" == ui-* ]]; then
Hector Dearman6c5e1292018-06-27 15:42:32 +0100160 out/dist/ui_unittests --ci
Primiano Tuccife199902018-06-04 12:33:04 +0200161 elif [[ "$CFG" == android-* ]]; then
162 TARGET_ARCH=$(echo $CFG | cut -d- -f3)
163 tools/run_android_emulator --pid /tmp/emulator.pid -v &
164 for TEST_TARGET in $TEST_TARGETS; do
165 tools/run_android_test out/dist "$TEST_TARGET"
166 done
167 tools/run_android_test --env BENCHMARK_FUNCTIONAL_TEST_ONLY=true out/dist "perfetto_benchmarks"
168 else
Primiano Tucci7278dea2017-10-31 11:50:32 +0000169 for TEST_TARGET in $TEST_TARGETS; do
170 "out/dist/$TEST_TARGET"
171 done
Lalit Maganti131b6e52018-03-29 18:29:31 +0100172 BENCHMARK_FUNCTIONAL_TEST_ONLY=true out/dist/perfetto_benchmarks
Florian Mayer4c3580f2018-02-12 15:59:55 +0000173 if [[ "$CFG" == *-libfuzzer ]]; then
174 # Run a single iteration each to make sure they are not crashing.
Florian Mayer029a3032018-02-12 17:00:52 +0000175 out/dist/end_to_end_shared_memory_fuzzer -runs=1
Florian Mayer4c3580f2018-02-12 15:59:55 +0000176 out/dist/buffered_frame_deserializer_fuzzer -runs=1
177 fi
Primiano Tuccid770e572017-10-01 05:28:39 -0700178 fi
179
180after_script:
181 - test -f /tmp/emulator.pid && kill -9 $(cat /tmp/emulator.pid); true