Skip to content

Commit

Permalink
[CI] enable Windows-2016 and support 32 bits build requirements (#19199
Browse files Browse the repository at this point in the history
…) (#22347)
  • Loading branch information
v1v authored Nov 2, 2020
1 parent aa23e12 commit d79de9d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
20 changes: 18 additions & 2 deletions .ci/scripts/install-tools.bat
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
set GOPATH=%WORKSPACE%
set MAGEFILE_CACHE=%WORKSPACE%\.magefile
set PATH=%WORKSPACE%\bin;C:\ProgramData\chocolatey\bin;%PATH%
set PATH=%WORKSPACE%\bin;C:\ProgramData\chocolatey\bin;C:\tools\mingw64\bin;%PATH%

where /q curl
IF ERRORLEVEL 1 (
choco install curl -y --no-progress --skipdownloadcache
)
mkdir %WORKSPACE%\bin

REM If 32 bits then install the GVM accordingly
IF NOT EXIST "%PROGRAMFILES(X86)%" (
curl -sL -o %WORKSPACE%\bin\gvm.exe https://github.com/andrewkroh/gvm/releases/download/v0.2.2/gvm-windows-386.exe
)

where /q gvm
IF ERRORLEVEL 1 (
curl -sL -o %WORKSPACE%\bin\gvm.exe https://github.com/andrewkroh/gvm/releases/download/v0.2.2/gvm-windows-amd64.exe
IF EXIST "%PROGRAMFILES(X86)%" (
curl -sL -o %WORKSPACE%\bin\gvm.exe https://github.com/andrewkroh/gvm/releases/download/v0.2.2/gvm-windows-amd64.exe
) ELSE (
curl -sL -o %WORKSPACE%\bin\gvm.exe https://github.com/andrewkroh/gvm/releases/download/v0.2.2/gvm-windows-386.exe
)
)
FOR /f "tokens=*" %%i IN ('"gvm.exe" use %GO_VERSION% --format=batch') DO %%i

Expand All @@ -25,3 +35,9 @@ if not exist C:\Python38\python.exe (
python --version
where python

if not exist C:\tools\mingw64\bin\gcc.exe (
REM Install mingw 5.3.0
choco install mingw -y -r --no-progress --version 5.3.0 || echo ERROR && exit /b
)
gcc --version
where gcc
7 changes: 5 additions & 2 deletions dev-tools/mage/gotest.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,11 @@ func GoTest(ctx context.Context, params GoTestArgs) error {
args := []string{"test"}
args = append(args, "-v")

if params.Race {
args = append(args, "-race")
// -race is only supported on */amd64
if os.Getenv("DEV_ARCH") == "amd64" {
if params.Race {
args = append(args, "-race")
}
}
if len(params.Tags) > 0 {
args = append(args, "-tags", strings.Join(params.Tags, " "))
Expand Down

0 comments on commit d79de9d

Please sign in to comment.