run tests with qemu-aarch64
This commit is contained in:
parent
8430789f21
commit
7c8682b865
20
.build.yml
20
.build.yml
@ -2,7 +2,8 @@ image: debian/stable
|
|||||||
packages:
|
packages:
|
||||||
- direnv
|
- direnv
|
||||||
- shellcheck
|
- shellcheck
|
||||||
- qemu-user
|
- qemu-user-static
|
||||||
|
- libc6-arm64-cross
|
||||||
sources:
|
sources:
|
||||||
- https://git.sr.ht/~motiejus/bazel-zig-cc
|
- https://git.sr.ht/~motiejus/bazel-zig-cc
|
||||||
environment:
|
environment:
|
||||||
@ -14,14 +15,19 @@ triggers:
|
|||||||
tasks:
|
tasks:
|
||||||
- setup: |
|
- setup: |
|
||||||
sudo apt-get purge gcc -y && sudo apt-get autoremove -y
|
sudo apt-get purge gcc -y && sudo apt-get autoremove -y
|
||||||
|
sudo mkdir -p /etc/qemu-binfmt
|
||||||
|
sudo ln -sf /usr/aarch64-linux-gnu /etc/qemu-binfmt/aarch64
|
||||||
|
- test_list_toolchains_platforms: |
|
||||||
|
cd bazel-zig-cc; . .envrc
|
||||||
|
echo "Available toolchains:"
|
||||||
|
bazel query @zig_sdk//... | grep _toolchain$
|
||||||
|
echo "Available platforms:"
|
||||||
|
bazel query @zig_sdk//... | grep _platform$
|
||||||
|
- test_hello_on_toolchains: |
|
||||||
|
cd bazel-zig-cc
|
||||||
|
./ci/test --color=yes --curses=yes
|
||||||
- lint: |
|
- lint: |
|
||||||
cd bazel-zig-cc; . .envrc
|
cd bazel-zig-cc; . .envrc
|
||||||
shellcheck -x $(awk '/#!\/bin\/(ba)?sh/&&FNR==1{print FILENAME}' $(git ls-files))
|
shellcheck -x $(awk '/#!\/bin\/(ba)?sh/&&FNR==1{print FILENAME}' $(git ls-files))
|
||||||
bazel run //:buildifier
|
bazel run //:buildifier
|
||||||
git diff --exit-code
|
git diff --exit-code
|
||||||
- test_list_toolchains: |
|
|
||||||
cd bazel-zig-cc; . .envrc; echo "Available toolchains:"
|
|
||||||
bazel query @zig_sdk//... | sed -En '/.*_toolchain$/ s/.*:(.*)_toolchain$/\1/p'
|
|
||||||
- test_hello_on_toolchains: |
|
|
||||||
cd bazel-zig-cc
|
|
||||||
./ci/test --color=yes --curses=yes
|
|
||||||
|
34
ci/test
34
ci/test
@ -16,21 +16,27 @@ while read -r action platform toolchain run_under; do
|
|||||||
if [[ $run_under != : ]]; then
|
if [[ $run_under != : ]]; then
|
||||||
args+=(--run_under="$run_under")
|
args+=(--run_under="$run_under")
|
||||||
fi
|
fi
|
||||||
args+=(--platforms "@zig_sdk//:${platform}_platform")
|
|
||||||
args+=(--extra_toolchains "@zig_sdk//:${toolchain}_toolchain")
|
args+=(\
|
||||||
args+=(//test/...)
|
--platforms "@zig_sdk//:${platform}_platform" \
|
||||||
_run bazel "$action" "${args[@]}"
|
--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
|
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_gnu.2.19 :
|
||||||
test linux_amd64 linux_amd64_musl :
|
test linux_amd64 linux_amd64_musl :
|
||||||
build linux_arm64 linux_arm64_musl :
|
|
||||||
build linux_arm64 linux_arm64_gnu.2.28 :
|
|
||||||
build darwin_amd64 darwin_amd64 :
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# TODO:
|
|
||||||
# works locally, fails on srht:
|
|
||||||
# test linux_arm64 linux_arm64_musl qemu-aarch64
|
|
||||||
#
|
|
||||||
# fails locally, qemu-aarch64 can't find the files in /usr
|
|
||||||
# test linux_arm64 linux_arm64_gnu.2.28 qemu-aarch64 -L /usr/aarch64-linux-gnu
|
|
||||||
|
Loading…
Reference in New Issue
Block a user