9
9
- rel/*
10
10
11
11
pool :
12
- vmImage : windows-2022
12
+ vmImage : windows-latest
13
+
14
+ variables :
15
+ BuildConfiguration : Release
13
16
14
17
jobs :
15
18
- job : BuildBits
19
+ displayName : Build and Test solution
16
20
timeoutInMinutes : 60
17
21
steps :
18
22
19
- # Install NuGet
20
- - task : NuGetToolInstaller@0
21
- displayName : Install NuGet 6.0
22
- inputs :
23
- versionSpec : 6.0.0
24
-
25
- # Install NerdBank GitVersioning
26
- - task : DotNetCoreCLI@2
27
- displayName : Install NBGV tool
28
- inputs :
29
- command : custom
30
- custom : tool
31
- arguments : update -g nbgv
32
-
33
23
# Set Build Version
34
24
- script : nbgv cloud
35
25
displayName : Set NBGV version
@@ -38,35 +28,41 @@ jobs:
38
28
- pwsh : build/Update-Headers.ps1 -Verify
39
29
displayName : Verify headers
40
30
31
+ # Restore solution
32
+ - script : dotnet restore -p:Configuration=$(BuildConfiguration)
33
+ displayName : Restore solution
34
+
41
35
# Build solution
42
- - script : dotnet build -c Release
36
+ - script : dotnet build --no-restore -c $(BuildConfiguration)
43
37
displayName : Build solution
44
38
45
- # Run .NET 6 tests
46
- - script : dotnet test -c Release -f net6.0 -l "trx;LogFileName=VSTestResults_net6.0.trx"
39
+ # Test solution #
40
+
41
+ # Run .NET 6 unit tests
42
+ - script : dotnet test --no-build -c $(BuildConfiguration) -f net6.0 -l "trx;LogFileName=VSTestResults_net6.0.trx"
47
43
displayName : Run .NET 6 unit tests
48
44
49
- # Run .NET Core 3.1 tests
50
- - script : dotnet test -c Release -f netcoreapp3.1 -l "trx;LogFileName=VSTestResults_netcoreapp3.1.trx"
45
+ # Run .NET Core 3.1 unit tests
46
+ - script : dotnet test --no-build -c $(BuildConfiguration) -f netcoreapp3.1 -l "trx;LogFileName=VSTestResults_netcoreapp3.1.trx"
51
47
displayName : Run .NET Core 3.1 unit tests
52
48
53
- # Run .NET Framework 4.7.2 tests
54
- - script : dotnet test -c Release -f net472 -l "trx;LogFileName=VSTestResults_net472.trx"
49
+ # Run .NET Framework 4.7.2 unit tests
50
+ - script : dotnet test --no-build -c $(BuildConfiguration) -f net472 -l "trx;LogFileName=VSTestResults_net472.trx"
55
51
displayName : Run .NET Framework 4.7.2 unit tests
56
52
57
53
# Publish test results
58
54
- task : PublishTestResults@2
59
55
displayName : Publish test results
60
56
inputs :
61
- testResultsFormat : ' VSTest'
62
- testResultsFiles : ' **/ VSTestResults*.trx'
57
+ testResultsFormat : VSTest
58
+ testResultsFiles : ~build/*/TestResults/ VSTestResults*.trx
63
59
condition : always()
64
60
65
- # Create the NuGet package(s)
66
- - script : dotnet pack -c Release
67
- displayName : Create NuGet package(s)
61
+ # Pack solution
62
+ - script : dotnet pack --no-build -c $(BuildConfiguration)
63
+ displayName : Pack solution
68
64
69
- # Sign package(s)
65
+ # Sign packages
70
66
- pwsh : build/Sign-Package.ps1
71
67
displayName : Authenticode sign packages
72
68
env :
0 commit comments