From 0203b0cbddeffff2f408338f10a5f775c0d2f5a7 Mon Sep 17 00:00:00 2001 From: Ted Mielczarek Date: Tue, 12 Apr 2016 14:55:52 -0400 Subject: Add travis CI config This will let us setup travis-ci on the Breakpad GitHub mirror. R=vapier@chromium.org, mark@chromium.org BUG= Review URL: https://codereview.chromium.org/1873133003 . --- scripts/travis-build.sh | 32 ++++++++++++++++++++++++++++++++ scripts/travis-checkout.sh | 24 ++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100755 scripts/travis-build.sh create mode 100755 scripts/travis-checkout.sh (limited to 'scripts') diff --git a/scripts/travis-build.sh b/scripts/travis-build.sh new file mode 100755 index 00000000..d41f7ed0 --- /dev/null +++ b/scripts/travis-build.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +set -ex + +setup_env() { + # Travis sets CC/CXX to the system toolchain, so our .travis.yml + # exports USE_{CC,CXX} for this script to use. + if [ -n "$USE_CC" ]; then + export CC=$USE_CC + fi + if [ -n "$USE_CXX" ]; then + export CXX=$USE_CXX + fi + # Use -jN for faster builds. Travis build machines under Docker + # have a lot of cores, but are memory-limited, so the kernel + # will OOM if we try to use them all, so use at most 4. + # See https://github.com/travis-ci/travis-ci/issues/1972 + export NCPUS=$(getconf _NPROCESSORS_ONLN) + export JOBS=$(( $NCPUS < 4 ? $NCPUS : 4 )) +} + +build() { + ./configure + make -j${JOBS} check +} + +main() { + setup_env + build +} + +main "$@" diff --git a/scripts/travis-checkout.sh b/scripts/travis-checkout.sh new file mode 100755 index 00000000..f46e510d --- /dev/null +++ b/scripts/travis-checkout.sh @@ -0,0 +1,24 @@ +#!/bin/sh +set -ex + +get_depot_tools() { + cd + git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git + PATH="$HOME/depot_tools:$PATH" +} + +gclient_sync() { + # Rename the source dir to match what gclient expects. + srcdir=$(basename "$TRAVIS_BUILD_DIR") + cd "${TRAVIS_BUILD_DIR}"/.. + mv "${srcdir}" src + gclient config --unmanaged https://github.com/google/breakpad.git + gclient sync +} + +main() { + get_depot_tools + gclient_sync +} + +main "$@" -- cgit v1.2.1