fix: windows targets
This commit is contained in:
@@ -8,6 +8,14 @@ sh_test(
|
||||
data = ["//.github/workflows:ci.yml"],
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "phase8_ci_targets_test",
|
||||
size = "small",
|
||||
srcs = ["phase8_ci_targets_test.sh"],
|
||||
args = ["$(location :phase8_ci_targets.sh)"],
|
||||
data = [":phase8_ci_targets.sh"],
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "native_wrapper_shape_test",
|
||||
size = "small",
|
||||
|
||||
@@ -22,6 +22,17 @@ check_pattern 'os:[[:space:]]+ubuntu-latest' "missing ubuntu matrix entry"
|
||||
check_pattern 'phase8_target:[[:space:]]+linux-x64' "missing linux-x64 matrix target"
|
||||
check_pattern 'os:[[:space:]]+macos-14' "missing macos matrix entry"
|
||||
check_pattern 'phase8_target:[[:space:]]+darwin-arm64' "missing darwin-arm64 matrix target"
|
||||
check_pattern 'os:[[:space:]]+windows-latest' "missing windows matrix entry"
|
||||
check_pattern 'phase8_target:[[:space:]]+windows' "missing windows matrix target"
|
||||
|
||||
has_windows_os=0
|
||||
has_windows_target=0
|
||||
if grep -Eq 'os:[[:space:]]+windows-latest' "${workflow_file}"; then
|
||||
has_windows_os=1
|
||||
fi
|
||||
if grep -Eq 'phase8_target:[[:space:]]+windows' "${workflow_file}"; then
|
||||
has_windows_target=1
|
||||
fi
|
||||
if [[ ${has_windows_os} -ne ${has_windows_target} ]]; then
|
||||
echo "Error: windows matrix entry and windows phase8 target must be added or removed together" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "CI matrix shape checks passed"
|
||||
|
||||
27
tests/ci_test/phase8_ci_targets.sh
Executable file
27
tests/ci_test/phase8_ci_targets.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
phase8_target="${1:-}"
|
||||
if [[ -z ${phase8_target} ]]; then
|
||||
echo "Error: phase8 target required as first argument" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "${phase8_target}" in
|
||||
linux-x64 | darwin-arm64)
|
||||
printf '%s\n' "//tests/..."
|
||||
;;
|
||||
windows)
|
||||
printf '%s\n' \
|
||||
"//tests/binary_test/..." \
|
||||
"//tests/bun_test_test/..." \
|
||||
"//tests/ci_test/..." \
|
||||
"//tests/js_compat_test/..." \
|
||||
"//tests/script_test/..." \
|
||||
"//tests/toolchain_test/..."
|
||||
;;
|
||||
*)
|
||||
echo "Error: unsupported phase8 target: ${phase8_target}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
44
tests/ci_test/phase8_ci_targets_test.sh
Executable file
44
tests/ci_test/phase8_ci_targets_test.sh
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
resolver="${1:-}"
|
||||
if [[ -z ${resolver} ]]; then
|
||||
echo "Error: resolver path required as first argument" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
linux_targets="$("${resolver}" linux-x64)"
|
||||
if [[ ${linux_targets} != "//tests/..." ]]; then
|
||||
echo "Error: linux-x64 should resolve to //tests/..." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
darwin_targets="$("${resolver}" darwin-arm64)"
|
||||
if [[ ${darwin_targets} != "//tests/..." ]]; then
|
||||
echo "Error: darwin-arm64 should resolve to //tests/..." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
windows_targets="$("${resolver}" windows)"
|
||||
expected_windows_targets="$(
|
||||
cat <<'EOF'
|
||||
//tests/binary_test/...
|
||||
//tests/bun_test_test/...
|
||||
//tests/ci_test/...
|
||||
//tests/js_compat_test/...
|
||||
//tests/script_test/...
|
||||
//tests/toolchain_test/...
|
||||
EOF
|
||||
)"
|
||||
if [[ ${windows_targets} != "${expected_windows_targets}" ]]; then
|
||||
echo "Error: unexpected windows targets" >&2
|
||||
printf 'Expected:\n%s\nActual:\n%s\n' "${expected_windows_targets}" "${windows_targets}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if "${resolver}" unsupported >/dev/null 2>&1; then
|
||||
echo "Error: unsupported phase8 target should fail" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Phase 8 CI targets resolve correctly"
|
||||
@@ -32,6 +32,14 @@ config_setting(
|
||||
],
|
||||
)
|
||||
|
||||
config_setting(
|
||||
name = "windows_x86_64",
|
||||
constraint_values = [
|
||||
"@platforms//os:windows",
|
||||
"@platforms//cpu:x86_64",
|
||||
],
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "bun_install_clean_install_test",
|
||||
size = "small",
|
||||
@@ -41,6 +49,7 @@ sh_test(
|
||||
":linux_aarch64": ["$(location @bun_linux_aarch64//:bun)"],
|
||||
":darwin_x86_64": ["$(location @bun_darwin_x64//:bun)"],
|
||||
":darwin_aarch64": ["$(location @bun_darwin_aarch64//:bun)"],
|
||||
":windows_x86_64": ["$(location @bun_windows_x64//:bun)"],
|
||||
"//conditions:default": ["$(location @bun_linux_x64//:bun)"],
|
||||
}),
|
||||
data = select({
|
||||
@@ -48,6 +57,7 @@ sh_test(
|
||||
":linux_aarch64": ["@bun_linux_aarch64//:bun"],
|
||||
":darwin_x86_64": ["@bun_darwin_x64//:bun"],
|
||||
":darwin_aarch64": ["@bun_darwin_aarch64//:bun"],
|
||||
":windows_x86_64": ["@bun_windows_x64//:bun"],
|
||||
"//conditions:default": ["@bun_linux_x64//:bun"],
|
||||
}),
|
||||
)
|
||||
@@ -61,6 +71,7 @@ sh_test(
|
||||
":linux_aarch64": ["$(location @bun_linux_aarch64//:bun)"],
|
||||
":darwin_x86_64": ["$(location @bun_darwin_x64//:bun)"],
|
||||
":darwin_aarch64": ["$(location @bun_darwin_aarch64//:bun)"],
|
||||
":windows_x86_64": ["$(location @bun_windows_x64//:bun)"],
|
||||
"//conditions:default": ["$(location @bun_linux_x64//:bun)"],
|
||||
}),
|
||||
data = select({
|
||||
@@ -68,6 +79,7 @@ sh_test(
|
||||
":linux_aarch64": ["@bun_linux_aarch64//:bun"],
|
||||
":darwin_x86_64": ["@bun_darwin_x64//:bun"],
|
||||
":darwin_aarch64": ["@bun_darwin_aarch64//:bun"],
|
||||
":windows_x86_64": ["@bun_windows_x64//:bun"],
|
||||
"//conditions:default": ["@bun_linux_x64//:bun"],
|
||||
}),
|
||||
)
|
||||
@@ -97,6 +109,7 @@ sh_test(
|
||||
":linux_aarch64": ["$(location @bun_linux_aarch64//:bun)"],
|
||||
":darwin_x86_64": ["$(location @bun_darwin_x64//:bun)"],
|
||||
":darwin_aarch64": ["$(location @bun_darwin_aarch64//:bun)"],
|
||||
":windows_x86_64": ["$(location @bun_windows_x64//:bun)"],
|
||||
"//conditions:default": ["$(location @bun_linux_x64//:bun)"],
|
||||
}),
|
||||
data = select({
|
||||
@@ -104,6 +117,7 @@ sh_test(
|
||||
":linux_aarch64": ["@bun_linux_aarch64//:bun"],
|
||||
":darwin_x86_64": ["@bun_darwin_x64//:bun"],
|
||||
":darwin_aarch64": ["@bun_darwin_aarch64//:bun"],
|
||||
":windows_x86_64": ["@bun_windows_x64//:bun"],
|
||||
"//conditions:default": ["@bun_linux_x64//:bun"],
|
||||
}),
|
||||
)
|
||||
@@ -117,6 +131,7 @@ sh_test(
|
||||
":linux_aarch64": ["$(location @bun_linux_aarch64//:bun)"],
|
||||
":darwin_x86_64": ["$(location @bun_darwin_x64//:bun)"],
|
||||
":darwin_aarch64": ["$(location @bun_darwin_aarch64//:bun)"],
|
||||
":windows_x86_64": ["$(location @bun_windows_x64//:bun)"],
|
||||
"//conditions:default": ["$(location @bun_linux_x64//:bun)"],
|
||||
}),
|
||||
data = select({
|
||||
@@ -124,6 +139,7 @@ sh_test(
|
||||
":linux_aarch64": ["@bun_linux_aarch64//:bun"],
|
||||
":darwin_x86_64": ["@bun_darwin_x64//:bun"],
|
||||
":darwin_aarch64": ["@bun_darwin_aarch64//:bun"],
|
||||
":windows_x86_64": ["@bun_windows_x64//:bun"],
|
||||
"//conditions:default": ["@bun_linux_x64//:bun"],
|
||||
}),
|
||||
)
|
||||
@@ -136,6 +152,7 @@ sh_test(
|
||||
":linux_aarch64": ["$(location @bun_linux_aarch64//:bun)"],
|
||||
":darwin_x86_64": ["$(location @bun_darwin_x64//:bun)"],
|
||||
":darwin_aarch64": ["$(location @bun_darwin_aarch64//:bun)"],
|
||||
":windows_x86_64": ["$(location @bun_windows_x64//:bun)"],
|
||||
"//conditions:default": ["$(location @bun_linux_x64//:bun)"],
|
||||
}),
|
||||
data = select({
|
||||
@@ -143,6 +160,7 @@ sh_test(
|
||||
":linux_aarch64": ["@bun_linux_aarch64//:bun"],
|
||||
":darwin_x86_64": ["@bun_darwin_x64//:bun"],
|
||||
":darwin_aarch64": ["@bun_darwin_aarch64//:bun"],
|
||||
":windows_x86_64": ["@bun_windows_x64//:bun"],
|
||||
"//conditions:default": ["@bun_linux_x64//:bun"],
|
||||
}) + [
|
||||
"//:repo_runtime_files",
|
||||
@@ -169,6 +187,7 @@ sh_test(
|
||||
":linux_aarch64": ["$(location @bun_linux_aarch64//:bun)"],
|
||||
":darwin_x86_64": ["$(location @bun_darwin_x64//:bun)"],
|
||||
":darwin_aarch64": ["$(location @bun_darwin_aarch64//:bun)"],
|
||||
":windows_x86_64": ["$(location @bun_windows_x64//:bun)"],
|
||||
"//conditions:default": ["$(location @bun_linux_x64//:bun)"],
|
||||
}),
|
||||
data = select({
|
||||
@@ -176,6 +195,7 @@ sh_test(
|
||||
":linux_aarch64": ["@bun_linux_aarch64//:bun"],
|
||||
":darwin_x86_64": ["@bun_darwin_x64//:bun"],
|
||||
":darwin_aarch64": ["@bun_darwin_aarch64//:bun"],
|
||||
":windows_x86_64": ["@bun_windows_x64//:bun"],
|
||||
"//conditions:default": ["@bun_linux_x64//:bun"],
|
||||
}) + [
|
||||
"//:repo_runtime_files",
|
||||
@@ -194,6 +214,7 @@ sh_test(
|
||||
":linux_aarch64": ["$(location @bun_linux_aarch64//:bun)"],
|
||||
":darwin_x86_64": ["$(location @bun_darwin_x64//:bun)"],
|
||||
":darwin_aarch64": ["$(location @bun_darwin_aarch64//:bun)"],
|
||||
":windows_x86_64": ["$(location @bun_windows_x64//:bun)"],
|
||||
"//conditions:default": ["$(location @bun_linux_x64//:bun)"],
|
||||
}),
|
||||
data = select({
|
||||
@@ -201,6 +222,7 @@ sh_test(
|
||||
":linux_aarch64": ["@bun_linux_aarch64//:bun"],
|
||||
":darwin_x86_64": ["@bun_darwin_x64//:bun"],
|
||||
":darwin_aarch64": ["@bun_darwin_aarch64//:bun"],
|
||||
":windows_x86_64": ["@bun_windows_x64//:bun"],
|
||||
"//conditions:default": ["@bun_linux_x64//:bun"],
|
||||
}) + [
|
||||
"//:repo_runtime_files",
|
||||
|
||||
@@ -3,4 +3,6 @@ set -euo pipefail
|
||||
|
||||
workflow_file="$1"
|
||||
|
||||
grep -Eq 'bazel test //(tests/)?\.\.\.' "${workflow_file}"
|
||||
grep -Fq './tests/ci_test/phase8_ci_targets.sh "${{ matrix.phase8_target }}"' "${workflow_file}"
|
||||
grep -Fq 'targets="$(./tests/ci_test/phase8_ci_targets.sh "${{ matrix.phase8_target }}")"' "${workflow_file}"
|
||||
grep -Fq 'bazel test ${targets}' "${workflow_file}"
|
||||
|
||||
@@ -32,6 +32,14 @@ config_setting(
|
||||
],
|
||||
)
|
||||
|
||||
config_setting(
|
||||
name = "windows_x86_64",
|
||||
constraint_values = [
|
||||
"@platforms//os:windows",
|
||||
"@platforms//cpu:x86_64",
|
||||
],
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "npm_translate_lock_workspace_test",
|
||||
size = "small",
|
||||
@@ -41,6 +49,7 @@ sh_test(
|
||||
":linux_aarch64": ["$(location @bun_linux_aarch64//:bun)"],
|
||||
":darwin_x86_64": ["$(location @bun_darwin_x64//:bun)"],
|
||||
":darwin_aarch64": ["$(location @bun_darwin_aarch64//:bun)"],
|
||||
":windows_x86_64": ["$(location @bun_windows_x64//:bun)"],
|
||||
"//conditions:default": ["$(location @bun_linux_x64//:bun)"],
|
||||
}),
|
||||
data = select({
|
||||
@@ -48,6 +57,7 @@ sh_test(
|
||||
":linux_aarch64": ["@bun_linux_aarch64//:bun"],
|
||||
":darwin_x86_64": ["@bun_darwin_x64//:bun"],
|
||||
":darwin_aarch64": ["@bun_darwin_aarch64//:bun"],
|
||||
":windows_x86_64": ["@bun_windows_x64//:bun"],
|
||||
"//conditions:default": ["@bun_linux_x64//:bun"],
|
||||
}) + [
|
||||
"//:repo_runtime_files",
|
||||
|
||||
@@ -32,6 +32,14 @@ config_setting(
|
||||
],
|
||||
)
|
||||
|
||||
config_setting(
|
||||
name = "windows_x86_64",
|
||||
constraint_values = [
|
||||
"@platforms//os:windows",
|
||||
"@platforms//cpu:x86_64",
|
||||
],
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "bun_version_test",
|
||||
size = "small",
|
||||
@@ -41,6 +49,7 @@ sh_test(
|
||||
":linux_aarch64": ["$(location @bun_linux_aarch64//:bun)"],
|
||||
":darwin_x86_64": ["$(location @bun_darwin_x64//:bun)"],
|
||||
":darwin_aarch64": ["$(location @bun_darwin_aarch64//:bun)"],
|
||||
":windows_x86_64": ["$(location @bun_windows_x64//:bun)"],
|
||||
"//conditions:default": ["$(location @bun_linux_x64//:bun)"],
|
||||
}),
|
||||
data = select({
|
||||
@@ -48,6 +57,7 @@ sh_test(
|
||||
":linux_aarch64": ["@bun_linux_aarch64//:bun"],
|
||||
":darwin_x86_64": ["@bun_darwin_x64//:bun"],
|
||||
":darwin_aarch64": ["@bun_darwin_aarch64//:bun"],
|
||||
":windows_x86_64": ["@bun_windows_x64//:bun"],
|
||||
"//conditions:default": ["@bun_linux_x64//:bun"],
|
||||
}),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user