43 lines
920 B
Bash
Executable File
43 lines
920 B
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")/.."
|
|
. .envrc
|
|
|
|
_run() {
|
|
>&2 echo
|
|
>&2 echo " $*"
|
|
>&2 echo
|
|
"$@"
|
|
}
|
|
|
|
while read -r action platform toolchain run_under; do
|
|
args=("$@")
|
|
if [[ $run_under != : ]]; then
|
|
args+=(--run_under="$run_under")
|
|
fi
|
|
|
|
args+=(\
|
|
--platforms "@zig_sdk//:${platform}_platform" \
|
|
--extra_toolchains "@zig_sdk//:${toolchain}_toolchain" \
|
|
//test/... \
|
|
)
|
|
|
|
case "$action" in
|
|
test)
|
|
_run bazel build "${args[@]}"
|
|
_run bazel test --build_tests_only "${args[@]}"
|
|
;;
|
|
build)
|
|
_run bazel build "${args[@]}"
|
|
;;
|
|
esac
|
|
|
|
done <<EOF
|
|
build darwin_amd64 darwin_amd64 :
|
|
test linux_arm64 linux_arm64_musl qemu-aarch64-static
|
|
test linux_arm64 linux_arm64_gnu.2.28 qemu-aarch64-static
|
|
test linux_amd64 linux_amd64_gnu.2.19 :
|
|
test linux_amd64 linux_amd64_musl :
|
|
EOF
|