Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 1 | # 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 Tucci | 185c8a5 | 2017-11-09 21:27:44 +0000 | [diff] [blame] | 15 | notifications: |
Primiano Tucci | 2a77fe5 | 2017-12-11 10:33:45 +0000 | [diff] [blame] | 16 | email: false |
Primiano Tucci | 185c8a5 | 2017-11-09 21:27:44 +0000 | [diff] [blame] | 17 | |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 18 | language: cpp |
| 19 | |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 20 | # 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 Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 23 | matrix: |
| 24 | include: |
Florian Mayer | b112e9f | 2018-01-26 13:16:10 +0000 | [diff] [blame] | 25 | # 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 Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 47 | - os: linux |
| 48 | dist: trusty |
| 49 | sudo: false |
Primiano Tucci | 24b9672 | 2017-10-30 17:49:11 +0000 | [diff] [blame] | 50 | # 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 Mayer | 6bbffa4 | 2018-01-18 19:04:52 +0000 | [diff] [blame] | 58 | env: CFG=linux_trusty-clang-x86_64-debug GN_ARGS="is_debug=true is_hermetic_clang=false" |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 59 | - os: linux |
| 60 | dist: trusty |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 61 | 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 Mayer | 17f77e8 | 2018-10-02 19:08:36 +0100 | [diff] [blame] | 69 | # TODO(b/117093687): ubsan always times out in Travis. |
Florian Mayer | 7f61afa | 2018-10-01 17:19:22 +0100 | [diff] [blame] | 70 | # Re-enable once that is fixed. |
Florian Mayer | 17f77e8 | 2018-10-02 19:08:36 +0100 | [diff] [blame] | 71 | - 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 Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 76 | - os: linux |
| 77 | dist: trusty |
| 78 | sudo: false |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 79 | addons: |
| 80 | apt: |
| 81 | sources: |
| 82 | - ubuntu-toolchain-r-test |
| 83 | packages: |
| 84 | - g++-7 |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 85 | 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 Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 86 | - 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 Mayer | 5664ea6 | 2018-01-10 16:28:35 +0000 | [diff] [blame] | 93 | sudo: true |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 94 | compiler: clang |
| 95 | env: CFG=android-clang-arm-asan GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\" is_asan=true" |
Florian Mayer | 4c3580f | 2018-02-12 15:59:55 +0000 | [diff] [blame] | 96 | - os: linux |
| 97 | dist: trusty |
| 98 | sudo: true |
| 99 | compiler: clang |
Florian Mayer | 631cb2c | 2018-12-10 18:07:15 +0000 | [diff] [blame] | 100 | env: CFG=linux_trusty-clang-x86_64-libfuzzer GN_ARGS="is_clang=true is_debug=false is_fuzzer=true is_asan=true" |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 101 | - 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 Dearman | 95b4f94 | 2018-07-11 13:29:04 +0100 | [diff] [blame] | 106 | - 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 Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 112 | |
Primiano Tucci | 636ede1 | 2017-10-30 16:03:07 +0000 | [diff] [blame] | 113 | # 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/). |
| 116 | cache: |
| 117 | timeout: 1800 # 30 mins |
| 118 | directories: |
Primiano Tucci | f1a2558 | 2018-12-07 00:53:51 +0000 | [diff] [blame] | 119 | - buildtools/android-core |
Primiano Tucci | 636ede1 | 2017-10-30 16:03:07 +0000 | [diff] [blame] | 120 | - buildtools/benchmark |
Primiano Tucci | f1a2558 | 2018-12-07 00:53:51 +0000 | [diff] [blame] | 121 | - buildtools/bionic |
Lalit Maganti | 367fcd5 | 2018-02-05 16:06:13 +0000 | [diff] [blame] | 122 | - buildtools/emulator |
Primiano Tucci | 636ede1 | 2017-10-30 16:03:07 +0000 | [diff] [blame] | 123 | - buildtools/googletest |
Primiano Tucci | 0d72a31 | 2018-08-07 14:42:45 +0100 | [diff] [blame] | 124 | - buildtools/jsoncpp |
Primiano Tucci | 38faa6f | 2018-04-01 20:12:08 +0200 | [diff] [blame] | 125 | - buildtools/libbacktrace |
Primiano Tucci | 636ede1 | 2017-10-30 16:03:07 +0000 | [diff] [blame] | 126 | - buildtools/libcxx |
| 127 | - buildtools/libcxxabi |
Primiano Tucci | a65497e | 2018-09-26 19:53:58 +0100 | [diff] [blame] | 128 | - buildtools/libfuzzer |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 129 | - buildtools/libunwind |
Primiano Tucci | f1a2558 | 2018-12-07 00:53:51 +0000 | [diff] [blame] | 130 | - buildtools/linenoise |
| 131 | - buildtools/lzma |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 132 | |
| 133 | before_install: |
| 134 | - set -e |
| 135 | - echo "$CFG" && echo "$GN_ARGS" |
Florian Mayer | 52e594e | 2018-01-10 18:23:55 +0000 | [diff] [blame] | 136 | - export ASAN_SYMBOLIZER_PATH="$(which llvm-symbolizer |
| 137 | || echo /usr/bin/llvm-symbolizer-*)" |
Lalit Maganti | dfe69ca | 2018-10-30 12:18:23 +0000 | [diff] [blame] | 138 | - pip install --user protobuf |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 139 | |
| 140 | install: |
| 141 | - | |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 142 | if [[ "$CFG" == android-* ]]; then |
Lalit Maganti | 367fcd5 | 2018-02-05 16:06:13 +0000 | [diff] [blame] | 143 | tools/install-build-deps |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 144 | elif [[ "$CFG" == ui-* ]]; then |
| 145 | tools/install-build-deps --no-android --ui |
| 146 | else |
| 147 | tools/install-build-deps --no-android |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 148 | fi |
Florian Mayer | 52e594e | 2018-01-10 18:23:55 +0000 | [diff] [blame] | 149 | - | |
| 150 | if [[ -e buildtools/clang/bin/llvm-symbolizer ]]; then |
| 151 | export ASAN_SYMBOLIZER_PATH="buildtools/clang/bin/llvm-symbolizer" |
| 152 | fi |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 153 | |
| 154 | script: |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 155 | - tools/gn gen out/dist --args="${GN_ARGS}" --check |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 156 | - | |
| 157 | if [[ "$CFG" == ui-* ]]; then |
Primiano Tucci | 8478e6d | 2019-03-10 12:32:24 -0700 | [diff] [blame] | 158 | 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 Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 161 | else |
Primiano Tucci | 8478e6d | 2019-03-10 12:32:24 -0700 | [diff] [blame] | 162 | tools/ninja -C out/dist |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 163 | fi |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 164 | - | |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 165 | TEST_TARGETS=" |
Lalit Maganti | 367fcd5 | 2018-02-05 16:06:13 +0000 | [diff] [blame] | 166 | perfetto_integrationtests |
Lalit Maganti | 79f2d7b | 2018-01-23 18:27:33 +0000 | [diff] [blame] | 167 | perfetto_unittests |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 168 | " |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 169 | if [[ "$CFG" == ui-* ]]; then |
Hector Dearman | 6c5e129 | 2018-06-27 15:42:32 +0100 | [diff] [blame] | 170 | out/dist/ui_unittests --ci |
Primiano Tucci | 8478e6d | 2019-03-10 12:32:24 -0700 | [diff] [blame] | 171 | 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 Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 176 | 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 Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 184 | for TEST_TARGET in $TEST_TARGETS; do |
| 185 | "out/dist/$TEST_TARGET" |
| 186 | done |
Lalit Maganti | 131b6e5 | 2018-03-29 18:29:31 +0100 | [diff] [blame] | 187 | BENCHMARK_FUNCTIONAL_TEST_ONLY=true out/dist/perfetto_benchmarks |
Lalit Maganti | 14160fc | 2018-10-17 12:31:40 +0100 | [diff] [blame] | 188 | tools/diff_test_trace_processor.py out/dist/trace_processor_shell |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 189 | fi |
| 190 | |
| 191 | after_script: |
| 192 | - test -f /tmp/emulator.pid && kill -9 $(cat /tmp/emulator.pid); true |