11name : Windows Tests
22on : [push, pull_request]
33jobs :
4+ setup_powershell :
5+ strategy :
6+ matrix :
7+ go : ['1.22']
8+ platform : [windows-latest]
9+ runs-on : ${{ matrix.platform }}
10+ steps :
11+ - name : Run Windows Integration Tests
12+ shell : powershell
13+ run : |
14+ # required for running Volume and Disk tests
15+ Install-WindowsFeature -name Hyper-V-PowerShell
16+ $PSVersionTable
17+ # required for SMB test
18+ # Get-PSRepository
19+ # Set-PSRepository PSGallery -InstallationPolicy Trusted
20+ Install-Module -Name SecMgmt -AllowClobber
21+ $secured='random text'|ConvertTo-SecureString -AsPlainText -Force;$secured;
22+
423 integration_tests :
524 strategy :
625 matrix :
7- go : ['1.20 ']
26+ go : ['1.22 ']
827 platform : [windows-latest]
928 runs-on : ${{ matrix.platform }}
1029 steps :
@@ -15,27 +34,40 @@ jobs:
1534 - name : Checkout code
1635 uses : actions/checkout@v4
1736 - name : Build
37+ shell : powershell
1838 run : |
1939 go build -v -a -o ./bin/csi-proxy.exe ./cmd/csi-proxy
2040 go build -v -a -o ./bin/csi-proxy-api-gen.exe ./cmd/csi-proxy-api-gen
2141 - name : Run Windows Integration Tests
42+ shell : powershell
2243 run : |
2344 # required for running Volume and Disk tests
2445 Install-WindowsFeature -name Hyper-V-PowerShell
25-
26- # start the CSI Proxy before running tests on windows
27- Start-Job -Name CSIProxy -ScriptBlock {
28- .\bin\csi-proxy.exe
29- };
30- Start-Sleep -Seconds 30;
31- Write-Output "getting named pipes"
46+
47+ # copy the binary from the user directory
48+ New-Item -ItemType Directory -Path C:\etc\kubernetes\node\bin -Force
49+ Copy-Item -Path .\bin\csi-proxy.exe -Destination "C:\etc\kubernetes\node\bin\csi-proxy.exe"
50+
51+ # restart the csiproxy service
52+ $flags = "-v=5 -windows-service -log_file=C:\etc\kubernetes\logs\csi-proxy.log -logtostderr=false"
53+ sc.exe create csiproxy start= "auto" binPath= "C:\etc\kubernetes\node\bin\csi-proxy.exe $flags"
54+ sc.exe failure csiproxy reset= 0 actions= restart/10000
55+ sc.exe start csiproxy
56+
57+ Start-Sleep -Seconds 5;
58+
59+ Write-Output "Checking the status of csi-proxy"
60+ sc.exe query csiproxy
3261 [System.IO.Directory]::GetFiles("\\.\\pipe\\")
62+ Write-Output "Get CSI Proxy logs"
63+ Get-Content C:\etc\kubernetes\logs\csi-proxy.log -Tail 20
64+
3365 $env:CSI_PROXY_GH_ACTIONS="TRUE"
34- go test -timeout 20m -v -race ./integrationtests/...
66+ go test -timeout 20m -v -race ./integrationtests/... -run "Smb"
3567 unit_tests :
3668 strategy :
3769 matrix :
38- go : ['1.20 ']
70+ go : ['1.22 ']
3971 platform : [windows-latest]
4072 runs-on : ${{ matrix.platform }}
4173 steps :
5385 bump_version_test :
5486 strategy :
5587 matrix :
56- go : ['1.20 ']
88+ go : ['1.22 ']
5789 platform : [ubuntu-latest]
5890 runs-on : ${{ matrix.platform }}
5991 steps :
0 commit comments