Skip to content

Commit

Permalink
OSSM-1297: Use a remote build cache, if it exists (maistra#153)
Browse files Browse the repository at this point in the history
This is intended to work in CI and in local development workflow as
 well.
  • Loading branch information
jwendell authored Apr 4, 2022
1 parent 833fdf6 commit 0428980
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions maistra/run-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,36 @@ export ARCH
export BUILD_SCM_REVISION="Maistra PR #${PULL_NUMBER:-undefined}"
export BUILD_SCM_STATUS="SHA=${PULL_PULL_SHA:-undefined}"

COMMON_FLAGS="\
--incompatible_linkopts_to_linklibs \
--local_ram_resources=12288 \
--local_cpu_resources=6 \
--jobs=3 \
--deleted_packages=test/common/quic,test/common/quic/platform \
--//bazel:http3=false \
--verbose_failures \
--color=no \
"

if [ -n "${BAZEL_REMOTE_CACHE}" ]; then
COMMON_FLAGS+=" --remote_cache=${BAZEL_REMOTE_CACHE} "
elif [ -n "${BAZEL_DISK_CACHE}" ]; then
COMMON_FLAGS+=" --disk_cache=${BAZEL_DISK_CACHE} "
fi

# Build
time bazel build \
--incompatible_linkopts_to_linklibs \
--local_ram_resources=12288 \
--local_cpu_resources=6 \
--jobs=3 \
--disk_cache=/bazel-cache \
--deleted_packages=test/common/quic,test/common/quic/platform \
--//bazel:http3=false \
${COMMON_FLAGS} \
//source/exe:envoy-static

echo "Build succeeded. Binary generated:"
bazel-bin/source/exe/envoy-static --version

# Run tests
time bazel test \
--incompatible_linkopts_to_linklibs \
--local_ram_resources=12288 \
--local_cpu_resources=6 \
--jobs=3 \
${COMMON_FLAGS} \
--build_tests_only \
--test_env=ENVOY_IP_TEST_VERSIONS=v4only \
--test_output=all \
--disk_cache=/bazel-cache \
--deleted_packages=test/common/quic,test/common/quic/platform \
--//bazel:http3=false \
//test/...

0 comments on commit 0428980

Please sign in to comment.