forked from microsoft/slngen
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
126 lines (112 loc) · 4.04 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
resources:
- repo: self
variables:
ArtifactsDirectoryName: 'artifacts'
BuildConfiguration: 'Debug'
BuildPlatform: 'Any CPU'
MSBuildArgs: '"/Property:Platform=$(BuildPlatform);Configuration=$(BuildConfiguration)"'
SignType: 'Test'
# Not using "--channel 10.0 --quality daily", see https://github.com/microsoft/slngen/issues/456
DotNet10InstallArgs: '-version 10.0.100-alpha.1.24571.14'
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'
- script: |
powershell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) $(DotNet10InstallArgs) -InstallDir C:\hostedtoolcache\windows\dotnet"
dotnet --info
displayName: 'Install .NET 10.x (Windows)'
condition: eq(variables.osName, 'Windows')
- script: |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin $(DotNet10InstallArgs) --install-dir /opt/hostedtoolcache/dotnet
dotnet --info
displayName: 'Install .NET 10.x (Linux)'
condition: eq(variables.osName, 'Linux')
- script: |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin $(DotNet10InstallArgs) --install-dir /Users/runner/hostedtoolcache/dotnet
dotnet --info
displayName: 'Install .NET 10.x (MacOS)'
condition: eq(variables.osName, 'MacOS')
- 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: DotNetCoreCLI@2
displayName: 'Run Unit Tests (.NET 10)'
inputs:
command: 'test'
arguments: '--no-restore --no-build --framework net10.0 /noautorsp $(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/test-net10.0.binlog"'
testRunTitle: '$(osName) .NET 10.0'
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts'
inputs:
PathtoPublish: '$(ArtifactsDirectoryName)'
ArtifactName: $(ArtifactsDirectoryName)-$(osName)
condition: always()