blob: 315cdfcf75a0c0a445ce8e0e256f1acefec2be8d [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:
25 - os: osx
26 osx_image: xcode8.3
27 compiler: clang
28 env: CFG=mac-clang-x86_64-release GN_ARGS="is_debug=false"
29 - os: osx
30 osx_image: xcode8.3
31 compiler: clang
32 env: CFG=mac-clang-x86_64-debug GN_ARGS="is_debug=true"
33 - os: osx
34 osx_image: xcode8.3
35 compiler: clang
36 env: CFG=mac-clang-x86_64-asan GN_ARGS="is_debug=false is_asan=true"
37 - os: osx
38 osx_image: xcode8.3
39 compiler: clang
40 env: CFG=mac-clang-x86_64-tsan GN_ARGS="is_debug=false is_tsan=true"
41 - os: osx
42 osx_image: xcode8.3
43 compiler: clang
44 env: CFG=mac-clang-x86_64-ubsan GN_ARGS="is_debug=false is_ubsan=true"
45 - os: linux
46 dist: trusty
47 sudo: false
Primiano Tucci24b96722017-10-30 17:49:11 +000048 # When setting compiler: clang Travis pull a newer version of clang than
49 # the version that is shipped with Trusty. This is good for all the other
50 # configs, but we want to keep at least one target in the matrix to match
51 # the default version of clang that we have on our workstations.
52 addons:
53 apt:
54 packages:
55 - clang
Primiano Tuccid770e572017-10-01 05:28:39 -070056 env: CFG=linux_trusty-clang-x86_64-debug GN_ARGS="is_debug=true"
57 - os: linux
58 dist: trusty
59 sudo: false
60 compiler: clang
61 env: CFG=linux_trusty-clang-x86_64-asan GN_ARGS="is_debug=false is_asan=true"
62 - os: linux
63 dist: trusty
64 sudo: false
65 compiler: clang
66 env: CFG=linux_trusty-clang-x86_64-tsan GN_ARGS="is_debug=false is_tsan=true"
67 - os: linux
68 dist: trusty
69 sudo: false
70 compiler: clang
71 env: CFG=linux_trusty-clang-x86_64-msan GN_ARGS="is_debug=false is_msan=true"
72 - os: linux
73 dist: trusty
74 sudo: false
75 compiler: clang
76 env: CFG=linux_trusty-clang-x86_64-lsan GN_ARGS="is_debug=false is_lsan=true"
77 - os: linux
78 dist: trusty
79 sudo: false
80 compiler: clang
81 env: CFG=linux_trusty-clang-x86_64-ubsan GN_ARGS="is_debug=false is_ubsan=true"
82 - os: linux
83 dist: trusty
84 sudo: false
Primiano Tuccid770e572017-10-01 05:28:39 -070085 addons:
86 apt:
87 sources:
88 - ubuntu-toolchain-r-test
89 packages:
90 - g++-7
Primiano Tucci7278dea2017-10-31 11:50:32 +000091 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 -070092 - os: linux
93 dist: trusty
94 sudo: false
95 compiler: clang
96 env: CFG=android-clang-arm-release GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\""
97 - os: linux
98 dist: trusty
99 sudo: false
100 compiler: clang
101 env: CFG=android-clang-arm64-release GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm64\""
102 - os: linux
103 dist: trusty
104 sudo: false
105 compiler: clang
106 env: CFG=android-clang-arm-asan GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\" is_asan=true"
107 - os: linux
108 dist: trusty
109 sudo: false
110 compiler: clang
Primiano Tuccid770e572017-10-01 05:28:39 -0700111 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 -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:
119 - buildtools/benchmark
120 - buildtools/googletest
121 - buildtools/libcxx
122 - buildtools/libcxxabi
Primiano Tucci7278dea2017-10-31 11:50:32 +0000123 - buildtools/libunwind
Primiano Tuccid770e572017-10-01 05:28:39 -0700124
125before_install:
126 - set -e
127 - echo "$CFG" && echo "$GN_ARGS"
128 - ASAN_SYMBOLIZER_PATH="$(which llvm-symbolizer || echo /usr/bin/llvm-symbolizer-*)"
129
130install:
131 - |
132 if [[ "$CFG" != android-* ]]; then
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000133 tools/install-build-deps --no-android
Primiano Tuccid770e572017-10-01 05:28:39 -0700134 else
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000135 tools/install-build-deps
Primiano Tuccid770e572017-10-01 05:28:39 -0700136 fi
137
138script:
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000139 - tools/gn gen out/dist --args="${GN_ARGS}" --check
140 - tools/ninja -C out/dist -j8 all
Primiano Tuccid770e572017-10-01 05:28:39 -0700141 - |
Primiano Tucci7278dea2017-10-31 11:50:32 +0000142 TEST_TARGETS="
Primiano Tuccib03ba362017-12-06 09:47:41 +0000143 perfetto_tests
144 perfetto_benchmarks
Primiano Tucci7278dea2017-10-31 11:50:32 +0000145 "
Primiano Tuccid770e572017-10-01 05:28:39 -0700146 if [[ "$CFG" != android-* ]]; then
Primiano Tucci7278dea2017-10-31 11:50:32 +0000147 for TEST_TARGET in $TEST_TARGETS; do
148 "out/dist/$TEST_TARGET"
149 done
Primiano Tuccid770e572017-10-01 05:28:39 -0700150 else
151 TARGET_ARCH=$(echo $CFG | cut -d- -f3)
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000152 tools/run_android_emulator $TARGET_ARCH --pid /tmp/emulator.pid -v &
Primiano Tucci7278dea2017-10-31 11:50:32 +0000153 for TEST_TARGET in $TEST_TARGETS; do
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000154 tools/run_android_test out/dist "$TEST_TARGET"
Primiano Tucci7278dea2017-10-31 11:50:32 +0000155 done
Primiano Tuccid770e572017-10-01 05:28:39 -0700156 fi
157
158after_script:
159 - test -f /tmp/emulator.pid && kill -9 $(cat /tmp/emulator.pid); true