|
| 1 | +trigger: |
| 2 | + branches: |
| 3 | + include: |
| 4 | + - master |
| 5 | + paths: |
| 6 | + exclude: |
| 7 | + - docs/* |
| 8 | + - .github/* |
| 9 | +pr: |
| 10 | + branches: |
| 11 | + include: |
| 12 | + - master |
| 13 | + - release/* |
| 14 | + paths: |
| 15 | + exclude: |
| 16 | + - docs/* |
| 17 | + - .github/* |
| 18 | + |
| 19 | +pool: |
| 20 | + vmImage: ubuntu-18.04 |
| 21 | + |
| 22 | +variables: |
| 23 | + buildConfiguration: Debug |
| 24 | + publishOutput: $(System.DefaultWorkingDirectory)/src/bin/managed-publish |
| 25 | + dotnetCoreSdkVersion: 3.1.107 |
| 26 | + |
| 27 | +jobs: |
| 28 | + |
| 29 | +- job: build_linux_profiler |
| 30 | + |
| 31 | + steps: |
| 32 | + - task: UseDotNet@2 |
| 33 | + displayName: install dotnet core sdk 3.1 |
| 34 | + inputs: |
| 35 | + version: $(dotnetCoreSdkVersion) |
| 36 | + |
| 37 | + - task: DotNetCoreCLI@2 |
| 38 | + displayName: dotnet build Datadog.Trace.ClrProfiler.Managed.Loader |
| 39 | + inputs: |
| 40 | + command: build |
| 41 | + projects: src/Datadog.Trace.ClrProfiler.Managed.Loader/Datadog.Trace.ClrProfiler.Managed.Loader.csproj |
| 42 | + arguments: --configuration $(buildConfiguration) |
| 43 | + |
| 44 | + - task: DotNetCoreCLI@2 |
| 45 | + displayName: dotnet publish Datadog.Trace.ClrProfiler.Managed |
| 46 | + inputs: |
| 47 | + command: publish |
| 48 | + publishWebProjects: false |
| 49 | + modifyOutputPath: false |
| 50 | + zipAfterPublish: false |
| 51 | + projects: src/Datadog.Trace.ClrProfiler.Managed/Datadog.Trace.ClrProfiler.Managed.csproj |
| 52 | + arguments: --configuration $(buildConfiguration) --framework netstandard2.0 --output $(publishOutput)/netstandard2.0 |
| 53 | + |
| 54 | + - task: DockerCompose@0 |
| 55 | + displayName: docker-compose run Profiler |
| 56 | + inputs: |
| 57 | + containerregistrytype: Container Registry |
| 58 | + dockerComposeCommand: run Profiler |
| 59 | + |
| 60 | + - publish: $(System.DefaultWorkingDirectory)/src/Datadog.Trace.ClrProfiler.Native/bin/$(buildConfiguration)/x64 |
| 61 | + artifact: linux-tracer-home |
| 62 | + |
| 63 | +- job: Linux |
| 64 | + dependsOn: build_linux_profiler |
| 65 | + condition: succeeded() |
| 66 | + strategy: |
| 67 | + matrix: |
| 68 | + # Temporarily running only netcoreapp3_1 |
| 69 | + # netcoreapp2_1: |
| 70 | + # publishTargetFramework: netcoreapp2.1 |
| 71 | + # netcoreapp3_0: |
| 72 | + # publishTargetFramework: netcoreapp3.0 |
| 73 | + netcoreapp3_1: |
| 74 | + publishTargetFramework: netcoreapp3.1 |
| 75 | + |
| 76 | + variables: |
| 77 | + TestAllPackageVersions: true |
| 78 | + |
| 79 | + steps: |
| 80 | + - download: current |
| 81 | + artifact: linux-tracer-home |
| 82 | + |
| 83 | + - task: CopyFiles@2 |
| 84 | + inputs: |
| 85 | + sourceFolder: $(Pipeline.Workspace)/linux-tracer-home |
| 86 | + targetFolder: $(System.DefaultWorkingDirectory)/src/Datadog.Trace.ClrProfiler.Native/bin/$(buildConfiguration)/x64 |
| 87 | + |
| 88 | + - task: DockerCompose@0 |
| 89 | + displayName: docker-compose run build |
| 90 | + inputs: |
| 91 | + containerregistrytype: Container Registry |
| 92 | + dockerComposeCommand: run -e TestAllPackageVersions=true -e buildConfiguration=$(buildConfiguration) -e publishTargetFramework=$(publishTargetFramework) build |
| 93 | + |
| 94 | + - task: DockerCompose@0 |
| 95 | + displayName: docker-compose run IntegrationTests |
| 96 | + inputs: |
| 97 | + containerregistrytype: Container Registry |
| 98 | + dockerComposeCommand: run -e TestAllPackageVersions=true -e buildConfiguration=$(buildConfiguration) -e publishTargetFramework=$(publishTargetFramework) IntegrationTests |
| 99 | + |
| 100 | + - task: PublishTestResults@2 |
| 101 | + displayName: publish test results |
| 102 | + inputs: |
| 103 | + testResultsFormat: VSTest |
| 104 | + testResultsFiles: test/**/*.trx |
| 105 | + condition: succeededOrFailed() |
| 106 | + |
| 107 | +- job: build_alpine_linux_profiler |
| 108 | + |
| 109 | + steps: |
| 110 | + - task: UseDotNet@2 |
| 111 | + displayName: install dotnet core sdk 3.1 |
| 112 | + inputs: |
| 113 | + version: $(dotnetCoreSdkVersion) |
| 114 | + |
| 115 | + - task: DotNetCoreCLI@2 |
| 116 | + displayName: dotnet build Datadog.Trace.ClrProfiler.Managed.Loader |
| 117 | + inputs: |
| 118 | + command: build |
| 119 | + projects: src/Datadog.Trace.ClrProfiler.Managed.Loader/Datadog.Trace.ClrProfiler.Managed.Loader.csproj |
| 120 | + arguments: --configuration $(buildConfiguration) |
| 121 | + |
| 122 | + - task: DotNetCoreCLI@2 |
| 123 | + displayName: dotnet publish Datadog.Trace.ClrProfiler.Managed |
| 124 | + inputs: |
| 125 | + command: publish |
| 126 | + publishWebProjects: false |
| 127 | + modifyOutputPath: false |
| 128 | + zipAfterPublish: false |
| 129 | + projects: src/Datadog.Trace.ClrProfiler.Managed/Datadog.Trace.ClrProfiler.Managed.csproj |
| 130 | + arguments: --configuration $(buildConfiguration) --framework netstandard2.0 --output $(publishOutput)/netstandard2.0 |
| 131 | + |
| 132 | + - task: DockerCompose@0 |
| 133 | + displayName: docker-compose run Profiler.Alpine |
| 134 | + inputs: |
| 135 | + containerregistrytype: Container Registry |
| 136 | + dockerComposeCommand: run Profiler.Alpine |
| 137 | + |
| 138 | + - publish: $(System.DefaultWorkingDirectory)/src/Datadog.Trace.ClrProfiler.Native/bin/$(buildConfiguration)/x64 |
| 139 | + artifact: alpine-linux-tracer-home |
| 140 | + |
| 141 | +- job: Alpine_Linux |
| 142 | + dependsOn: build_alpine_linux_profiler |
| 143 | + condition: succeeded() |
| 144 | + strategy: |
| 145 | + matrix: |
| 146 | + # Temporarily running only netcoreapp3_1 |
| 147 | + # netcoreapp2_1: |
| 148 | + # publishTargetFramework: netcoreapp2.1 |
| 149 | + # netcoreapp3_0: |
| 150 | + # publishTargetFramework: netcoreapp3.0 |
| 151 | + netcoreapp3_1: |
| 152 | + publishTargetFramework: netcoreapp3.1 |
| 153 | + |
| 154 | + variables: |
| 155 | + TestAllPackageVersions: true |
| 156 | + |
| 157 | + steps: |
| 158 | + - download: current |
| 159 | + artifact: alpine-linux-tracer-home |
| 160 | + |
| 161 | + - task: CopyFiles@2 |
| 162 | + inputs: |
| 163 | + sourceFolder: $(Pipeline.Workspace)/alpine-linux-tracer-home |
| 164 | + targetFolder: $(System.DefaultWorkingDirectory)/src/Datadog.Trace.ClrProfiler.Native/bin/$(buildConfiguration)/x64 |
| 165 | + |
| 166 | + - task: DockerCompose@0 |
| 167 | + displayName: docker-compose run build |
| 168 | + inputs: |
| 169 | + containerregistrytype: Container Registry |
| 170 | + dockerComposeCommand: run -e TestAllPackageVersions=true -e buildConfiguration=$(buildConfiguration) -e publishTargetFramework=$(publishTargetFramework) build |
| 171 | + |
| 172 | + - task: DockerCompose@0 |
| 173 | + displayName: docker-compose run IntegrationTests.Alpine.Core21 |
| 174 | + condition: eq(variables['publishTargetFramework'], 'netcoreapp2.1') |
| 175 | + inputs: |
| 176 | + containerregistrytype: Container Registry |
| 177 | + dockerComposeCommand: run -e TestAllPackageVersions=true -e buildConfiguration=$(buildConfiguration) IntegrationTests.Alpine.Core21 |
| 178 | + |
| 179 | + - task: DockerCompose@0 |
| 180 | + displayName: docker-compose run IntegrationTests.Alpine.Core30 |
| 181 | + condition: eq(variables['publishTargetFramework'], 'netcoreapp3.0') |
| 182 | + inputs: |
| 183 | + containerregistrytype: Container Registry |
| 184 | + dockerComposeCommand: run -e TestAllPackageVersions=true -e buildConfiguration=$(buildConfiguration) IntegrationTests.Alpine.Core30 |
| 185 | + |
| 186 | + - task: DockerCompose@0 |
| 187 | + displayName: docker-compose run IntegrationTests.Alpine.Core31 |
| 188 | + condition: eq(variables['publishTargetFramework'], 'netcoreapp3.1') |
| 189 | + inputs: |
| 190 | + containerregistrytype: Container Registry |
| 191 | + dockerComposeCommand: run -e TestAllPackageVersions=true -e buildConfiguration=$(buildConfiguration) IntegrationTests.Alpine.Core31 |
| 192 | + |
| 193 | + - task: PublishTestResults@2 |
| 194 | + displayName: publish test results |
| 195 | + inputs: |
| 196 | + testResultsFormat: VSTest |
| 197 | + testResultsFiles: test/**/*.trx |
| 198 | + condition: succeededOrFailed() |
| 199 | + |
| 200 | +- job: Windows |
| 201 | + strategy: |
| 202 | + matrix: |
| 203 | + x64: |
| 204 | + buildPlatform: x64 |
| 205 | + enable32bit: false |
| 206 | + x86: |
| 207 | + buildPlatform: x86 |
| 208 | + enable32bit: true |
| 209 | + pool: |
| 210 | + vmImage: windows-2019 |
| 211 | + variables: |
| 212 | + msiOutputDirectory: deploy/Datadog.Trace.ClrProfiler.WindowsInstaller/bin/$(buildConfiguration)/$(buildPlatform)/en-us |
| 213 | + |
| 214 | + steps: |
| 215 | + - task: UseDotNet@2 |
| 216 | + displayName: install dotnet core sdk 2.1 |
| 217 | + inputs: |
| 218 | + packageType: sdk |
| 219 | + version: 2.1.x |
| 220 | + |
| 221 | + - task: UseDotNet@2 |
| 222 | + displayName: install dotnet core sdk 3.0 |
| 223 | + inputs: |
| 224 | + packageType: sdk |
| 225 | + version: 3.0.x |
| 226 | + |
| 227 | + - task: UseDotNet@2 |
| 228 | + displayName: install dotnet core sdk 3.1 |
| 229 | + inputs: |
| 230 | + packageType: sdk |
| 231 | + version: $(dotnetCoreSdkVersion) |
| 232 | + |
| 233 | + - task: NuGetToolInstaller@1 |
| 234 | + displayName: install nuget |
| 235 | + |
| 236 | + - task: NuGetCommand@2 |
| 237 | + displayName: nuget restore |
| 238 | + inputs: |
| 239 | + restoreSolution: Datadog.Trace.sln |
| 240 | + verbosityRestore: Normal |
| 241 | + |
| 242 | + # this triggers a dependency chain that builds all the managed and native dlls |
| 243 | + - task: MSBuild@1 |
| 244 | + displayName: msbuild tracer-home |
| 245 | + inputs: |
| 246 | + solution: Datadog.Trace.proj |
| 247 | + platform: $(buildPlatform) |
| 248 | + configuration: $(buildConfiguration) |
| 249 | + msbuildArguments: /t:msi /p:RunWixToolsOutOfProc=true /p:TracerHomeDirectory=$(publishOutput) |
| 250 | + maximumCpuCount: true |
| 251 | + |
| 252 | + - task: MSBuild@1 |
| 253 | + displayName: Build .NET Framework projects (not SDK-based projects) |
| 254 | + inputs: |
| 255 | + solution: Datadog.Trace.proj |
| 256 | + platform: $(buildPlatform) |
| 257 | + configuration: $(buildConfiguration) |
| 258 | + msbuildArguments: /t:BuildFrameworkReproductions |
| 259 | + maximumCpuCount: true |
| 260 | + |
| 261 | + - task: DotNetCoreCLI@2 |
| 262 | + displayName: dotnet build integration tests |
| 263 | + inputs: |
| 264 | + command: build |
| 265 | + projects: | |
| 266 | + reproductions/**/*.csproj |
| 267 | + samples/**/*.csproj |
| 268 | + test/*.IntegrationTests/*.IntegrationTests.csproj |
| 269 | + !reproductions/**/ExpenseItDemo*.csproj |
| 270 | + !reproductions/**/EntityFramework6x*.csproj |
| 271 | + !reproductions/**/StackExchange.Redis.AssemblyConflict.LegacyProject.csproj |
| 272 | + arguments: --configuration $(buildConfiguration) -p:Platform=$(buildPlatform) -p:ManagedProfilerOutputDirectory=$(publishOutput) |
| 273 | + |
| 274 | + - task: NuGetCommand@2 |
| 275 | + displayName: nuget restore IIS samples |
| 276 | + inputs: |
| 277 | + restoreSolution: samples-iis/samples-iis.sln |
| 278 | + verbosityRestore: Normal |
| 279 | + |
| 280 | + - task: MSBuild@1 |
| 281 | + displayName: Publish IIS samples |
| 282 | + inputs: |
| 283 | + solution: samples-iis/samples-iis.sln |
| 284 | + configuration: '$(buildConfiguration)' |
| 285 | + msbuildArguments: '/p:DeployOnBuild=true /p:PublishProfile=FolderProfile.pubxml' |
| 286 | + maximumCpuCount: true |
| 287 | + |
| 288 | + - task: DockerCompose@0 |
| 289 | + displayName: docker-compose build IIS containers |
| 290 | + inputs: |
| 291 | + containerregistrytype: Container Registry |
| 292 | + dockerComposeCommand: build --build-arg DOTNET_TRACER_MSI=$(msiOutputDirectory)/*.msi --build-arg ENABLE_32_BIT=$(enable32bit) IntegrationTests.IIS.LoaderOptimizationRegKey |
| 293 | + |
| 294 | + - task: DockerCompose@0 |
| 295 | + displayName: docker-compose start IIS containers |
| 296 | + inputs: |
| 297 | + containerregistrytype: Container Registry |
| 298 | + dockerComposeCommand: up -d IntegrationTests.IIS.LoaderOptimizationRegKey |
| 299 | + |
| 300 | + - task: DotNetCoreCLI@2 |
| 301 | + displayName: dotnet test |
| 302 | + inputs: |
| 303 | + command: test |
| 304 | + configuration: $(buildConfiguration) |
| 305 | + projects: | |
| 306 | + test/Datadog.Trace.IntegrationTests/Datadog.Trace.IntegrationTests.csproj |
| 307 | + test/Datadog.Trace.OpenTracing.IntegrationTests/Datadog.Trace.OpenTracing.IntegrationTests.csproj |
| 308 | + arguments: -p:Platform=$(buildPlatform) |
| 309 | + |
| 310 | + - task: DotNetCoreCLI@2 |
| 311 | + displayName: dotnet test |
| 312 | + inputs: |
| 313 | + command: test |
| 314 | + configuration: $(buildConfiguration) |
| 315 | + projects: test/Datadog.Trace.ClrProfiler.IntegrationTests/Datadog.Trace.ClrProfiler.IntegrationTests.csproj |
| 316 | + arguments: --filter "(RunOnWindows=True|Category=Smoke)&LoadFromGAC!=True" -p:Platform=$(buildPlatform) |
| 317 | + |
| 318 | + - powershell: | |
| 319 | + [System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") |
| 320 | + $publish = New-Object System.EnterpriseServices.Internal.Publish |
| 321 | + Get-ChildItem $(publishOutput)/net45 -Filter *.dll | Foreach-Object { $publish.GacInstall($_.FullName) } |
| 322 | + displayName: Add net45 Datadog.Trace.ClrProfiler.Managed assets to the GAC |
| 323 | +
|
| 324 | + - task: DotNetCoreCLI@2 |
| 325 | + displayName: dotnet test --filter LoadFromGAC=True |
| 326 | + inputs: |
| 327 | + command: test |
| 328 | + configuration: $(buildConfiguration) |
| 329 | + projects: test/Datadog.Trace.ClrProfiler.IntegrationTests/Datadog.Trace.ClrProfiler.IntegrationTests.csproj |
| 330 | + arguments: --filter "(RunOnWindows=True|Category=Smoke)&LoadFromGAC=True" -p:Platform=$(buildPlatform) |
| 331 | + |
| 332 | + - task: DockerCompose@0 |
| 333 | + displayName: docker-compose stop services |
| 334 | + inputs: |
| 335 | + containerregistrytype: Container Registry |
| 336 | + dockerComposeCommand: down |
| 337 | + condition: succeededOrFailed() |
0 commit comments