fix: windows targets

This commit is contained in:
eric
2026-03-15 11:24:36 +01:00
parent a58028d063
commit 683de60603
10 changed files with 142 additions and 6 deletions

View File

@@ -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",

View File

@@ -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"

View 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

View 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"