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 | |
| 15 | language: cpp |
| 16 | |
| 17 | matrix: |
| 18 | include: |
| 19 | - os: osx |
| 20 | osx_image: xcode8.3 |
| 21 | compiler: clang |
| 22 | env: CFG=mac-clang-x86_64-release GN_ARGS="is_debug=false" |
| 23 | - os: osx |
| 24 | osx_image: xcode8.3 |
| 25 | compiler: clang |
| 26 | env: CFG=mac-clang-x86_64-debug GN_ARGS="is_debug=true" |
| 27 | - os: osx |
| 28 | osx_image: xcode8.3 |
| 29 | compiler: clang |
| 30 | env: CFG=mac-clang-x86_64-asan GN_ARGS="is_debug=false is_asan=true" |
| 31 | - os: osx |
| 32 | osx_image: xcode8.3 |
| 33 | compiler: clang |
| 34 | env: CFG=mac-clang-x86_64-tsan GN_ARGS="is_debug=false is_tsan=true" |
| 35 | - os: osx |
| 36 | osx_image: xcode8.3 |
| 37 | compiler: clang |
| 38 | env: CFG=mac-clang-x86_64-ubsan GN_ARGS="is_debug=false is_ubsan=true" |
| 39 | - os: linux |
| 40 | dist: trusty |
| 41 | sudo: false |
| 42 | compiler: clang |
| 43 | env: CFG=linux_trusty-clang-x86_64-debug GN_ARGS="is_debug=true" |
| 44 | - os: linux |
| 45 | dist: trusty |
| 46 | sudo: false |
| 47 | compiler: clang |
| 48 | env: CFG=linux_trusty-clang-x86_64-asan GN_ARGS="is_debug=false is_asan=true" |
| 49 | - os: linux |
| 50 | dist: trusty |
| 51 | sudo: false |
| 52 | compiler: clang |
| 53 | env: CFG=linux_trusty-clang-x86_64-tsan GN_ARGS="is_debug=false is_tsan=true" |
| 54 | - os: linux |
| 55 | dist: trusty |
| 56 | sudo: false |
| 57 | compiler: clang |
| 58 | env: CFG=linux_trusty-clang-x86_64-msan GN_ARGS="is_debug=false is_msan=true" |
| 59 | - os: linux |
| 60 | dist: trusty |
| 61 | sudo: false |
| 62 | compiler: clang |
| 63 | env: CFG=linux_trusty-clang-x86_64-lsan GN_ARGS="is_debug=false is_lsan=true" |
| 64 | - os: linux |
| 65 | dist: trusty |
| 66 | sudo: false |
| 67 | compiler: clang |
| 68 | env: CFG=linux_trusty-clang-x86_64-ubsan GN_ARGS="is_debug=false is_ubsan=true" |
| 69 | - os: linux |
| 70 | dist: trusty |
| 71 | sudo: false |
| 72 | compiler: gcc |
| 73 | env: CFG=linux_trusty-gcc-x86_64-release GN_ARGS="is_debug=false is_clang=false" |
| 74 | - os: linux |
| 75 | dist: trusty |
| 76 | sudo: false |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 77 | addons: |
| 78 | apt: |
| 79 | sources: |
| 80 | - ubuntu-toolchain-r-test |
| 81 | packages: |
| 82 | - g++-7 |
| 83 | env: CFG=linux_trusty-gcc7-x86_64-release GN_ARGS="is_debug=false is_clang=false cc=\"gcc-7\" cxx=\"g++-7\"" |
| 84 | - os: linux |
| 85 | dist: trusty |
| 86 | sudo: false |
| 87 | compiler: clang |
| 88 | env: CFG=android-clang-arm-release GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\"" |
| 89 | - os: linux |
| 90 | dist: trusty |
| 91 | sudo: false |
| 92 | compiler: clang |
| 93 | env: CFG=android-clang-arm64-release GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm64\"" |
| 94 | - os: linux |
| 95 | dist: trusty |
| 96 | sudo: false |
| 97 | compiler: clang |
| 98 | env: CFG=android-clang-arm-asan GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\" is_asan=true" |
| 99 | - os: linux |
| 100 | dist: trusty |
| 101 | sudo: false |
| 102 | compiler: clang |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 103 | env: CFG=android-clang-arm64-asan GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm64\" 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 |
| 112 | - buildtools/googletest |
| 113 | - buildtools/libcxx |
| 114 | - buildtools/libcxxabi |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 115 | |
| 116 | before_install: |
| 117 | - set -e |
| 118 | - echo "$CFG" && echo "$GN_ARGS" |
| 119 | - ASAN_SYMBOLIZER_PATH="$(which llvm-symbolizer || echo /usr/bin/llvm-symbolizer-*)" |
| 120 | |
| 121 | install: |
| 122 | - | |
| 123 | if [[ "$CFG" != android-* ]]; then |
| 124 | build/install-build-deps --no-android |
| 125 | else |
| 126 | build/install-build-deps |
| 127 | fi |
| 128 | |
| 129 | script: |
| 130 | - build/gn gen out/dist --args="${GN_ARGS}" --check |
| 131 | - build/ninja -C out/dist -j8 all |
| 132 | - | |
| 133 | if [[ "$CFG" != android-* ]]; then |
Primiano Tucci | 1333134 | 2017-10-25 17:08:13 +0100 | [diff] [blame] | 134 | out/dist/base_unittests |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 135 | out/dist/protozero_unittests |
Primiano Tucci | ce72002 | 2017-10-30 12:50:06 +0000 | [diff] [blame] | 136 | out/dist/tracing_unittests |
| 137 | out/dist/tracing_benchmarks |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 138 | else |
| 139 | TARGET_ARCH=$(echo $CFG | cut -d- -f3) |
| 140 | build/run_android_emulator $TARGET_ARCH --pid /tmp/emulator.pid -v & |
Primiano Tucci | 1333134 | 2017-10-25 17:08:13 +0100 | [diff] [blame] | 141 | build/run_android_test out/dist base_unittests |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 142 | build/run_android_test out/dist protozero_unittests |
Primiano Tucci | ce72002 | 2017-10-30 12:50:06 +0000 | [diff] [blame] | 143 | build/run_android_test out/dist tracing_unittests |
| 144 | build/run_android_test out/dist tracing_benchmarks |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 145 | fi |
| 146 | |
| 147 | after_script: |
| 148 | - test -f /tmp/emulator.pid && kill -9 $(cat /tmp/emulator.pid); true |