blob: bb62583ec4adaca851ba59cb2aff3c2d9b9bd5e1 [file] [log] [blame]
# Copyright (C) 2017 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
notifications:
email: false
language: cpp
# The |CFG| variable name is hooked up by the perfetto-ci.appspot.com frontend.
# Please keep infra/perfetto-ci.appspot.com/ updated when adding/removing
# entries below.
matrix:
include:
# OS X builds are processing too slow and block the queue.
# Commenting out until the problem is resolved.
# - os: osx
# osx_image: xcode8.3
# compiler: clang
# env: CFG=mac-clang-x86_64-release GN_ARGS="is_debug=false"
# - os: osx
# osx_image: xcode8.3
# compiler: clang
# env: CFG=mac-clang-x86_64-debug GN_ARGS="is_debug=true"
# - os: osx
# osx_image: xcode8.3
# compiler: clang
# env: CFG=mac-clang-x86_64-asan GN_ARGS="is_debug=false is_asan=true"
# - os: osx
# osx_image: xcode8.3
# compiler: clang
# env: CFG=mac-clang-x86_64-tsan GN_ARGS="is_debug=false is_tsan=true"
# - os: osx
# osx_image: xcode8.3
# compiler: clang
# env: CFG=mac-clang-x86_64-ubsan GN_ARGS="is_debug=false is_ubsan=true"
- os: linux
dist: trusty
sudo: false
# When setting compiler: clang Travis pull a newer version of clang than
# the version that is shipped with Trusty. This is good for all the other
# configs, but we want to keep at least one target in the matrix to match
# the default version of clang that we have on our workstations.
addons:
apt:
packages:
- clang
env: CFG=linux_trusty-clang-x86_64-debug GN_ARGS="is_debug=true is_hermetic_clang=false"
- os: linux
dist: trusty
sudo: false
compiler: clang
env: CFG=linux_trusty-clang-x86_64-tsan GN_ARGS="is_debug=false is_tsan=true"
- os: linux
dist: trusty
sudo: false
compiler: clang
env: CFG=linux_trusty-clang-x86_64-msan GN_ARGS="is_debug=false is_msan=true"
# TODO(b/117093687): ubsan always times out in Travis.
# Re-enable once that is fixed.
- os: linux
dist: trusty
sudo: true
compiler: clang
env: CFG=linux_trusty-clang-x86_64-asan_lsan GN_ARGS="is_debug=false is_asan=true is_lsan=true"
- os: linux
dist: trusty
sudo: false
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
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\""
- os: linux
dist: trusty
sudo: false
compiler: clang
env: CFG=android-clang-arm-release GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\""
- os: linux
dist: trusty
sudo: true
compiler: clang
env: CFG=android-clang-arm-asan GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\" is_asan=true"
- os: linux
dist: trusty
sudo: true
compiler: clang
env: CFG=linux_trusty-clang-x86_64-libfuzzer GN_ARGS="is_clang=true is_debug=false is_fuzzer=true is_asan=true"
- os: linux
dist: trusty
sudo: false
compiler: clang
env: CFG=ui-clang-x86_64-release GN_ARGS="is_debug=false is_clang=true"
- os: linux
dist: trusty
sudo: false
compiler: clang
env: CFG=ui-clang-x86_64-debug GN_ARGS="is_debug=true is_clang=true"
# Cache the deps that get git-pulled to avoid hitting quota limits (b/68252114).
# Do not cache NDK/SDK and things that come from .zip files rather than git.
# Doing that is discouraged (https://docs.travis-ci.com/user/caching/).
cache:
timeout: 1800 # 30 mins
directories:
- buildtools/android-core
- buildtools/benchmark
- buildtools/bionic
- buildtools/emulator
- buildtools/googletest
- buildtools/jsoncpp
- buildtools/libbacktrace
- buildtools/libcxx
- buildtools/libcxxabi
- buildtools/libfuzzer
- buildtools/libunwind
- buildtools/linenoise
- buildtools/lzma
before_install:
- set -e
- echo "$CFG" && echo "$GN_ARGS"
- export ASAN_SYMBOLIZER_PATH="$(which llvm-symbolizer
|| echo /usr/bin/llvm-symbolizer-*)"
- pip install --user protobuf
install:
- |
if [[ "$CFG" == android-* ]]; then
tools/install-build-deps
elif [[ "$CFG" == ui-* ]]; then
tools/install-build-deps --no-android --ui
else
tools/install-build-deps --no-android
fi
- |
if [[ -e buildtools/clang/bin/llvm-symbolizer ]]; then
export ASAN_SYMBOLIZER_PATH="buildtools/clang/bin/llvm-symbolizer"
fi
script:
- tools/gn gen out/dist --args="${GN_ARGS}" --check
- |
if [[ "$CFG" == ui-* ]]; then
tools/ninja -C out/dist ui 2>&1 | grep -v "no version information"
elif [[ "$CFG" == *-libfuzzer ]]; then
tools/ninja -C out/dist fuzzers
else
tools/ninja -C out/dist
fi
- |
TEST_TARGETS="
perfetto_integrationtests
perfetto_unittests
"
if [[ "$CFG" == ui-* ]]; then
out/dist/ui_unittests --ci
elif [[ "$CFG" == *-libfuzzer ]]; then
# Run a single iteration each to make sure they are not crashing.
for fuzzer in $(find out/dist -name '*_fuzzer' -executable); do
$fuzzer -runs=1
done
elif [[ "$CFG" == android-* ]]; then
TARGET_ARCH=$(echo $CFG | cut -d- -f3)
tools/run_android_emulator --pid /tmp/emulator.pid -v &
for TEST_TARGET in $TEST_TARGETS; do
tools/run_android_test out/dist "$TEST_TARGET"
done
tools/run_android_test --env BENCHMARK_FUNCTIONAL_TEST_ONLY=true out/dist "perfetto_benchmarks"
else
for TEST_TARGET in $TEST_TARGETS; do
"out/dist/$TEST_TARGET"
done
BENCHMARK_FUNCTIONAL_TEST_ONLY=true out/dist/perfetto_benchmarks
tools/diff_test_trace_processor.py --test-type=queries out/dist/trace_processor_shell
tools/diff_test_trace_processor.py --test-type=metrics out/dist/trace_processor_shell
fi
after_script:
- test -f /tmp/emulator.pid && kill -9 $(cat /tmp/emulator.pid); true