blob: 2d53e220851b35d9d8c06ac3caf7b5e402344e51 [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
Primiano Tucci600d9272019-05-13 19:53:21 +010048 dist: xenial
Primiano Tuccid770e572017-10-01 05:28:39 -070049 sudo: false
Primiano Tucci600d9272019-05-13 19:53:21 +010050 # Test the system-version of clang, not our own at least in this config.
Primiano Tucci24b96722017-10-30 17:49:11 +000051 addons:
52 apt:
53 packages:
54 - clang
Florian Mayer6bbffa42018-01-18 19:04:52 +000055 env: CFG=linux_trusty-clang-x86_64-debug GN_ARGS="is_debug=true is_hermetic_clang=false"
Primiano Tuccid770e572017-10-01 05:28:39 -070056 - os: linux
Primiano Tucci600d9272019-05-13 19:53:21 +010057 dist: xenial
Primiano Tuccid770e572017-10-01 05:28:39 -070058 sudo: false
59 compiler: clang
60 env: CFG=linux_trusty-clang-x86_64-tsan GN_ARGS="is_debug=false is_tsan=true"
61 - os: linux
Primiano Tucci600d9272019-05-13 19:53:21 +010062 dist: xenial
Primiano Tuccid770e572017-10-01 05:28:39 -070063 sudo: false
64 compiler: clang
65 env: CFG=linux_trusty-clang-x86_64-msan GN_ARGS="is_debug=false is_msan=true"
Florian Mayer17f77e82018-10-02 19:08:36 +010066# TODO(b/117093687): ubsan always times out in Travis.
Florian Mayer7f61afa2018-10-01 17:19:22 +010067# Re-enable once that is fixed.
Florian Mayer17f77e82018-10-02 19:08:36 +010068 - os: linux
Primiano Tucci600d9272019-05-13 19:53:21 +010069 dist: xenial
Florian Mayer17f77e82018-10-02 19:08:36 +010070 sudo: true
71 compiler: clang
72 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 -070073 - os: linux
Primiano Tucci600d9272019-05-13 19:53:21 +010074 dist: xenial
Primiano Tuccid770e572017-10-01 05:28:39 -070075 sudo: false
Primiano Tuccid770e572017-10-01 05:28:39 -070076 addons:
77 apt:
78 sources:
79 - ubuntu-toolchain-r-test
80 packages:
81 - g++-7
Primiano Tucci7278dea2017-10-31 11:50:32 +000082 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 -070083 - os: linux
Primiano Tucci600d9272019-05-13 19:53:21 +010084 dist: xenial
Primiano Tuccid770e572017-10-01 05:28:39 -070085 sudo: false
86 compiler: clang
87 env: CFG=android-clang-arm-release GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\""
88 - os: linux
Primiano Tucci600d9272019-05-13 19:53:21 +010089 dist: xenial
Florian Mayer5664ea62018-01-10 16:28:35 +000090 sudo: true
Primiano Tuccid770e572017-10-01 05:28:39 -070091 compiler: clang
92 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 +000093 - os: linux
Primiano Tucci600d9272019-05-13 19:53:21 +010094 dist: xenial
Florian Mayer4c3580f2018-02-12 15:59:55 +000095 sudo: true
96 compiler: clang
Florian Mayer631cb2c2018-12-10 18:07:15 +000097 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 +020098 - os: linux
Primiano Tucci600d9272019-05-13 19:53:21 +010099 dist: xenial
Primiano Tuccife199902018-06-04 12:33:04 +0200100 sudo: false
101 compiler: clang
102 env: CFG=ui-clang-x86_64-release GN_ARGS="is_debug=false is_clang=true"
Hector Dearman95b4f942018-07-11 13:29:04 +0100103 - os: linux
Primiano Tucci600d9272019-05-13 19:53:21 +0100104 dist: xenial
Hector Dearman95b4f942018-07-11 13:29:04 +0100105 sudo: false
106 compiler: clang
107 env: CFG=ui-clang-x86_64-debug GN_ARGS="is_debug=true is_clang=true"
108
Primiano Tuccid770e572017-10-01 05:28:39 -0700109
Primiano Tucci636ede12017-10-30 16:03:07 +0000110# Cache the deps that get git-pulled to avoid hitting quota limits (b/68252114).
111# Do not cache NDK/SDK and things that come from .zip files rather than git.
112# Doing that is discouraged (https://docs.travis-ci.com/user/caching/).
113cache:
114 timeout: 1800 # 30 mins
115 directories:
Primiano Tuccif1a25582018-12-07 00:53:51 +0000116 - buildtools/android-core
Primiano Tucci636ede12017-10-30 16:03:07 +0000117 - buildtools/benchmark
Primiano Tuccif1a25582018-12-07 00:53:51 +0000118 - buildtools/bionic
Lalit Maganti367fcd52018-02-05 16:06:13 +0000119 - buildtools/emulator
Primiano Tucci636ede12017-10-30 16:03:07 +0000120 - buildtools/googletest
Primiano Tucci0d72a312018-08-07 14:42:45 +0100121 - buildtools/jsoncpp
Primiano Tucci38faa6f2018-04-01 20:12:08 +0200122 - buildtools/libbacktrace
Primiano Tucci636ede12017-10-30 16:03:07 +0000123 - buildtools/libcxx
124 - buildtools/libcxxabi
Primiano Tuccia65497e2018-09-26 19:53:58 +0100125 - buildtools/libfuzzer
Primiano Tucci7278dea2017-10-31 11:50:32 +0000126 - buildtools/libunwind
Primiano Tuccif1a25582018-12-07 00:53:51 +0000127 - buildtools/linenoise
128 - buildtools/lzma
Primiano Tuccid770e572017-10-01 05:28:39 -0700129
130before_install:
131 - set -e
132 - echo "$CFG" && echo "$GN_ARGS"
Florian Mayer52e594e2018-01-10 18:23:55 +0000133 - export ASAN_SYMBOLIZER_PATH="$(which llvm-symbolizer
134 || echo /usr/bin/llvm-symbolizer-*)"
Lalit Magantidfe69ca2018-10-30 12:18:23 +0000135 - pip install --user protobuf
Primiano Tuccid770e572017-10-01 05:28:39 -0700136
137install:
138 - |
Primiano Tuccife199902018-06-04 12:33:04 +0200139 if [[ "$CFG" == android-* ]]; then
Lalit Maganti367fcd52018-02-05 16:06:13 +0000140 tools/install-build-deps
Primiano Tuccife199902018-06-04 12:33:04 +0200141 elif [[ "$CFG" == ui-* ]]; then
142 tools/install-build-deps --no-android --ui
143 else
144 tools/install-build-deps --no-android
Primiano Tuccid770e572017-10-01 05:28:39 -0700145 fi
Florian Mayer52e594e2018-01-10 18:23:55 +0000146 - |
147 if [[ -e buildtools/clang/bin/llvm-symbolizer ]]; then
148 export ASAN_SYMBOLIZER_PATH="buildtools/clang/bin/llvm-symbolizer"
149 fi
Primiano Tuccid770e572017-10-01 05:28:39 -0700150
151script:
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000152 - tools/gn gen out/dist --args="${GN_ARGS}" --check
Primiano Tuccife199902018-06-04 12:33:04 +0200153 - |
154 if [[ "$CFG" == ui-* ]]; then
Primiano Tucci8478e6d2019-03-10 12:32:24 -0700155 tools/ninja -C out/dist ui 2>&1 | grep -v "no version information"
156 elif [[ "$CFG" == *-libfuzzer ]]; then
157 tools/ninja -C out/dist fuzzers
Primiano Tuccife199902018-06-04 12:33:04 +0200158 else
Primiano Tucci8478e6d2019-03-10 12:32:24 -0700159 tools/ninja -C out/dist
Primiano Tuccife199902018-06-04 12:33:04 +0200160 fi
Primiano Tuccid770e572017-10-01 05:28:39 -0700161 - |
Primiano Tucci7278dea2017-10-31 11:50:32 +0000162 TEST_TARGETS="
Lalit Maganti367fcd52018-02-05 16:06:13 +0000163 perfetto_integrationtests
Lalit Maganti79f2d7b2018-01-23 18:27:33 +0000164 perfetto_unittests
Primiano Tucci7278dea2017-10-31 11:50:32 +0000165 "
Primiano Tuccife199902018-06-04 12:33:04 +0200166 if [[ "$CFG" == ui-* ]]; then
Hector Dearman6c5e1292018-06-27 15:42:32 +0100167 out/dist/ui_unittests --ci
Primiano Tucci8478e6d2019-03-10 12:32:24 -0700168 elif [[ "$CFG" == *-libfuzzer ]]; then
169 # Run a single iteration each to make sure they are not crashing.
170 for fuzzer in $(find out/dist -name '*_fuzzer' -executable); do
171 $fuzzer -runs=1
172 done
Primiano Tuccife199902018-06-04 12:33:04 +0200173 elif [[ "$CFG" == android-* ]]; then
174 TARGET_ARCH=$(echo $CFG | cut -d- -f3)
175 tools/run_android_emulator --pid /tmp/emulator.pid -v &
176 for TEST_TARGET in $TEST_TARGETS; do
177 tools/run_android_test out/dist "$TEST_TARGET"
178 done
179 tools/run_android_test --env BENCHMARK_FUNCTIONAL_TEST_ONLY=true out/dist "perfetto_benchmarks"
180 else
Primiano Tucci7278dea2017-10-31 11:50:32 +0000181 for TEST_TARGET in $TEST_TARGETS; do
182 "out/dist/$TEST_TARGET"
183 done
Lalit Maganti131b6e52018-03-29 18:29:31 +0100184 BENCHMARK_FUNCTIONAL_TEST_ONLY=true out/dist/perfetto_benchmarks
Lalit Magantida1c1d02019-05-08 11:55:50 +0100185
186 tools/diff_test_trace_processor.py --test-type=queries out/dist/trace_processor_shell
187 tools/diff_test_trace_processor.py --test-type=metrics out/dist/trace_processor_shell
Primiano Tuccid770e572017-10-01 05:28:39 -0700188 fi
189
190after_script:
191 - test -f /tmp/emulator.pid && kill -9 $(cat /tmp/emulator.pid); true