Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed Nov 8, 2023
1 parent 8715f15 commit 26b62eb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
14 changes: 14 additions & 0 deletions .buildkite/hooks/pre-command.ps1
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
$env:GO_VERSION = Get-Content -Path .go-version

# Install gvm and go
# TODO: Move GVM download to the base VM image
$env:GvmVersion = "0.5.2"
[Net.ServicePointManager]::SecurityProtocol = "tls12"
$env:GoVersion = Get-Content -Path .go-version
Invoke-WebRequest -URI https://github.com/andrewkroh/gvm/releases/download/v$env:GvmVersion/gvm-windows-amd64.exe -Outfile C:\Windows\System32\gvm.exe
gvm --format=powershell $env:GO_VERSION | Invoke-Expression
go version

$GOPATH = $(go env GOPATH)
$env:Path = "$GOPATH\bin;" + $env:Path
[Environment]::SetEnvironmentVariable("GOPATH", "$GOPATH", [EnvironmentVariableTarget]::Machine)
[Environment]::SetEnvironmentVariable("Path", "$GOPATH\bin;$env:Path", [EnvironmentVariableTarget]::Machine)
11 changes: 0 additions & 11 deletions .buildkite/scripts/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,13 @@ function fixCRLF {
git reset --quiet --hard
}

function withGolang($version) {
Write-Host "-- Install golang --"
choco install -y golang --version $version
$env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\..\.."
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
refreshenv
go version
go env
}

function withGoJUnitReport {
Write-Host "-- Install go-junit-report --"
go install github.com/jstemmer/go-junit-report/v2@latest
}

Write-Host "--- Prepare enviroment"
fixCRLF
withGolang $env:GO_VERSION
withGoJUnitReport

Write-Host "--- Run test"
Expand Down

0 comments on commit 26b62eb

Please sign in to comment.