-
Notifications
You must be signed in to change notification settings - Fork 19
/
azure-pipelines.yml
90 lines (80 loc) · 2.38 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
resources:
- repo: self
variables:
ArtifactsDirectoryName: 'artifacts'
BuildConfiguration: 'Debug'
BuildPlatform: 'Any CPU'
DotNet7Version: '7.x'
DotNet8Version: '8.x'
ContinuousIntegrationBuild: 'true'
MSBuildArguments: '"/BinaryLogger:$(Build.SourcesDirectory)\$(ArtifactsDirectoryName)\msbuild.binlog"'
CommonTestArguments: '/noautorsp --no-restore --no-build --configuration:$(BuildConfiguration)'
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true'
DOTNET_MULTILEVEL_LOOKUP: 'false'
trigger:
batch: 'true'
branches:
include:
- 'main'
- 'refs/tags/*'
paths:
exclude:
- '*.md'
pr:
branches:
include:
- 'main'
paths:
exclude:
- '*.md'
jobs:
- job: BuildAndTest
displayName: 'Build and Test'
pool:
vmImage: windows-latest
steps:
- script: 'echo ##vso[task.setvariable variable=BuildConfiguration;]Release'
displayName: 'Set BuildConfiguration to Release for tagged commits'
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
- task: UseDotNet@2
displayName: 'Install .NET $(DotNet7Version)'
inputs:
version: '$(DotNet7Version)'
- task: UseDotNet@2
displayName: 'Install .NET $(DotNet8Version)'
inputs:
version: '$(DotNet8Version)'
- task: MSBuild@1
displayName: 'Build Solution'
inputs:
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArguments: '$(MSBuildArguments)'
- task: DotNetCoreCLI@2
displayName: 'Run Unit Tests (.NET Framework)'
inputs:
command: 'test'
arguments: '$(CommonTestArguments) --framework net472'
testRunTitle: '.NET Framework v4.7.2'
condition: succeededOrFailed()
- task: DotNetCoreCLI@2
displayName: 'Run Unit Tests (.NET 7.0)'
inputs:
command: 'test'
arguments: '$(CommonTestArguments) --framework net7.0'
testRunTitle: '.NET 7.0'
condition: succeededOrFailed()
- task: DotNetCoreCLI@2
displayName: 'Run Unit Tests (.NET 8.0)'
inputs:
command: 'test'
arguments: '$(CommonTestArguments) --framework net8.0'
testRunTitle: '.NET 8.0'
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts'
inputs:
PathtoPublish: '$(ArtifactsDirectoryName)'
ArtifactName: $(ArtifactsDirectoryName)
condition: always()