Skip to content

Commit

Permalink
test: Add self-signed certificate for Windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lazyfrosch committed Nov 27, 2020
1 parent db676d9 commit e1e96d9
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/go-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,19 @@ jobs:
New-LocalUser -Name $env:TEST_USER_NAME -Password $pw -Description "GitHub Action Test User"
Add-LocalGroupMember -Group Administrators -Member $env:TEST_USER_NAME
& winrm quickconfig -force
# Already enabled
#Enable-PSRemoting -SkipNetworkProfileCheck -Force;
& winrm set winrm/config/service/Auth '@{Basic="true"}'
& winrm set winrm/config/service '@{AllowUnencrypted="true"}'
& winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="1024"}'
& winrm enumerate winrm/config/listener
# Read current cert
$certs = Get-ChildItem Cert:\LocalMachine\My
$certs
Export-Certificate -Cert $certs[0] -FilePath C:\temp\cert.pem
Get-ChildItem WSMan:\LocalHost\Listener
Restart-Service winrm
Expand All @@ -42,7 +50,6 @@ jobs:
WINRM_HOST: localhost
WINRM_USER: ci-test
WINRM_PASSWORD: ${{ secrets.WINDOWS_TEST_USER_RANDOM_PASSWORD }} # only used inside the CI run
WINRM_SKIP_TLS: 1 # TODO: enable when HTTPs listener has been properly configured
WINRM_INSECURE: 1
WINRM_TLS_CA: 'C:\temp\cert.pem'

run: go test -v ./...

0 comments on commit e1e96d9

Please sign in to comment.