diff --git a/jflex/examples/.travis.bazelrc b/jflex/examples/.travis.bazelrc new file mode 100644 index 000000000..2189a6936 --- /dev/null +++ b/jflex/examples/.travis.bazelrc @@ -0,0 +1,17 @@ +# Taken from https://github.com/korfuri/bazel-travis/blob/master/.bazelrc + +# This is from Bazel's former travis setup, to avoid blowing up the RAM usage. +startup --host_jvm_args=-Xms2000m +startup --host_jvm_args=-Xmx3000m +test --ram_utilization_factor=10 + +# This is so we understand failures better +build --verbose_failures +test --test_output=errors + +# This is so we don't use sandboxed execution. Sandboxed execution +# runs stuff in a container, and since Travis already runs its script +# in a container (unless you require sudo in your .travis.yml) this +# fails to run tests. +# build --spawn_strategy=standalone --genrule_strategy=standalone +# test --test_strategy=standalone diff --git a/scripts/bazel.sh b/scripts/bazel.sh index 3899623ab..289be079e 100755 --- a/scripts/bazel.sh +++ b/scripts/bazel.sh @@ -8,16 +8,22 @@ source "$BASEDIR"/scripts/logger.sh # fail on error set -e +if [[ $TRAVIS ]]; then + BAZEL='bazel --bazelrc=$TRAVIS_BUILD_DIR/.travis.bazelrc' +else + BAZEL='bazel' +fi + logi "Start Bazel" logi "===========" cd jflex/examples -bazel start +$BAZEL start logi "Build everything" -bazel build //... +$BAZEL build //... logi "Test everything" logi "===============" -bazel test //.. +$BAZEL test //.. cd "$CWD"