Skip to content

Commit 41d2e4e

Browse files
committed
Import PS Security module 3.0 before running a PS function
1 parent 07be14d commit 41d2e4e

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

.github/workflows/windows.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
11
name: Windows Tests
22
on: [push, pull_request]
33
jobs:
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+
run: |
13+
# required for running Volume and Disk tests
14+
Install-WindowsFeature -name Hyper-V-PowerShell
15+
# required for SMB test
16+
Get-PSRepository
17+
Set-PSRepository PSGallery -InstallationPolicy Trusted
18+
Install-Module -Name SecMgmt -AllowClobber
19+
Install-Module Microsoft.PowerShell.Security
20+
Import-Module Microsoft.PowerShell.Security
21+
422
integration_tests:
523
strategy:
624
matrix:
7-
go: ['1.20']
25+
go: ['1.22']
826
platform: [windows-latest]
927
runs-on: ${{ matrix.platform }}
1028
steps:
@@ -22,7 +40,12 @@ jobs:
2240
run: |
2341
# required for running Volume and Disk tests
2442
Install-WindowsFeature -name Hyper-V-PowerShell
25-
43+
# required for SMB test
44+
Get-PSRepository
45+
Set-PSRepository PSGallery -InstallationPolicy Trusted
46+
Install-Module Microsoft.PowerShell.Security
47+
Import-Module Microsoft.PowerShell.Security
48+
2649
# start the CSI Proxy before running tests on windows
2750
Start-Job -Name CSIProxy -ScriptBlock {
2851
.\bin\csi-proxy.exe
@@ -31,11 +54,12 @@ jobs:
3154
Write-Output "getting named pipes"
3255
[System.IO.Directory]::GetFiles("\\.\\pipe\\")
3356
$env:CSI_PROXY_GH_ACTIONS="TRUE"
57+
3458
go test -timeout 20m -v -race ./integrationtests/...
3559
unit_tests:
3660
strategy:
3761
matrix:
38-
go: ['1.20']
62+
go: ['1.22']
3963
platform: [windows-latest]
4064
runs-on: ${{ matrix.platform }}
4165
steps:
@@ -53,7 +77,7 @@ jobs:
5377
bump_version_test:
5478
strategy:
5579
matrix:
56-
go: ['1.20']
80+
go: ['1.22']
5781
platform: [ubuntu-latest]
5882
runs-on: ${{ matrix.platform }}
5983
steps:

0 commit comments

Comments
 (0)