ci: enable the Windows Bazel workflow path

This commit is contained in:
Michael Bolin
2026-03-26 21:51:22 -07:00
parent 41fe98b185
commit e69fcac8c0
8 changed files with 265 additions and 13 deletions

View File

@@ -17,6 +17,7 @@ concurrency:
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
test:
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
@@ -39,9 +40,9 @@ jobs:
# - os: ubuntu-24.04-arm
# target: aarch64-unknown-linux-gnu
# TODO: Enable Windows once we fix the toolchain issues there.
#- os: windows-latest
# target: x86_64-pc-windows-gnullvm
# Windows
- os: windows-latest
target: x86_64-pc-windows-gnullvm
runs-on: ${{ matrix.os }}
# Configure a human readable name for each job
@@ -94,8 +95,14 @@ jobs:
if: runner.os == 'Windows'
shell: pwsh
run: |
# Use a very short path to reduce argv/path length issues.
"BAZEL_STARTUP_ARGS=--output_user_root=C:\" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# Use a very short path to reduce argv/path length issues, but avoid the
# drive root because some Windows test launchers mis-handle MANIFEST paths there.
"BAZEL_STARTUP_ARGS=--output_user_root=D:\b" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Enable Git long paths (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: git config --global core.longpaths true
- name: bazel test //...
env:
@@ -153,6 +160,38 @@ jobs:
# canary and release workflows should build `third_party/v8`.
-//third_party/v8:all
)
if [[ "${RUNNER_OS:-}" == "Windows" ]]; then
# A `//...`-based query still loads `third_party/v8` on Windows even if
# we subtract the final labels, and Bazel 9 currently crashes during
# that analysis. Query within `//codex-rs/...` so the Windows smoke
# suite is discovered dynamically without touching the V8 packages.
#
# `v8-poc` contributes direct Windows targets here, while `code-mode`
# still pulls the external `v8` crate in transitively through a wider
# set of higher-level tests. `shell-command` stays out of the Windows
# smoke suite for now because its Bazel test still times out on the
# GitHub runner.
windows_target_query="
let windows_smoke = filter(
'(^|:).*(-unit-tests|schema_fixtures-test)$',
tests(
//codex-rs/...
except //codex-rs/code-mode/...
except //codex-rs/shell-command/...
except //codex-rs/v8-poc/...
)
) in
\$windows_smoke except filter(
'(^|:).*(-unit-tests|schema_fixtures-test)$',
rdeps(\$windows_smoke, //codex-rs/code-mode:code-mode)
)
"
mapfile -t bazel_targets < <(
bazel $BAZEL_STARTUP_ARGS query "$windows_target_query" --keep_going \
| sort -u
)
echo "Windows smoke target count: ${#bazel_targets[@]}"
fi
if [[ "${RUNNER_OS:-}" != "Windows" ]]; then
# Bazel test sandboxes on macOS may resolve an older Homebrew `node`