[release/0.23] Add new powershell script for test-ci to remove need for choco install on build agents#117
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a Windows-specific CI test driver script to run the equivalent of make test-ci without requiring GNU make/mingw, and updates CI pipelines to use it on Windows (backport of #115 to release/0.23).
Changes:
- Introduces
scripts/test-ci.ps1to build test prerequisites (including grpc codegen) and rungo teston Windows without GNU make/choco dependencies. - Updates GitHub Actions workflow to run the new PowerShell test script on Windows.
- Updates Azure Pipelines to remove Chocolatey installation of make/mingw and run the new script for Windows tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/test-ci.ps1 | New Windows CI test driver: installs protoc, runs grpc codegen, builds test prereqs, and runs go test. |
| Makefile | Adds notes documenting that Windows CI uses scripts/test-ci.ps1 and must stay in sync with test-ci targets. |
| .github/workflows/build-test.yml | Switches Windows job to run pwsh ./scripts/test-ci.ps1 instead of make test-ci and removes choco prereqs install. |
| .azure/pipelines/common-build.yml | Removes Windows choco install step and runs ./scripts/test-ci.ps1 for Windows test stage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $url = "https://github.com/protocolbuffers/protobuf/releases/download/v$ProtocVersion/$zipName" | ||
|
|
||
| Write-Host "Downloading $url" | ||
| Invoke-WebRequest -Uri $url -OutFile $zipPath -UseBasicParsing |
There was a problem hiding this comment.
Invoke-WebRequest is called with -UseBasicParsing, which is not supported in PowerShell 6+ (pwsh). Since the GitHub Actions workflow runs this script via pwsh, this will fail at runtime. Drop -UseBasicParsing (or switch to curl.exe like the Makefile) so the download works under PowerShell 7+.
| Invoke-WebRequest -Uri $url -OutFile $zipPath -UseBasicParsing | |
| Invoke-WebRequest -Uri $url -OutFile $zipPath |
| Set-StrictMode -Version Latest | ||
| $ErrorActionPreference = 'Stop' | ||
| $ProgressPreference = 'SilentlyContinue' # Makes Invoke-WebRequest / Expand-Archive noticeably faster. | ||
|
|
There was a problem hiding this comment.
The script assumes the Windows CI job runs with CGO_ENABLED=0 (to avoid needing a C toolchain), but it never sets CGO_ENABLED for the go build / go test invocations, and the updated CI workflows don’t export it either. Set $env:CGO_ENABLED = '0' (ideally once near the top, or within Invoke-Native/Invoke-GoBuild) to ensure the script actually removes the mingw/gcc dependency and stays consistent with the Makefile’s default.
| # Match the Makefile's Windows CI default so Go commands do not require a C toolchain. | |
| $env:CGO_ENABLED = '0' |
Backport of #115 to release/0.23
/cc @danegsta
Customer Impact
Testing
Risk
Regression?