-
Notifications
You must be signed in to change notification settings - Fork 76
/
azure-pipelines.yml
99 lines (89 loc) · 2.64 KB
/
azure-pipelines.yml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
resources:
- repo: self
variables:
ArtifactsDirectoryName: 'artifacts'
BuildConfiguration: 'Debug'
BuildPlatform: 'Any CPU'
MSBuildArgs: '"/Property:Platform=$(BuildPlatform);Configuration=$(BuildConfiguration)"'
SignType: 'Test'
trigger:
batch: 'true'
branches:
include:
- 'main'
- 'rel/*'
paths:
exclude:
- '*.md'
pr:
branches:
include:
- 'main'
- 'rel/*'
paths:
exclude:
- '*.md'
jobs:
- job: BuildAndTest
strategy:
matrix:
Windows:
vmImage: windows-latest
osName: Windows
Linux:
vmImage: ubuntu-latest
osName: Linux
MacOS:
vmImage: macOS-latest
osName: MacOS
displayName: 'Build and Test'
pool:
vmImage: $(vmImage)
steps:
- task: UseDotNet@2
displayName: 'Install .NET 8.x'
inputs:
version: '8.x'
- task: UseDotNet@2
displayName: 'Install .NET 9.x'
inputs:
version: '9.x'
includePreviewVersions: true
- task: VSBuild@1
displayName: 'Build (Visual Studio)'
inputs:
msbuildArgs: '$(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/build.binlog"'
condition: eq(variables.osName, 'Windows')
- task: DotNetCoreCLI@2
displayName: 'Build (dotnet)'
inputs:
command: 'build'
arguments: '$(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/build.binlog"'
condition: ne(variables.osName, 'Windows')
- task: DotNetCoreCLI@2
displayName: 'Run Unit Tests (.NET Framework v4.7.2)'
inputs:
command: 'test'
arguments: '--no-restore --no-build --framework net472 /noautorsp $(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/test-net472.binlog"'
testRunTitle: '$(osName) .NET Framework v4.7.2'
condition: and(succeededOrFailed(), eq(variables.osName, 'Windows'))
- task: DotNetCoreCLI@2
displayName: 'Run Unit Tests (.NET 8)'
inputs:
command: 'test'
arguments: '--no-restore --no-build --framework net8.0 /noautorsp $(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/test-net8.0.binlog"'
testRunTitle: '$(osName) .NET 8.0'
condition: succeededOrFailed()
- task: DotNetCoreCLI@2
displayName: 'Run Unit Tests (.NET 9)'
inputs:
command: 'test'
arguments: '--no-restore --no-build --framework net9.0 /noautorsp $(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/test-net9.0.binlog"'
testRunTitle: '$(osName) .NET 9.0'
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts'
inputs:
PathtoPublish: '$(ArtifactsDirectoryName)'
ArtifactName: $(ArtifactsDirectoryName)-$(osName)
condition: always()