Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: scripts/travis-build.sh

Issue 1873133003: Add travis CI config (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: More review fixup Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « .travis.yml ('k') | scripts/travis-checkout.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/travis-build.sh
diff --git a/scripts/travis-build.sh b/scripts/travis-build.sh
new file mode 100755
index 0000000000000000000000000000000000000000..d41f7ed00fcd9892078aedc635862ccd62a1a904
--- /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 "$@"
« no previous file with comments | « .travis.yml ('k') | scripts/travis-checkout.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698