Skip to content

Commit a5d0aa1

Browse files
authored
Merge pull request #348 from mauriciopoppe/fix-github-actions
Update the github action workflow to run the integration tests
2 parents 07be14d + ecbf864 commit a5d0aa1

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

.github/workflows/windows.yml

+27-11
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
integration_tests:
55
strategy:
66
matrix:
7-
go: ['1.20']
7+
go: ['1.22']
88
platform: [windows-latest]
99
runs-on: ${{ matrix.platform }}
1010
steps:
@@ -15,27 +15,43 @@ jobs:
1515
- name: Checkout code
1616
uses: actions/checkout@v4
1717
- name: Build
18+
shell: powershell
1819
run: |
1920
go build -v -a -o ./bin/csi-proxy.exe ./cmd/csi-proxy
2021
go build -v -a -o ./bin/csi-proxy-api-gen.exe ./cmd/csi-proxy-api-gen
2122
- name: Run Windows Integration Tests
23+
shell: powershell
2224
run: |
23-
# required for running Volume and Disk tests
25+
# This scripts reimplements scripts/run-integration.sh in powershell.
26+
27+
# Nested virtualization is required for running Volume and Disk tests
2428
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"
29+
30+
# copy the binary from the user directory
31+
New-Item -ItemType Directory -Path C:\etc\kubernetes\node\bin -Force
32+
New-Item -ItemType Directory -Path C:\etc\kubernetes\logs -Force
33+
Copy-Item -Path .\bin\csi-proxy.exe -Destination "C:\etc\kubernetes\node\bin\csi-proxy.exe"
34+
35+
# restart the csiproxy service
36+
$flags = "-v=5 -windows-service -log_file=C:\etc\kubernetes\logs\csi-proxy.log -logtostderr=false"
37+
sc.exe create csiproxy start= "auto" binPath= "C:\etc\kubernetes\node\bin\csi-proxy.exe $flags"
38+
sc.exe failure csiproxy reset= 0 actions= restart/10000
39+
sc.exe start csiproxy
40+
41+
Start-Sleep -Seconds 5;
42+
43+
Write-Output "Checking the status of csi-proxy"
44+
sc.exe query csiproxy
3245
[System.IO.Directory]::GetFiles("\\.\\pipe\\")
46+
Write-Output "Get CSI Proxy logs"
47+
Get-Content C:\etc\kubernetes\logs\csi-proxy.log -Tail 20
48+
3349
$env:CSI_PROXY_GH_ACTIONS="TRUE"
3450
go test -timeout 20m -v -race ./integrationtests/...
3551
unit_tests:
3652
strategy:
3753
matrix:
38-
go: ['1.20']
54+
go: ['1.22']
3955
platform: [windows-latest]
4056
runs-on: ${{ matrix.platform }}
4157
steps:
@@ -53,7 +69,7 @@ jobs:
5369
bump_version_test:
5470
strategy:
5571
matrix:
56-
go: ['1.20']
72+
go: ['1.22']
5773
platform: [ubuntu-latest]
5874
runs-on: ${{ matrix.platform }}
5975
steps:

0 commit comments

Comments
 (0)