Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Partial setup for running unit tests in new CI infrastructure.
This PR includes: - The Windows Dockerfile that will be used for Windows builds. - A script that runs unit tests. The rest of the setup is internal.
- Loading branch information
1 parent
dd7ae96
commit add85af
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |