forked from shouldly/shouldly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
29 lines (22 loc) · 917 Bytes
/
build.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
$ErrorActionPreference = 'Stop'
# Options
$configuration = 'Release'
$artifactsDir = Join-Path (Resolve-Path .) 'artifacts'
$packagesDir = Join-Path $artifactsDir 'Packages'
$testResultsDir = Join-Path $artifactsDir 'Test results'
$logsDir = Join-Path $artifactsDir 'Logs'
$dotnetArgs = @(
'--configuration', $configuration
'/p:ContinuousIntegrationBuild=' + ($env:CI -or $env:TF_BUILD)
)
# Build
dotnet build /bl:$logsDir\build.binlog @dotnetArgs
if ($LastExitCode) { exit 1 }
# Pack
Remove-Item -Recurse -Force $packagesDir -ErrorAction Ignore
dotnet pack src\Shouldly --no-build --output $packagesDir /bl:$logsDir\pack.binlog @dotnetArgs
if ($LastExitCode) { exit 1 }
# Test
Remove-Item -Recurse -Force $testResultsDir -ErrorAction Ignore
dotnet test --no-build --configuration $configuration --logger trx --results-directory $testResultsDir /bl:"$logsDir\test.binlog"
if ($LastExitCode) { exit 1 }