@@ -40,12 +40,24 @@ x_defaults:
4040 - " -//test:output_file_map_default"
4141 windows_common : &windows_common
4242 platform : windows
43+ environment :
44+ SWIFT_VERSION : 6.1.0
45+ PATH : " %LOCALAPPDATA%\\ Programs\\ Swift\\ Toolchains\\ %SWIFT_VERSION%+Asserts\\ usr\\ bin;%LOCALAPPDATA%\\ Programs\\ Swift\\ Runtimes\\ %SWIFT_VERSION%\\ usr\\ bin;%Path%"
46+ SDKROOT : " %LOCALAPPDATA%\\ Programs\\ Swift\\ Platforms\\ %SWIFT_VERSION%\\ Windows.platform\\ Developer\\ SDKs\\ Windows.sdk"
4347 build_flags :
4448 # Override 'sandboxed' strategy set in .bazelrc because it's not
4549 # available on Windows
4650 - " --strategy=SwiftCompile="
51+ - " --repo_env=SDKROOT=%LOCALAPPDATA%\\ Programs\\ Swift\\ Platforms\\ %SWIFT_VERSION%\\ Windows.platform\\ Developer\\ SDKs\\ Windows.sdk"
52+ - " --repo_env=Path=%LOCALAPPDATA%\\ Programs\\ Swift\\ Toolchains\\ %SWIFT_VERSION%+Asserts\\ usr\\ bin;%LOCALAPPDATA%\\ Programs\\ Swift\\ Runtimes\\ %SWIFT_VERSION%\\ usr\\ bin;%Path%"
4753 build_targets :
4854 - " //tools/..."
55+ test_flags :
56+ - " --compiler=clang-cl"
57+ test_targets :
58+ - " //examples/..."
59+ - " -//examples/apple/..."
60+ - " -//examples/xplatform/grpc/..." # TODO: Fix gRPC on Windows
4961
5062tasks :
5163 # TODO: Uncomment once Bazel 8 is released
@@ -118,11 +130,14 @@ tasks:
118130 - .bazelci/update_workspace_to_deps_heads.sh
119131 << : *linux_common
120132
121- # TODO: re-enable when Windows in Bazel CI is properly configured for Swift.
122- # windows_last_green:
123- # name: "Last Green Bazel"
124- # bazel: last_green
125- # <<: *windows_common
133+ windows_last_green :
134+ name : " Last Green Bazel"
135+ bazel : last_green
136+ batch_commands :
137+ - echo --- Downloading and installing Swift %SWIFT_VERSION%
138+ - curl.exe -L https://download.swift.org/swift-6.1-release/windows10/swift-6.1-RELEASE/swift-6.1-RELEASE-windows10.exe -o %TEMP%\installer.exe
139+ - PowerShell Start-Process -FilePath ${env:TEMP}\installer.exe -ArgumentList(\"/install\", \"/passive\", \"/norestart\", \"/log log.txt\") -Wait -PassThru -Verb RunAs
140+ << : *windows_common
126141
127142 doc_tests :
128143 name : " Doc tests"
0 commit comments