forked from dotnet/Nerdbank.GitVersioning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
151 lines (141 loc) · 4.49 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
trigger:
batch: true
branches:
include:
- main
- 'v*.*'
- 'validate/*'
paths:
exclude:
- doc/
- '*.md'
- .vscode/
- .github/
- azure-pipelines/release.yml
parameters:
- name: RunTests
displayName: Run tests
type: boolean
default: true
resources:
containers:
- container: focal
image: mcr.microsoft.com/dotnet/sdk:6.0-focal
- container: jammy60
image: mcr.microsoft.com/dotnet/sdk:6.0-jammy
- container: jammy70
image: mcr.microsoft.com/dotnet/sdk:7.0-jammy
- container: debian
image: mcr.microsoft.com/dotnet/sdk:latest
variables:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
BuildConfiguration: Release
codecov_token: 92266a45-648d-454e-8fec-beffae2e6553
ci_feed: https://pkgs.dev.azure.com/andrewarnott/OSS/_packaging/PublicCI/nuget/v3/index.json
ci_npm_feed: https://pkgs.dev.azure.com/andrewarnott/OSS/_packaging/PublicCI/npm/registry/
NUGET_PACKAGES: $(Agent.TempDirectory)/.nuget/packages/
stages:
- stage: Build
jobs:
- template: azure-pipelines/build.yml
parameters:
RunTests: ${{ parameters.RunTests }}
- stage: Test
displayName: Functional testing
condition: and(succeeded(), ${{ parameters.RunTests }})
jobs:
- job: linux
strategy:
matrix:
Ubuntu_Focal:
containerImage: focal
Ubuntu_Jammy_60:
containerImage: jammy60
Ubuntu_Jammy_70:
containerImage: jammy70
Debian:
containerImage: debian
pool:
vmImage: ubuntu-22.04
container: $[ variables['containerImage'] ]
steps:
- bash: $(configureContainerCommand)
displayName: Configure container
condition: ne(variables['configureContainerCommand'], '')
- template: azure-pipelines/xplattest-pipeline.yml
- job: macOS
strategy:
matrix:
macOS_Catalina:
vmImage: macOS-12
macOS_Monterey:
vmImage: macOS-12
pool:
vmImage: $[ variables['vmImage'] ]
steps:
- template: azure-pipelines/xplattest-pipeline.yml
- stage: PerfAnalysis
displayName: Perf analysis
dependsOn: []
jobs:
- job: PerfTest
strategy:
matrix:
ubuntu:
imageName: ubuntu-22.04
repoDir: '~/git'
windows:
imageName: windows-2022
repoDir: '${USERPROFILE}/source/repos'
macOS:
imageName: macOS-12
repoDir: '~/git'
pool:
vmImage: $(imageName)
steps:
- checkout: self
fetchDepth: 0 # avoid shallow clone so nbgv can do its work.
clean: true
submodules: true # keep the warnings quiet about the wiki not being enlisted
- task: UseDotNet@2
displayName: Install .NET 7.0.302 SDK
inputs:
packageType: sdk
version: 7.0.302
- script: dotnet --info
displayName: Show dotnet SDK info
- bash: |
mkdir -p $(repoDir)
git clone https://github.com/xunit/xunit $(repoDir)/xunit
git clone https://github.com/gimlichael/Cuemon $(repoDir)/Cuemon
git clone https://github.com/kerryjiang/SuperSocket $(repoDir)/SuperSocket
git clone https://github.com/dotnet/Nerdbank.GitVersioning $(repoDir)/Nerdbank.GitVersioning
displayName: Clone test repositories
- script: |
dotnet build -c Release
displayName: Build in Release mode
- script: |
dotnet run -c Release -f net7.0 -- --filter *GetVersionBenchmarks* --artifacts $(Build.ArtifactStagingDirectory)/benchmarks/packed/$(imageName)
workingDirectory: test/Nerdbank.GitVersioning.Benchmarks
displayName: Run benchmarks (packed)
- bash: |
cd $(repoDir)/xunit
git unpack-objects < .git/objects/pack/*.pack
cd $(repoDir)/Cuemon
git unpack-objects < .git/objects/pack/*.pack
cd $(repoDir)/SuperSocket
git unpack-objects < .git/objects/pack/*.pack
cd $(repoDir)/Nerdbank.GitVersioning
git unpack-objects < .git/objects/pack/*.pack
displayName: Unpack Git repositories
- script: |
dotnet run -c Release -f net7.0 -- --filter '*GetVersionBenchmarks*' --artifacts $(Build.ArtifactStagingDirectory)/benchmarks/unpacked/$(imageName)
workingDirectory: test/Nerdbank.GitVersioning.Benchmarks
displayName: Run benchmarks (unpacked)
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/benchmarks
ArtifactName: benchmarks
ArtifactType: Container
displayName: Publish benchmarks artifacts
condition: succeededOrFailed()