blob: b05c9667f36337806a69fd65cbdcf4e91fbf1dc0 [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
Florian Mayer5664ea62018-01-10 16:28:35 +000061 sudo: true
Primiano Tuccid770e572017-10-01 05:28:39 -070062 compiler: clang
Florian Mayer66038ec2018-01-31 14:51:48 +000063 env: CFG=linux_trusty-clang-x86_64-asan GN_ARGS="is_debug=false is_asan=true"
Primiano Tuccid770e572017-10-01 05:28:39 -070064 - 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
Florian Mayer5664ea62018-01-10 16:28:35 +000076 sudo: true
Primiano Tuccid770e572017-10-01 05:28:39 -070077 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
Florian Mayer5664ea62018-01-10 16:28:35 +0000101 sudo: true
Primiano Tuccid770e572017-10-01 05:28:39 -0700102 compiler: clang
103 env: CFG=android-clang-arm-asan GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\" is_asan=true"
Primiano Tuccid770e572017-10-01 05:28:39 -0700104
Primiano Tucci636ede12017-10-30 16:03:07 +0000105# Cache the deps that get git-pulled to avoid hitting quota limits (b/68252114).
106# Do not cache NDK/SDK and things that come from .zip files rather than git.
107# Doing that is discouraged (https://docs.travis-ci.com/user/caching/).
108cache:
109 timeout: 1800 # 30 mins
110 directories:
111 - buildtools/benchmark
Lalit Maganti367fcd52018-02-05 16:06:13 +0000112 - buildtools/emulator
Primiano Tucci636ede12017-10-30 16:03:07 +0000113 - buildtools/googletest
114 - buildtools/libcxx
115 - buildtools/libcxxabi
Primiano Tucci7278dea2017-10-31 11:50:32 +0000116 - buildtools/libunwind
Primiano Tuccid770e572017-10-01 05:28:39 -0700117
118before_install:
119 - set -e
120 - echo "$CFG" && echo "$GN_ARGS"
Florian Mayer52e594e2018-01-10 18:23:55 +0000121 - export ASAN_SYMBOLIZER_PATH="$(which llvm-symbolizer
122 || echo /usr/bin/llvm-symbolizer-*)"
Primiano Tuccid770e572017-10-01 05:28:39 -0700123
124install:
125 - |
126 if [[ "$CFG" != android-* ]]; then
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000127 tools/install-build-deps --no-android
Primiano Tuccid770e572017-10-01 05:28:39 -0700128 else
Lalit Maganti367fcd52018-02-05 16:06:13 +0000129 tools/install-build-deps
Primiano Tuccid770e572017-10-01 05:28:39 -0700130 fi
Florian Mayer52e594e2018-01-10 18:23:55 +0000131 - |
132 if [[ -e buildtools/clang/bin/llvm-symbolizer ]]; then
133 export ASAN_SYMBOLIZER_PATH="buildtools/clang/bin/llvm-symbolizer"
134 fi
Primiano Tuccid770e572017-10-01 05:28:39 -0700135
136script:
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000137 - tools/gn gen out/dist --args="${GN_ARGS}" --check
138 - tools/ninja -C out/dist -j8 all
Primiano Tuccid770e572017-10-01 05:28:39 -0700139 - |
Primiano Tucci7278dea2017-10-31 11:50:32 +0000140 TEST_TARGETS="
Lalit Maganti367fcd52018-02-05 16:06:13 +0000141 perfetto_integrationtests
Lalit Maganti79f2d7b2018-01-23 18:27:33 +0000142 perfetto_unittests
Primiano Tuccib03ba362017-12-06 09:47:41 +0000143 perfetto_benchmarks
Primiano Tucci7278dea2017-10-31 11:50:32 +0000144 "
Primiano Tuccid770e572017-10-01 05:28:39 -0700145 if [[ "$CFG" != android-* ]]; then
Primiano Tucci7278dea2017-10-31 11:50:32 +0000146 for TEST_TARGET in $TEST_TARGETS; do
147 "out/dist/$TEST_TARGET"
148 done
Primiano Tuccid770e572017-10-01 05:28:39 -0700149 else
150 TARGET_ARCH=$(echo $CFG | cut -d- -f3)
Lalit Maganti367fcd52018-02-05 16:06:13 +0000151 tools/run_android_emulator --pid /tmp/emulator.pid -v &
Primiano Tucci7278dea2017-10-31 11:50:32 +0000152 for TEST_TARGET in $TEST_TARGETS; do
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000153 tools/run_android_test out/dist "$TEST_TARGET"
Primiano Tucci7278dea2017-10-31 11:50:32 +0000154 done
Primiano Tuccid770e572017-10-01 05:28:39 -0700155 fi
156
157after_script:
158 - test -f /tmp/emulator.pid && kill -9 $(cat /tmp/emulator.pid); true