blob: 256881cb47b3abc0c15110bbd850f7b545c8c755 [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"
Florian Mayer17f77e82018-10-02 19:08:36 +010069# TODO(b/117093687): ubsan always times out in Travis.
Florian Mayer7f61afa2018-10-01 17:19:22 +010070# Re-enable once that is fixed.
Florian Mayer17f77e82018-10-02 19:08:36 +010071 - os: linux
72 dist: trusty
73 sudo: true
74 compiler: clang
75 env: CFG=linux_trusty-clang-x86_64-asan_lsan GN_ARGS="is_debug=false is_asan=true is_lsan=true"
Primiano Tuccid770e572017-10-01 05:28:39 -070076 - os: linux
77 dist: trusty
78 sudo: false
Primiano Tuccid770e572017-10-01 05:28:39 -070079 addons:
80 apt:
81 sources:
82 - ubuntu-toolchain-r-test
83 packages:
84 - g++-7
Primiano Tucci7278dea2017-10-31 11:50:32 +000085 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 -070086 - os: linux
87 dist: trusty
88 sudo: false
89 compiler: clang
90 env: CFG=android-clang-arm-release GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\""
91 - os: linux
92 dist: trusty
Florian Mayer5664ea62018-01-10 16:28:35 +000093 sudo: true
Primiano Tuccid770e572017-10-01 05:28:39 -070094 compiler: clang
95 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 +000096 - os: linux
97 dist: trusty
98 sudo: true
99 compiler: clang
Florian Mayer631cb2c2018-12-10 18:07:15 +0000100 env: CFG=linux_trusty-clang-x86_64-libfuzzer GN_ARGS="is_clang=true is_debug=false is_fuzzer=true is_asan=true"
Primiano Tuccife199902018-06-04 12:33:04 +0200101 - os: linux
102 dist: trusty
103 sudo: false
104 compiler: clang
105 env: CFG=ui-clang-x86_64-release GN_ARGS="is_debug=false is_clang=true"
Hector Dearman95b4f942018-07-11 13:29:04 +0100106 - os: linux
107 dist: trusty
108 sudo: false
109 compiler: clang
110 env: CFG=ui-clang-x86_64-debug GN_ARGS="is_debug=true is_clang=true"
111
Primiano Tuccid770e572017-10-01 05:28:39 -0700112
Primiano Tucci636ede12017-10-30 16:03:07 +0000113# Cache the deps that get git-pulled to avoid hitting quota limits (b/68252114).
114# Do not cache NDK/SDK and things that come from .zip files rather than git.
115# Doing that is discouraged (https://docs.travis-ci.com/user/caching/).
116cache:
117 timeout: 1800 # 30 mins
118 directories:
Primiano Tuccif1a25582018-12-07 00:53:51 +0000119 - buildtools/android-core
Primiano Tucci636ede12017-10-30 16:03:07 +0000120 - buildtools/benchmark
Primiano Tuccif1a25582018-12-07 00:53:51 +0000121 - buildtools/bionic
Lalit Maganti367fcd52018-02-05 16:06:13 +0000122 - buildtools/emulator
Primiano Tucci636ede12017-10-30 16:03:07 +0000123 - buildtools/googletest
Primiano Tucci0d72a312018-08-07 14:42:45 +0100124 - buildtools/jsoncpp
Primiano Tucci38faa6f2018-04-01 20:12:08 +0200125 - buildtools/libbacktrace
Primiano Tucci636ede12017-10-30 16:03:07 +0000126 - buildtools/libcxx
127 - buildtools/libcxxabi
Primiano Tuccia65497e2018-09-26 19:53:58 +0100128 - buildtools/libfuzzer
Primiano Tucci7278dea2017-10-31 11:50:32 +0000129 - buildtools/libunwind
Primiano Tuccif1a25582018-12-07 00:53:51 +0000130 - buildtools/linenoise
131 - buildtools/lzma
Primiano Tuccid770e572017-10-01 05:28:39 -0700132
133before_install:
134 - set -e
135 - echo "$CFG" && echo "$GN_ARGS"
Florian Mayer52e594e2018-01-10 18:23:55 +0000136 - export ASAN_SYMBOLIZER_PATH="$(which llvm-symbolizer
137 || echo /usr/bin/llvm-symbolizer-*)"
Lalit Magantidfe69ca2018-10-30 12:18:23 +0000138 - pip install --user protobuf
Primiano Tuccid770e572017-10-01 05:28:39 -0700139
140install:
141 - |
Primiano Tuccife199902018-06-04 12:33:04 +0200142 if [[ "$CFG" == android-* ]]; then
Lalit Maganti367fcd52018-02-05 16:06:13 +0000143 tools/install-build-deps
Primiano Tuccife199902018-06-04 12:33:04 +0200144 elif [[ "$CFG" == ui-* ]]; then
145 tools/install-build-deps --no-android --ui
146 else
147 tools/install-build-deps --no-android
Primiano Tuccid770e572017-10-01 05:28:39 -0700148 fi
Florian Mayer52e594e2018-01-10 18:23:55 +0000149 - |
150 if [[ -e buildtools/clang/bin/llvm-symbolizer ]]; then
151 export ASAN_SYMBOLIZER_PATH="buildtools/clang/bin/llvm-symbolizer"
152 fi
Primiano Tuccid770e572017-10-01 05:28:39 -0700153
154script:
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000155 - tools/gn gen out/dist --args="${GN_ARGS}" --check
Primiano Tuccife199902018-06-04 12:33:04 +0200156 - |
157 if [[ "$CFG" == ui-* ]]; then
Primiano Tucci8478e6d2019-03-10 12:32:24 -0700158 tools/ninja -C out/dist ui 2>&1 | grep -v "no version information"
159 elif [[ "$CFG" == *-libfuzzer ]]; then
160 tools/ninja -C out/dist fuzzers
Primiano Tuccife199902018-06-04 12:33:04 +0200161 else
Primiano Tucci8478e6d2019-03-10 12:32:24 -0700162 tools/ninja -C out/dist
Primiano Tuccife199902018-06-04 12:33:04 +0200163 fi
Primiano Tuccid770e572017-10-01 05:28:39 -0700164 - |
Primiano Tucci7278dea2017-10-31 11:50:32 +0000165 TEST_TARGETS="
Lalit Maganti367fcd52018-02-05 16:06:13 +0000166 perfetto_integrationtests
Lalit Maganti79f2d7b2018-01-23 18:27:33 +0000167 perfetto_unittests
Primiano Tucci7278dea2017-10-31 11:50:32 +0000168 "
Primiano Tuccife199902018-06-04 12:33:04 +0200169 if [[ "$CFG" == ui-* ]]; then
Hector Dearman6c5e1292018-06-27 15:42:32 +0100170 out/dist/ui_unittests --ci
Primiano Tucci8478e6d2019-03-10 12:32:24 -0700171 elif [[ "$CFG" == *-libfuzzer ]]; then
172 # Run a single iteration each to make sure they are not crashing.
173 for fuzzer in $(find out/dist -name '*_fuzzer' -executable); do
174 $fuzzer -runs=1
175 done
Primiano Tuccife199902018-06-04 12:33:04 +0200176 elif [[ "$CFG" == android-* ]]; then
177 TARGET_ARCH=$(echo $CFG | cut -d- -f3)
178 tools/run_android_emulator --pid /tmp/emulator.pid -v &
179 for TEST_TARGET in $TEST_TARGETS; do
180 tools/run_android_test out/dist "$TEST_TARGET"
181 done
182 tools/run_android_test --env BENCHMARK_FUNCTIONAL_TEST_ONLY=true out/dist "perfetto_benchmarks"
183 else
Primiano Tucci7278dea2017-10-31 11:50:32 +0000184 for TEST_TARGET in $TEST_TARGETS; do
185 "out/dist/$TEST_TARGET"
186 done
Lalit Maganti131b6e52018-03-29 18:29:31 +0100187 BENCHMARK_FUNCTIONAL_TEST_ONLY=true out/dist/perfetto_benchmarks
Lalit Maganti14160fc2018-10-17 12:31:40 +0100188 tools/diff_test_trace_processor.py out/dist/trace_processor_shell
Primiano Tuccid770e572017-10-01 05:28:39 -0700189 fi
190
191after_script:
192 - test -f /tmp/emulator.pid && kill -9 $(cat /tmp/emulator.pid); true