forked from microsoft/dotnet-framework-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-and-test.ps1
51 lines (42 loc) · 1.11 KB
/
build-and-test.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env pwsh
param(
# Docker repositories (image variants) to filter by
[ValidateSet("runtime", "sdk", "aspnet", "wcf")]
[string[]]$Repos = @(),
# Version of .NET Fx to filter by
[string]$Version = "*",
# Name of OS to filter by
[string]$OS = "*",
# Additional args to pass to ImageBuilder
[string]$OptionalImageBuilderArgs,
# Execution mode of the script
[ValidateSet("BuildAndTest", "Build", "Test")]
[string]$Mode = "BuildAndTest"
)
if ($Repos.Count -eq 0) {
$Path = $null
}
else {
$Path = @()
$Repos | foreach {
$Path += "src/$_/$Version/$OS"
}
$testCategories = $Repos
}
if ($Mode -eq "BuildAndTest" -or $Mode -eq "Build") {
& ./eng/common/build.ps1 `
-Version $Version `
-OS $OS `
-Path $Path `
-OptionalImageBuilderArgs $OptionalImageBuilderArgs
}
if ($Mode -eq "BuildAndTest" -or $Mode -eq "Test") {
$testArgs = @{
Version = $Version;
OS = $OS;
}
if ($testCategories) {
$testArgs.Add("TestCategories", $testCategories)
}
& ./tests/run-tests.ps1 @testArgs
}