ci: enable the Windows Bazel workflow path

This commit is contained in:
Michael Bolin
2026-03-27 01:00:47 -07:00
parent 41fe98b185
commit 1ae9d14612
8 changed files with 301 additions and 14 deletions
+84 -7
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,18 +40,24 @@ 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
name: Local Bazel build on ${{ matrix.os }} for ${{ matrix.target }}
steps:
- name: Skip non-Windows Bazel PR jobs
if: github.event_name == 'pull_request' && runner.os != 'Windows' && (matrix.os != 'ubuntu-24.04' || matrix.target != 'x86_64-unknown-linux-gnu')
run: echo "Skipping non-Windows Bazel job while iterating on Windows support."
- uses: actions/checkout@v6
if: github.event_name != 'pull_request' || runner.os == 'Windows' || (matrix.os == 'ubuntu-24.04' && matrix.target == 'x86_64-unknown-linux-gnu')
- name: Set up Node.js for js_repl tests
if: github.event_name != 'pull_request' || runner.os == 'Windows'
uses: actions/setup-node@v6
with:
node-version-file: codex-rs/node-version.txt
@@ -58,10 +65,11 @@ jobs:
# Some integration tests rely on DotSlash being installed.
# See https://github.com/openai/codex/pull/7617.
- name: Install DotSlash
if: github.event_name != 'pull_request' || runner.os == 'Windows'
uses: facebook/install-dotslash@v2
- name: Make DotSlash available in PATH (Unix)
if: runner.os != 'Windows'
if: github.event_name != 'pull_request' && runner.os != 'Windows'
run: cp "$(which dotslash)" /usr/local/bin
- name: Make DotSlash available in PATH (Windows)
@@ -71,6 +79,7 @@ jobs:
# Install Bazel via Bazelisk
- name: Set up Bazel
if: github.event_name != 'pull_request' || runner.os == 'Windows'
uses: bazelbuild/setup-bazelisk@v3
- name: Check MODULE.bazel.lock is up to date
@@ -81,6 +90,7 @@ jobs:
# Restore bazel repository cache so we don't have to redownload all the external dependencies
# on every CI run.
- name: Restore bazel repository cache
if: github.event_name != 'pull_request' || runner.os == 'Windows'
id: cache_bazel_repository_restore
uses: actions/cache/restore@v5
with:
@@ -94,10 +104,17 @@ 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 //...
if: github.event_name != 'pull_request' || runner.os == 'Windows'
env:
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
shell: bash
@@ -153,6 +170,66 @@ 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. Keep Windows on an explicit non-V8 smoke suite for
# now so the workflow provides useful coverage without touching the V8
# packages at all.
bazel_targets=(
//codex-rs/analytics:analytics-unit-tests
//codex-rs/ansi-escape:ansi-escape-unit-tests
//codex-rs/app-server-protocol:app-server-protocol-schema_fixtures-test
//codex-rs/app-server-protocol:app-server-protocol-unit-tests
//codex-rs/apply-patch:apply-patch-unit-tests
//codex-rs/async-utils:async-utils-unit-tests
//codex-rs/codex-backend-openapi-models:codex-backend-openapi-models-unit-tests
//codex-rs/codex-experimental-api-macros:codex-experimental-api-macros-unit-tests
//codex-rs/config:config-unit-tests
//codex-rs/connectors:connectors-unit-tests
//codex-rs/core-skills:core-skills-unit-tests
//codex-rs/execpolicy-legacy:execpolicy-legacy-unit-tests
//codex-rs/execpolicy:execpolicy-unit-tests
//codex-rs/features:features-unit-tests
//codex-rs/feedback:feedback-unit-tests
//codex-rs/file-search:file-search-unit-tests
//codex-rs/git-utils:git-utils-unit-tests
//codex-rs/hooks:hooks-unit-tests
//codex-rs/instructions:instructions-unit-tests
//codex-rs/package-manager:package-manager-unit-tests
//codex-rs/process-hardening:process-hardening-unit-tests
//codex-rs/protocol:protocol-unit-tests
//codex-rs/responses-api-proxy:responses-api-proxy-unit-tests
//codex-rs/rollout:rollout-unit-tests
//codex-rs/sandboxing:sandboxing-unit-tests
//codex-rs/secrets:secrets-unit-tests
//codex-rs/skills:skills-unit-tests
//codex-rs/state:state-unit-tests
//codex-rs/terminal-detection:terminal-detection-unit-tests
//codex-rs/tools:tools-unit-tests
//codex-rs/utils/absolute-path:absolute-path-unit-tests
//codex-rs/utils/approval-presets:approval-presets-unit-tests
//codex-rs/utils/cache:cache-unit-tests
//codex-rs/utils/cargo-bin:cargo-bin-unit-tests
//codex-rs/utils/cli:cli-unit-tests
//codex-rs/utils/elapsed:elapsed-unit-tests
//codex-rs/utils/fuzzy-match:fuzzy-match-unit-tests
//codex-rs/utils/home-dir:home-dir-unit-tests
//codex-rs/utils/image:image-unit-tests
//codex-rs/utils/json-to-toml:json-to-toml-unit-tests
//codex-rs/utils/output-truncation:output-truncation-unit-tests
//codex-rs/utils/path-utils:path-utils-unit-tests
//codex-rs/utils/plugins:plugins-unit-tests
//codex-rs/utils/readiness:readiness-unit-tests
//codex-rs/utils/rustls-provider:rustls-provider-unit-tests
//codex-rs/utils/sleep-inhibitor:sleep-inhibitor-unit-tests
//codex-rs/utils/stream-parser:stream-parser-unit-tests
//codex-rs/utils/string:string-unit-tests
//codex-rs/utils/template:template-unit-tests
//codex-rs/windows-sandbox-rs:windows-sandbox-rs-unit-tests
)
echo "Windows smoke target count: ${#bazel_targets[@]}"
fi
if [[ "${RUNNER_OS:-}" != "Windows" ]]; then
# Bazel test sandboxes on macOS may resolve an older Homebrew `node`
@@ -224,7 +301,7 @@ jobs:
# Save bazel repository cache explicitly; make non-fatal so cache uploading
# never fails the overall job. Only save when key wasn't hit.
- name: Save bazel repository cache
if: always() && !cancelled() && steps.cache_bazel_repository_restore.outputs.cache-hit != 'true'
if: (github.event_name != 'pull_request' || runner.os == 'Windows') && always() && !cancelled() && steps.cache_bazel_repository_restore.outputs.cache-hit != 'true'
continue-on-error: true
uses: actions/cache/save@v5
with: