-
Notifications
You must be signed in to change notification settings - Fork 6
/
azure-pipelines.yml
74 lines (62 loc) · 1.8 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
trigger:
- main
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: UseDotNet@2
displayName: 'Use .NET 8'
inputs:
packageType: 'sdk'
version: '8.x'
- task: UseDotNet@2
displayName: 'Use .NET 9'
inputs:
packageType: 'sdk'
version: '9.x'
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
projects: '**/*.csproj'
arguments: '--configuration $(BuildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: test
arguments: '--framework net8.0 --no-build --no-restore --configuration $(BuildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'dotnet test (coverage)'
inputs:
command: test
arguments: '--framework net9.0 --no-build --no-restore --configuration $(BuildConfiguration) --collect:"XPlat Code Coverage"'
- task: DotNetCoreCLI@2
displayName: 'dotnet tool restore'
inputs:
command: 'custom'
custom: 'tool'
arguments: 'restore'
- task: CopyFiles@2
displayName: 'Copy bin and obj folders'
inputs:
Contents: |
$(Build.SourcesDirectory)\LICENSE.txt
$(Build.SourcesDirectory)\Maoli\bin\**\*.*
$(Build.SourcesDirectory)\Maoli\obj\project.assets.json
$(Build.SourcesDirectory)\Maoli\icon.png
$(Build.SourcesDirectory)\Maoli\Maoli.csproj
TargetFolder: '$(Build.ArtifactStagingDirectory)\Maoli'
CleanTargetFolder: true
OverWrite: true
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
- task: PublishCodeCoverageResults@2
displayName: 'Publish code coverage'
inputs:
summaryFileLocation: '$(Agent.TempDirectory)\**\coverage.cobertura.xml'