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 |
Florian Mayer | 5664ea6 | 2018-01-10 16:28:35 +0000 | [diff] [blame] | 61 | sudo: true |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 62 | compiler: clang |
Florian Mayer | 66038ec | 2018-01-31 14:51:48 +0000 | [diff] [blame] | 63 | env: CFG=linux_trusty-clang-x86_64-asan GN_ARGS="is_debug=false is_asan=true" |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 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 |
Florian Mayer | 5664ea6 | 2018-01-10 16:28:35 +0000 | [diff] [blame] | 76 | sudo: true |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 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 |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 87 | addons: |
| 88 | apt: |
| 89 | sources: |
| 90 | - ubuntu-toolchain-r-test |
| 91 | packages: |
| 92 | - g++-7 |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 93 | 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] | 94 | - 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 Mayer | 5664ea6 | 2018-01-10 16:28:35 +0000 | [diff] [blame] | 101 | sudo: true |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 102 | compiler: clang |
| 103 | env: CFG=android-clang-arm-asan GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\" is_asan=true" |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 104 | |
Primiano Tucci | 636ede1 | 2017-10-30 16:03:07 +0000 | [diff] [blame] | 105 | # 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/). |
| 108 | cache: |
| 109 | timeout: 1800 # 30 mins |
| 110 | directories: |
| 111 | - buildtools/benchmark |
Lalit Maganti | 367fcd5 | 2018-02-05 16:06:13 +0000 | [diff] [blame^] | 112 | - buildtools/emulator |
Primiano Tucci | 636ede1 | 2017-10-30 16:03:07 +0000 | [diff] [blame] | 113 | - buildtools/googletest |
| 114 | - buildtools/libcxx |
| 115 | - buildtools/libcxxabi |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 116 | - buildtools/libunwind |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 117 | |
| 118 | before_install: |
| 119 | - set -e |
| 120 | - echo "$CFG" && echo "$GN_ARGS" |
Florian Mayer | 52e594e | 2018-01-10 18:23:55 +0000 | [diff] [blame] | 121 | - export ASAN_SYMBOLIZER_PATH="$(which llvm-symbolizer |
| 122 | || echo /usr/bin/llvm-symbolizer-*)" |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 123 | |
| 124 | install: |
| 125 | - | |
| 126 | if [[ "$CFG" != android-* ]]; then |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 127 | tools/install-build-deps --no-android |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 128 | else |
Lalit Maganti | 367fcd5 | 2018-02-05 16:06:13 +0000 | [diff] [blame^] | 129 | tools/install-build-deps |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 130 | fi |
Florian Mayer | 52e594e | 2018-01-10 18:23:55 +0000 | [diff] [blame] | 131 | - | |
| 132 | if [[ -e buildtools/clang/bin/llvm-symbolizer ]]; then |
| 133 | export ASAN_SYMBOLIZER_PATH="buildtools/clang/bin/llvm-symbolizer" |
| 134 | fi |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 135 | |
| 136 | script: |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 137 | - tools/gn gen out/dist --args="${GN_ARGS}" --check |
| 138 | - tools/ninja -C out/dist -j8 all |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 139 | - | |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 140 | TEST_TARGETS=" |
Lalit Maganti | 367fcd5 | 2018-02-05 16:06:13 +0000 | [diff] [blame^] | 141 | perfetto_integrationtests |
Lalit Maganti | 79f2d7b | 2018-01-23 18:27:33 +0000 | [diff] [blame] | 142 | perfetto_unittests |
Primiano Tucci | b03ba36 | 2017-12-06 09:47:41 +0000 | [diff] [blame] | 143 | perfetto_benchmarks |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 144 | " |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 145 | if [[ "$CFG" != android-* ]]; then |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 146 | for TEST_TARGET in $TEST_TARGETS; do |
| 147 | "out/dist/$TEST_TARGET" |
| 148 | done |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 149 | else |
| 150 | TARGET_ARCH=$(echo $CFG | cut -d- -f3) |
Lalit Maganti | 367fcd5 | 2018-02-05 16:06:13 +0000 | [diff] [blame^] | 151 | tools/run_android_emulator --pid /tmp/emulator.pid -v & |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 152 | for TEST_TARGET in $TEST_TARGETS; do |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 153 | tools/run_android_test out/dist "$TEST_TARGET" |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 154 | done |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 155 | fi |
| 156 | |
| 157 | after_script: |
| 158 | - test -f /tmp/emulator.pid && kill -9 $(cat /tmp/emulator.pid); true |