mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 22:35:42 +00:00
61 lines
1.2 KiB
Bash
Executable File
61 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
usage() {
|
|
echo "Usage: $0 <warm|verify> [bazel targets...]"
|
|
echo
|
|
echo "warm: build targets normally so local results can upload to the remote cache"
|
|
echo "verify: require all target actions to be available from remote cache"
|
|
}
|
|
|
|
if [ "$#" -lt 1 ]; then
|
|
usage
|
|
exit 2
|
|
fi
|
|
|
|
mode="$1"
|
|
shift
|
|
|
|
case "$mode" in
|
|
warm | verify)
|
|
;;
|
|
*)
|
|
usage
|
|
exit 2
|
|
;;
|
|
esac
|
|
|
|
targets=("$@")
|
|
if [ "${#targets[@]}" -eq 0 ]; then
|
|
targets=(
|
|
"//src/main/cpp/net/eagle0/shardok/library:engine"
|
|
"//src/main/scala/net/eagle0/eagle:eagle_server"
|
|
)
|
|
fi
|
|
|
|
tmp_root="${RUNNER_TEMP:-/private/tmp}"
|
|
run_id="${GITHUB_RUN_ID:-local}-$$"
|
|
output_base="${tmp_root%/}/eagle0-cache-parity-${mode}-${run_id}"
|
|
|
|
echo "Mode: $mode"
|
|
echo "Output base: $output_base"
|
|
echo "Targets:"
|
|
printf ' %s\n' "${targets[@]}"
|
|
|
|
bazel_args=(
|
|
"--output_base=$output_base"
|
|
"build"
|
|
"--remote_download_all"
|
|
)
|
|
|
|
if [ "$mode" = "verify" ]; then
|
|
bazel_args+=(
|
|
"--remote_upload_local_results=false"
|
|
"--experimental_remote_require_cached"
|
|
"--disk_cache="
|
|
)
|
|
fi
|
|
|
|
bazel "${bazel_args[@]}" "${targets[@]}"
|