blob: c956d1354c880a210db68cf97b32df44f98fc904 [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:
16 email:
17 on_success: never
18 on_failure: always
19
Primiano Tuccid770e572017-10-01 05:28:39 -070020language: cpp
21
Primiano Tucci7278dea2017-10-31 11:50:32 +000022# The |CFG| variable name is hooked up by the perfetto-ci.appspot.com frontend.
23# Please keep infra/perfetto-ci.appspot.com/ updated when adding/removing
24# entries below.
Primiano Tuccid770e572017-10-01 05:28:39 -070025matrix:
26 include:
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"
47 - 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
Primiano Tuccid770e572017-10-01 05:28:39 -070058 env: CFG=linux_trusty-clang-x86_64-debug GN_ARGS="is_debug=true"
59 - os: linux
60 dist: trusty
61 sudo: false
62 compiler: clang
63 env: CFG=linux_trusty-clang-x86_64-asan GN_ARGS="is_debug=false is_asan=true"
64 - 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
76 sudo: false
77 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
87 compiler: gcc
88 env: CFG=linux_trusty-gcc-x86_64-release GN_ARGS="is_debug=false is_clang=false"
89 - os: linux
90 dist: trusty
91 sudo: false
Primiano Tuccid770e572017-10-01 05:28:39 -070092 addons:
93 apt:
94 sources:
95 - ubuntu-toolchain-r-test
96 packages:
97 - g++-7
Primiano Tucci7278dea2017-10-31 11:50:32 +000098 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 -070099 - os: linux
100 dist: trusty
101 sudo: false
102 compiler: clang
103 env: CFG=android-clang-arm-release GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\""
104 - os: linux
105 dist: trusty
106 sudo: false
107 compiler: clang
108 env: CFG=android-clang-arm64-release GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm64\""
109 - os: linux
110 dist: trusty
111 sudo: false
112 compiler: clang
113 env: CFG=android-clang-arm-asan GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\" is_asan=true"
114 - os: linux
115 dist: trusty
116 sudo: false
117 compiler: clang
Primiano Tuccid770e572017-10-01 05:28:39 -0700118 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 -0700119
Primiano Tucci636ede12017-10-30 16:03:07 +0000120# Cache the deps that get git-pulled to avoid hitting quota limits (b/68252114).
121# Do not cache NDK/SDK and things that come from .zip files rather than git.
122# Doing that is discouraged (https://docs.travis-ci.com/user/caching/).
123cache:
124 timeout: 1800 # 30 mins
125 directories:
126 - buildtools/benchmark
127 - buildtools/googletest
128 - buildtools/libcxx
129 - buildtools/libcxxabi
Primiano Tucci7278dea2017-10-31 11:50:32 +0000130 - buildtools/libunwind
Primiano Tuccid770e572017-10-01 05:28:39 -0700131
132before_install:
133 - set -e
134 - echo "$CFG" && echo "$GN_ARGS"
135 - ASAN_SYMBOLIZER_PATH="$(which llvm-symbolizer || echo /usr/bin/llvm-symbolizer-*)"
136
137install:
138 - |
139 if [[ "$CFG" != android-* ]]; then
140 build/install-build-deps --no-android
141 else
142 build/install-build-deps
143 fi
144
145script:
146 - build/gn gen out/dist --args="${GN_ARGS}" --check
147 - build/ninja -C out/dist -j8 all
148 - |
Primiano Tucci7278dea2017-10-31 11:50:32 +0000149 TEST_TARGETS="
150 base_unittests
151 protozero_unittests
152 tracing_unittests
153 tracing_benchmarks
154 sanitizers_unittests
Hector Dearman72a49052017-11-08 14:12:55 +0000155 ftrace_reader_unittests
Primiano Tucci7278dea2017-10-31 11:50:32 +0000156 "
157
Primiano Tuccid770e572017-10-01 05:28:39 -0700158 if [[ "$CFG" != android-* ]]; then
Primiano Tucci7278dea2017-10-31 11:50:32 +0000159 for TEST_TARGET in $TEST_TARGETS; do
160 "out/dist/$TEST_TARGET"
161 done
Primiano Tuccid770e572017-10-01 05:28:39 -0700162 else
163 TARGET_ARCH=$(echo $CFG | cut -d- -f3)
164 build/run_android_emulator $TARGET_ARCH --pid /tmp/emulator.pid -v &
Primiano Tucci7278dea2017-10-31 11:50:32 +0000165 for TEST_TARGET in $TEST_TARGETS; do
166 build/run_android_test out/dist "$TEST_TARGET"
167 done
Primiano Tuccid770e572017-10-01 05:28:39 -0700168 fi
169
170after_script:
171 - test -f /tmp/emulator.pid && kill -9 $(cat /tmp/emulator.pid); true