Skip to content

Commit aa63f19

Browse files
dmitriplotnikovcopybara-github
authored andcommitted
Configure windows presubmit job for cel-expr/cel-python
PiperOrigin-RevId: 912732789
1 parent 06441a0 commit aa63f19

2 files changed

Lines changed: 54 additions & 0 deletions

File tree

release/kokoro/build_windows.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# proto-file: //devtools/kokoro/config/proto/build.proto
2+
# proto-message: BuildConfig
3+
4+
build_file: "cel-python/release/kokoro/presubmit_windows.ps1"
5+
timeout_mins: 30
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# PowerShell script for Windows Presubmit
2+
$ErrorActionPreference = 'Stop'
3+
4+
Write-Host '--- Environment Info ---'
5+
Write-Host "Host Name: $env:COMPUTERNAME"
6+
Write-Host "User Name: $env:USERNAME"
7+
Write-Host "Current Directory: $(Get-Location)"
8+
9+
# Change directory to the repository root
10+
Set-Location "$PSScriptRoot\..\.."
11+
Write-Host "New Directory: $(Get-Location)"
12+
13+
$PYTHON_EXE = 'python'
14+
if (Get-Command 'python3.11' -ErrorAction SilentlyContinue) {
15+
$PYTHON_EXE = 'python3.11'
16+
}
17+
else {
18+
if (Test-Path 'C:\Python311\python.exe') {
19+
$PYTHON_EXE = 'C:\Python311\python.exe'
20+
}
21+
}
22+
23+
Write-Host '--- Python Version ---'
24+
& $PYTHON_EXE --version
25+
26+
# Ensure Bazel is available
27+
Write-Host '--- Bazel Version ---'
28+
& bazel version
29+
30+
# Build all targets
31+
Write-Host '--- Bazel Build ---'
32+
& bazel build --config=windows //...
33+
34+
if ($LASTEXITCODE -ne 0) {
35+
Write-Host 'Build failed!'
36+
exit 1
37+
}
38+
39+
# Run all tests
40+
Write-Host '--- Bazel Test ---'
41+
& bazel test --config=windows --test_output=errors //...
42+
43+
if ($LASTEXITCODE -ne 0) {
44+
Write-Host 'Tests failed!'
45+
exit 1
46+
}
47+
48+
Write-Host '--- Success ---'
49+
Write-Host 'Build and tests passed successfully.'

0 commit comments

Comments
 (0)