about summary refs log tree commit diff
path: root/ci
diff options
context:
space:
mode:
Diffstat (limited to 'ci')
-rwxr-xr-xci/macos_xcode_bazel.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/ci/macos_xcode_bazel.sh b/ci/macos_xcode_bazel.sh
index f0f142801dee..3e13b1538c74 100755
--- a/ci/macos_xcode_bazel.sh
+++ b/ci/macos_xcode_bazel.sh
@@ -23,16 +23,25 @@ if [ -z ${ABSEIL_ROOT:-} ]; then
   ABSEIL_ROOT="$(realpath $(dirname ${0})/..)"
 fi
 
-# Print the default compiler and Bazel versions.
+# If we are running on Kokoro, check for a versioned Bazel binary.
+KOKORO_GFILE_BAZEL_BIN="bazel-0.28.1-darwin-x86_64"
+if [ ${KOKORO_GFILE_DIR:-} ] && [ -f ${KOKORO_GFILE_DIR}/${KOKORO_GFILE_BAZEL_BIN} ]; then
+  BAZEL_BIN="${KOKORO_GFILE_DIR}/${KOKORO_GFILE_BAZEL_BIN}"
+  chmod +x ${BAZEL_BIN}
+else
+  BAZEL_BIN="bazel"
+fi
+
+# Print the compiler and Bazel versions.
 echo "---------------"
 gcc -v
 echo "---------------"
-bazel version
+${BAZEL_BIN} version
 echo "---------------"
 
 cd ${ABSEIL_ROOT}
 
-bazel test ... \
+${BAZEL_BIN} test ... \
   --copt=-Werror \
   --keep_going \
   --show_timestamps \