diff --git a/.bazelrc b/.bazelrc index 3a49a22c20..3c22ff5aa3 100644 --- a/.bazelrc +++ b/.bazelrc @@ -126,6 +126,17 @@ common:ci-windows --config=ci-bazel common:ci-windows --build_metadata=TAG_os=windows common:ci-windows --repo_contents_cache=D:/a/.cache/bazel-repo-contents-cache +# Experimental Windows cross-remote config: analyze on the Windows runner, +# execute build actions on Linux RBE, then run test actions locally on Windows. +common:ci-windows-cross --config=ci-bazel +common:ci-windows-cross --build_metadata=TAG_os=windows-cross +common:ci-windows-cross --config=remote +common:ci-windows-cross --strategy=remote +common:ci-windows-cross --strategy=TestRunner=local +common:ci-windows-cross --platforms=//:local_windows +common:ci-windows-cross --host_platform=//:rbe +common:ci-windows-cross --repo_contents_cache=D:/a/.cache/bazel-repo-contents-cache + # We prefer to run the build actions entirely remotely so we can dial up the concurrency. # We have platform-specific tests, so we want to execute the tests on all platforms using the strongest sandboxing available on each platform. diff --git a/.github/scripts/run-bazel-ci.sh b/.github/scripts/run-bazel-ci.sh index a1d42a0576..3847312963 100755 --- a/.github/scripts/run-bazel-ci.sh +++ b/.github/scripts/run-bazel-ci.sh @@ -6,6 +6,7 @@ print_failed_bazel_test_logs=0 use_node_test_env=0 remote_download_toplevel=0 windows_msvc_host_platform=0 +ci_config_override= while [[ $# -gt 0 ]]; do case "$1" in @@ -25,6 +26,10 @@ while [[ $# -gt 0 ]]; do windows_msvc_host_platform=1 shift ;; + --ci-config=*) + ci_config_override="${1#--ci-config=}" + shift + ;; --) shift break @@ -37,7 +42,7 @@ while [[ $# -gt 0 ]]; do done if [[ $# -eq 0 ]]; then - echo "Usage: $0 [--print-failed-test-logs] [--use-node-test-env] [--remote-download-toplevel] [--windows-msvc-host-platform] -- -- " >&2 + echo "Usage: $0 [--print-failed-test-logs] [--use-node-test-env] [--remote-download-toplevel] [--windows-msvc-host-platform] [--ci-config=] -- -- " >&2 exit 1 fi @@ -64,6 +69,9 @@ case "${RUNNER_OS:-}" in ci_config=ci-windows ;; esac +if [[ -n "$ci_config_override" ]]; then + ci_config="$ci_config_override" +fi print_bazel_test_log_tails() { local console_log="$1" diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 0328ac2073..438fad13cf 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -93,8 +93,7 @@ jobs: --build_metadata=COMMIT_SHA=${GITHUB_SHA} ) if [[ "${RUNNER_OS}" == "Windows" ]]; then - bazel_wrapper_args+=(--windows-msvc-host-platform) - bazel_test_args+=(--jobs=8) + bazel_wrapper_args+=(--ci-config=ci-windows-cross) fi ./.github/scripts/run-bazel-ci.sh \