From eaa843b55ff694ad6313a306c77c44971912370d Mon Sep 17 00:00:00 2001 From: Chuck Jazdzewski Date: Thu, 20 Jul 2017 09:40:40 -0700 Subject: [PATCH] ci: test bazel builds on travis (#18240) --- .travis.yml | 1 + scripts/ci/build.sh | 3 +++ scripts/ci/install.sh | 14 ++++++++++++++ scripts/ci/test-bazel.sh | 5 +++++ scripts/ci/test.sh | 3 +++ 5 files changed, 26 insertions(+) create mode 100755 scripts/ci/test-bazel.sh diff --git a/.travis.yml b/.travis.yml index 49dbef9662..70d33c971c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,6 +53,7 @@ env: - CI_MODE=docs_test - CI_MODE=aio - CI_MODE=aio_e2e + - CI_MODE=bazel matrix: fast_finish: true diff --git a/scripts/ci/build.sh b/scripts/ci/build.sh index e572aadf3e..3268d989c5 100755 --- a/scripts/ci/build.sh +++ b/scripts/ci/build.sh @@ -14,6 +14,9 @@ if [[ ${TRAVIS_TEST_RESULT=0} == 1 ]]; then exit 1; fi +if [[ ${CI_MODE:-} == "bazel" ]]; then + exit 0; +fi travisFoldStart "tsc tools" $(npm bin)/tsc -p tools diff --git a/scripts/ci/install.sh b/scripts/ci/install.sh index 7d555f9221..5d4aff6fe0 100755 --- a/scripts/ci/install.sh +++ b/scripts/ci/install.sh @@ -59,6 +59,20 @@ if [[ ${TRAVIS} && (${CI_MODE} == "aio" || ${CI_MODE} == "aio_e2e" || ${CI_MODE} travisFoldEnd "yarn-install.aio" fi +# Install bazel +if [[ ${TRAVIS} && ${CI_MODE} == "bazel" ]]; then + travisFoldStart "bazel-install" + ( + mkdir tmp + cd tmp + curl --location --compressed https://github.com/bazelbuild/bazel/releases/download/0.5.2/bazel-0.5.2-installer-linux-x86_64.sh > bazel-0.5.2-installer-linux-x86_64.sh + chmod +x bazel-0.5.2-installer-linux-x86_64.sh + ./bazel-0.5.2-installer-linux-x86_64.sh --user + cd .. + rm -rf tmp + ) + travisFoldEnd "bazel-install" +fi # Install Chromium if [[ ${CI_MODE} == "js" || ${CI_MODE} == "e2e" || ${CI_MODE} == "e2e_2" || ${CI_MODE} == "aio" || ${CI_MODE} == "aio_e2e" ]]; then diff --git a/scripts/ci/test-bazel.sh b/scripts/ci/test-bazel.sh new file mode 100755 index 0000000000..8af994dbe5 --- /dev/null +++ b/scripts/ci/test-bazel.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -u -e -o pipefail + +bazel build ... \ No newline at end of file diff --git a/scripts/ci/test.sh b/scripts/ci/test.sh index 8b5cffe5c9..d8f08932b3 100755 --- a/scripts/ci/test.sh +++ b/scripts/ci/test.sh @@ -46,4 +46,7 @@ case ${CI_MODE} in aio_e2e) ${thisDir}/test-aio-e2e.sh ;; + bazel) + ${thisDir}/test-bazel.sh + ;; esac