# Limit resources since GitHub Actions VMs have 2 cores and 7 GB RAM.
build --local_cpu_resources=20
build --local_ram_resources=12000
build --worker_max_instances=20

# Ensure sandboxing is on to increase hermeticity.
build --spawn_strategy=sandboxed
build --worker_sandboxing

# Ensure the PATH env var from our virtualenv propagates into tests, which is
# no longer on by default in Bazel 0.21.0 and possibly again in the future.
# We set this flag for "build" since "test" inherits it, but if we don't set
# it for build too, this causes a rebuild at test time, and if we set it for
# both we hit https://github.com/bazelbuild/bazel/issues/8237.
#
# See also:
# https://github.com/bazelbuild/bazel/issues/7095 (protobuf PATH sensitivity)
# https://github.com/bazelbuild/bazel/issues/7026 (future of action_env)
build --action_env=PATH

# Log more information to help with debugging.
build --verbose_failures
build --worker_verbose
test --test_output=errors
test --test_verbose_timeout_warnings

# Enable remote caching. This cache is publicly readable, but only writable on
# trusted commits (e.g., commits to master). We don't write the actual test
# statuses (or read them if they happen to be there) because not all tests are
# actually hermetic, and they run pretty quickly, anyway.
#common --remote_cache=https://storage.googleapis.com/tensorboard-build-cache
common --remote_upload_local_results=false
test --remote_upload_local_results=false
test --cache_test_results=false
