Skip to content

Commit 419d616

Browse files
author
Adelina Tuvenie
committed
Install specific golang version in Windows CI.
For Periodic Windows runs we installed the latest available golang version. It seems 1.16.5 is creating problems with go.sum. We now introduce the ability to install specific versions for required packages when preparing the testing env. Signed-off-by: Adelina Tuvenie <[email protected]>
1 parent f6061b4 commit 419d616

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

script/setup/prepare_env_windows.ps1

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Prepare windows environment for building and running containerd tests
22

3-
$PACKAGES= "mingw", "git", "golang", "make"
3+
$PACKAGES= @{ mingw = ""; git = ""; golang = "1.16.4"; make = "" }
44

55
write-host "Downloading chocolatey package"
66
curl.exe -L "https://packages.chocolatey.org/chocolatey.0.10.15.nupkg" -o 'c:\choco.zip'
@@ -14,8 +14,13 @@ $env:PATH+=";C:\ProgramData\chocolatey\bin"
1414

1515
write-host "Install necessary packages"
1616

17-
foreach ($package in $PACKAGES) {
18-
choco.exe install $package --yes
17+
foreach ($package in $PACKAGES.Keys) {
18+
$command = "choco.exe install $package --yes"
19+
$version = $PACKAGES[$package]
20+
if (-Not [string]::IsNullOrEmpty($version)) {
21+
$command += " --version $version"
22+
}
23+
Invoke-Expression $command
1924
}
2025

2126
write-host "Set up environment."
@@ -37,4 +42,4 @@ go get -u github.com/jstemmer/go-junit-report
3742
$CRICTL_DOWNLOAD_URL="https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.21.0/crictl-v1.21.0-windows-amd64.tar.gz"
3843
curl.exe -L $CRICTL_DOWNLOAD_URL -o c:\crictl.tar.gz
3944
tar -xvf c:\crictl.tar.gz
40-
mv crictl.exe c:\Users\azureuser\go\bin\crictl.exe # Move crictl somewhere in path
45+
mv crictl.exe c:\Users\azureuser\go\bin\crictl.exe # Move crictl somewhere in path

0 commit comments

Comments
 (0)