add hangzig test script
This commit is contained in:
parent
d789a296f5
commit
c69f990dfa
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,7 @@
|
|||||||
*~
|
*~
|
||||||
*.sw[op]
|
*.sw[op]
|
||||||
|
|
||||||
|
/bazel
|
||||||
/bazel-bin
|
/bazel-bin
|
||||||
/bazel-bazel-zig-cc
|
/bazel-bazel-zig-cc
|
||||||
/bazel-out
|
/bazel-out
|
||||||
|
34
hangzig
Executable file
34
hangzig
Executable file
@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
readonly bzl=https://github.com/bazelbuild/bazelisk/releases/download/v1.9.0/bazelisk-linux-amd64
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
outside() {
|
||||||
|
if [[ ! -x bazel ]]; then
|
||||||
|
rm -f bazel
|
||||||
|
curl -L "$bzl" -o bazel
|
||||||
|
chmod +x bazel
|
||||||
|
fi
|
||||||
|
exec docker run -ti --rm -v $(pwd):/x -w /x \
|
||||||
|
--cpus 2 \
|
||||||
|
-m 4096MB \
|
||||||
|
-e CC=/usr/bin/false \
|
||||||
|
debian:bullseye ./hangzig inside
|
||||||
|
}
|
||||||
|
|
||||||
|
inside() {
|
||||||
|
apt-get update && apt-get install -y ca-certificates
|
||||||
|
exec ./bazel build --platforms @zig_sdk//:aarch64-macos-gnu //test:gognu
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
case "${1:-}" in
|
||||||
|
"")
|
||||||
|
outside;;
|
||||||
|
inside)
|
||||||
|
inside;;
|
||||||
|
*)
|
||||||
|
exit 1;
|
||||||
|
esac
|
Loading…
Reference in New Issue
Block a user