diff --git a/.kokoro/gcp_windows_docker/Dockerfile b/.kokoro/gcp_windows_docker/Dockerfile new file mode 100644 index 0000000000..23059e782c --- /dev/null +++ b/.kokoro/gcp_windows_docker/Dockerfile @@ -0,0 +1,27 @@ +# We use the .NET 6 Windows Server Core 2019 official image as starter. +# Kokoro supports up to Windows Server 2019 only. +# We build in .NET 6 +FROM mcr.microsoft.com/dotnet/sdk:6.0-windowsservercore-ltsc2019 + +# Install extra .NET target frameworks that we test in. +# https://github.com/dotnet/dotnet-docker/blob/main/documentation/scenarios/installing-dotnet.md#installing-from-dotnet-install-script +# Setup Powershell +RUN powershell -Command $ErrorActionPreference = 'Stop'; +RUN powershell -Command $ProgressPreference = 'SilentlyContinue'; +# Download dotnet-install.ps1 +RUN powershell -Command Invoke-WebRequest -UseBasicParsing -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile dotnet-install.ps1; +# Install .NET Core 3.1 +RUN powershell -Command ./dotnet-install.ps1 -InstallDir '/Program Files/dotnet' -Channel 3.1; +# Delete dotnet-install.ps1 +RUN powershell -Command Remove-Item -Force dotnet-install.ps1; + +# Install Chocolatey +ENV ChocolateyUseWindowsCompression false +RUN powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" + +# Install Chocolatey packages +RUN choco install git.install -y + +# Default to PowerShell. +# This is what Kokoro owned Docker images do. We'll do the same at least for now. +CMD ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"] diff --git a/RunUnitTests.sh b/RunUnitTests.sh new file mode 100644 index 0000000000..0dc044e1da --- /dev/null +++ b/RunUnitTests.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e + +dotnet build Src/Support/GoogleApisClient.sln +dotnet test --no-restore Src/Support/Google.Apis.Auth.Tests/Google.Apis.Auth.Tests.csproj +dotnet test --no-restore Src/Support/Google.Apis.Tests/Google.Apis.Tests.csproj