-
Notifications
You must be signed in to change notification settings - Fork 18
536 lines (524 loc) · 20.2 KB
/
ci.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
name: ci
on:
push:
branches:
- main
tags:
- 'v*'
paths-ignore:
- dev/*
- docs/*
# The following is a list of shared asset locations.
# This is the config for the Tracer CI pipeline,
# so we are excluding shared assets that are not currently used by the Tracer.
# We make this list granular, rather than catch-all, on purpose.
# It makes it easier to selectively remove items from the list, once the Tracer starts using them.
# - The Managed Loader:
- shared/samples/Datadog.AutoInstrumentation.ManagedLoader.Demo/*
- shared/src/managed-lib/ManagedLoader/*
# - Dynamic Bindings for DiagnosticSource:
- shared/samples/Datadog.DynamicDiagnosticSourceBindings.Demo/*
- shared/src/managed-lib/DynamicDiagnosticSourceBindings/*
# - Logging demo samples:
- shared/samples/Datadog.Logging.Demo/*
# - Managed utility APIs (may be used transitively):
- shared/src/managed-src/Datadog.Collections/*
- shared/src/managed-src/Datadog.Util/*
# - Managed Logging APIs (may be used transitively):
- shared/src/managed-src/Datadog.Logging.Emission/*
- shared/src/managed-src/Datadog.Logging.Composition/*
- shared/src/managed-src/Datadog.Logging/*
# - Fmt lib:
- shared/src/native-lib/fmt_x64-windows-static/*
- shared/src/native-lib/fmt_x86-windows-static/*
# - Spdlob lib:
- shared/src/native-lib/spdlog/*
# - Mics common native sources:
- shared/src/native-src/*
pull_request:
workflow_dispatch:
env:
buildConfiguration: Release
dotnetSdkVersion: 7.0.101
relativeTracerHome: /shared/bin/monitoring-home/tracer
relativeArtifacts: /tracer/src/bin/artifacts
binDir: ${{ github.workspace }}/tracer/src/bin
ddTracerHome: ${{ github.workspace }}/tracer/src/bin/dd-tracer-home
tracerHome: ${{ github.workspace }}/shared/bin/monitoring-home/tracer
profilerSrcDirectory: ${{ github.workspace }}/../dd-continuous-profiler-dotnet
artifacts: ${{ github.workspace }}/tracer/src/bin/artifacts
isMainBranch: $[eq(github.ref, 'refs/heads/main')]
NugetPackageDirectory: ${{ github.workspace }}/packages
relativeNugetPackageDirectory: packages
dotnetToolTag: build-dotnet-tool
Verify_DisableClipboard: true
DiffEngine_Disabled: true
jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
machine: [ windows-2022, ubuntu-20.04 ]
runs-on: ${{ matrix.machine }}
timeout-minutes: 30
steps:
- name: Support Windows long paths
if: ${{ runner.os == 'Windows' }}
run: git config --system core.longpaths true
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
dotnet-version: |
2.1.818
3.1.426
5.0.408
6.0.404
7.0.101
- name: Install CMake 3.19.8
if: ${{ runner.os == 'Linux' }}
run: curl -sL https://cmake.org/files/v3.19/cmake-3.19.8-Linux-x86_64.sh -o cmakeinstall.sh && chmod +x cmakeinstall.sh && sudo ./cmakeinstall.sh --prefix=/usr/local --exclude-subdir
- name: Install fpm
if: ${{ runner.os == 'Linux' }}
run: sudo gem install --no-document fpm
- name: Build tracer home
run: ./tracer/build.cmd Clean BuildTracerHome PackageTracerHome
- name: Publish Tracer
uses: actions/[email protected]
with:
path: ${{ env.tracerHome }}
name: ${{ matrix.machine }}-tracer-home
- name: Publish Windows x86 MSI
if: ${{ runner.os == 'Windows' }}
uses: actions/[email protected]
with:
path: ${{ env.artifacts }}/x86/en-us
name: windows-msi-x86
- name: Publish Windows x64 MSI
if: ${{ runner.os == 'Windows' }}
uses: actions/[email protected]
with:
path: ${{ env.artifacts }}/x64/en-us
name: windows-msi-x64
- name: Publish Linux x64 packages
if: ${{ runner.os == 'Linux' }}
uses: actions/[email protected]
with:
path: ${{ env.artifacts }}/linux-x64
name: linux-x64-packages
- name: Publish NuGet packages
if: ${{ runner.os == 'Windows' }}
uses: actions/[email protected]
with:
path: ${{ env.artifacts }}/nuget/SignalFx.NET.Tracing.Azure.Site.Extension.*.nupkg
name: nuget-packages
container-build:
name: Container Build
strategy:
fail-fast: false
matrix:
base-image: [ alpine ]
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
dotnet-version: |
2.1.818
3.1.426
5.0.408
6.0.404
7.0.101
- name: Build Docker image
run: |
docker build \
--build-arg DOTNETSDK_VERSION=${dotnetSdkVersion} \
--tag dd-trace-dotnet/${{ matrix.base-image }}-builder \
--target builder \
--file "./tracer/build/_build/docker/${{ matrix.base-image }}.dockerfile" \
"./tracer/build/_build"
- name: Build in Docker container
run: |
docker run --rm \
--mount type=bind,source="${GITHUB_WORKSPACE}",target=/project \
--env NugetPackageDirectory=/project/$(relativeNugetPackageDirectory) \
--env tracerHome=/project/${relativeTracerHome} \
--env artifacts=/project/${relativeArtifacts} \
--env SIGNALFX_CLR_ENABLE_NGEN=${SIGNALFX_CLR_ENABLE_NGEN} \
dd-trace-dotnet/${{ matrix.base-image }}-builder \
dotnet /build/bin/Debug/_build.dll Clean BuildTracerHome ZipMonitoringHome
- name: Publish Linux x64-musl packages
uses: actions/[email protected]
with:
path: ${{ env.artifacts }}/linux-x64
name: linux-x64-musl-packages
if: (${{ job.status }} != 'cancelled')
continue-on-error: true
managed-unit-tests:
name: Managed unit tests
strategy:
fail-fast: false
matrix:
machine: [ windows-2022, ubuntu-20.04 ]
runs-on: ${{ matrix.machine }}
timeout-minutes: 30
steps:
- name: Support Windows long paths
if: ${{ runner.os == 'Windows' }}
run: git config --system core.longpaths true
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
dotnet-version: |
2.1.818
3.1.426
5.0.408
6.0.404
7.0.101
- run: ./tracer/build.cmd Clean BuildTracerHome BuildAndRunManagedUnitTests
- uses: actions/[email protected]
with:
name: ${{ matrix.machine }}-managed-unit-tests-build_data
path: tracer/build_data
if: (${{ job.status }} != 'cancelled')
continue-on-error: true
container-managed-unit-tests:
name: Container Managed unit tests
strategy:
fail-fast: false
matrix:
base-image: [ alpine ]
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
dotnet-version: |
2.1.818
3.1.426
5.0.408
6.0.404
7.0.101
- name: Build Docker image
run: |
docker build \
--build-arg DOTNETSDK_VERSION=${dotnetSdkVersion} \
--tag dd-trace-dotnet/${{ matrix.base-image }}-tester \
--target tester \
--file "./tracer/build/_build/docker/${{ matrix.base-image }}.dockerfile" \
"./tracer/build/_build"
- name: Managed tests in Docker container
run: |
docker run --rm \
--mount type=bind,source="${GITHUB_WORKSPACE}",target=/project \
--env NugetPackageDirectory=/project/$(relativeNugetPackageDirectory) \
--env tracerHome=/project/${relativeTracerHome} \
--env artifacts=/project/${relativeArtifacts} \
--env SIGNALFX_CLR_ENABLE_NGEN=${SIGNALFX_CLR_ENABLE_NGEN} \
dd-trace-dotnet/${{ matrix.base-image }}-tester \
dotnet /build/bin/Debug/_build.dll Clean BuildTracerHome BuildAndRunManagedUnitTests
- name: Publish managed tests results
uses: actions/[email protected]
with:
name: ${{ matrix.base-image }}-managed-unit-tests-build_data
path: tracer/build_data
if: (${{ job.status }} != 'cancelled')
continue-on-error: true
native-unit-tests:
name: Native unit tests
strategy:
fail-fast: false
matrix:
machine: [ windows-2022, ubuntu-20.04 ]
runs-on: ${{ matrix.machine }}
timeout-minutes: 30
steps:
- name: Support Windows long paths
if: ${{ runner.os == 'Windows' }}
run: git config --system core.longpaths true
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
dotnet-version: |
2.1.818
3.1.426
5.0.408
6.0.404
7.0.101
- name: Install CMake 3.19.8
if: ${{ runner.os == 'Linux' }}
run: curl -sL https://cmake.org/files/v3.19/cmake-3.19.8-Linux-x86_64.sh -o cmakeinstall.sh && chmod +x cmakeinstall.sh && sudo ./cmakeinstall.sh --prefix=/usr/local --exclude-subdir
- name: Create logging path
if: ${{ runner.os == 'Linux' }}
run: sudo ./tracer/build/artifacts/createLogPath.sh
- run: ./tracer/build.cmd Clean BuildTracerHome BuildAndRunNativeUnitTests
container-native-unit-tests:
name: Container Native unit tests
strategy:
fail-fast: false
matrix:
base-image: [ alpine ]
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
dotnet-version: |
2.1.818
3.1.426
5.0.408
6.0.404
7.0.101
- name: Build Docker image
run: |
docker build \
--build-arg DOTNETSDK_VERSION=${dotnetSdkVersion} \
--tag dd-trace-dotnet/${{ matrix.base-image }}-builder \
--target builder \
--file "./tracer/build/_build/docker/${{ matrix.base-image }}.dockerfile" \
"./tracer/build/_build"
- name: Native tests in Docker container
run: |
docker run --rm \
--mount type=bind,source="${GITHUB_WORKSPACE}",target=/project \
--env NugetPackageDirectory=/project/$(relativeNugetPackageDirectory) \
--env tracerHome=/project/${relativeTracerHome} \
--env artifacts=/project/${relativeArtifacts} \
--env SIGNALFX_CLR_ENABLE_NGEN=${SIGNALFX_CLR_ENABLE_NGEN} \
dd-trace-dotnet/${{ matrix.base-image }}-builder \
dotnet /build/bin/Debug/_build.dll Clean BuildTracerHome BuildAndRunNativeUnitTests
- name: Publish native tests results
uses: actions/[email protected]
with:
name: ${{ matrix.base-image }}-native-unit-tests-build_data
path: tracer/build_data
if: (${{ job.status }} != 'cancelled')
continue-on-error: true
integration-tests:
name: Integration tests
strategy:
fail-fast: false
matrix:
machine: [ windows-2022 ]
platform: [ x64 ]
framework: [ net461, netcoreapp3.1, net5.0, net6.0, net7.0 ]
target: [ BuildAndRunWindowsIntegrationTests, BuildAndRunWindowsRegressionTests ]
runs-on: ${{ matrix.machine }}
timeout-minutes: 60
steps:
- name: Support Windows long paths
if: ${{ runner.os == 'Windows' }}
run: git config --system core.longpaths true
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
dotnet-version: |
2.1.818
3.1.426
5.0.408
6.0.404
7.0.101
# Cosmos is _way_ to flaky at the moment. Try enabling again at a later time
# - name: Start CosmosDB Emulator
# if: ${{ matrix.target == 'BuildAndRunWindowsIntegrationTests' }}
# shell: powershell
# run: |
# Write-Host "Starting CosmosDB Emulator"
# Import-Module "C:/Program Files/Azure Cosmos DB Emulator/PSModules/Microsoft.Azure.CosmosDB.Emulator"
# Start-CosmosDbEmulator -Timeout 300
# Workaround around long name being hit in MultiDomainHostTests.WorksOutsideTheGAC tests
- name: install Microsoft.Net.Component.4.6.1.TargetingPack
if: ${{ matrix.target == 'BuildAndRunWindowsRegressionTests' }}
run: |
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
$InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
$componentsToAdd = @(
"Microsoft.Net.Component.4.6.1.TargetingPack"
)
[string]$workloadArgs = $componentsToAdd | ForEach-Object {" --add " + $_}
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
if ($process.ExitCode -eq 0)
{
Write-Host "components have been successfully added"
}
else
{
Write-Host "components were not installed"
exit 1
}
- name: Subst for shorter path and Run Tests
run: |
subst y: .
y:
./tracer/build.cmd BuildTracerHome ${{ matrix.target }} -Framework ${{ matrix.framework }} -TargetPlatform ${{ matrix.platform }} --PrintDriveSpace
- uses: actions/[email protected]
with:
name: ${{ matrix.machine }}-integration-tests-${{ matrix.platform }}-${{ matrix.framework }}-${{ matrix.target }}-build_data
path: tracer/build_data
if: (${{ job.status }} != 'cancelled')
continue-on-error: true
container-integration-tests:
name: Container Integration tests
strategy:
fail-fast: false
matrix:
base-image: [ debian, alpine ]
framework: [ netcoreapp3.1, net5.0, net6.0, net7.0 ]
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
dotnet-version: |
2.1.818
3.1.426
5.0.408
6.0.404
7.0.101
- name: Build Docker image
run: |
docker build \
--build-arg DOTNETSDK_VERSION=${dotnetSdkVersion} \
--tag dd-trace-dotnet/${{ matrix.base-image }}-builder \
--target builder \
--file "./tracer/build/_build/docker/${{ matrix.base-image }}.dockerfile" \
"./tracer/build/_build"
- name: Build integration tests in Docker container
run: |
docker run --rm \
--mount type=bind,source="${GITHUB_WORKSPACE}",target=/project \
--env NugetPackageDirectory=/project/$(relativeNugetPackageDirectory) \
--env tracerHome=/project/${relativeTracerHome} \
--env artifacts=/project/${relativeArtifacts} \
--env SIGNALFX_CLR_ENABLE_NGEN=${SIGNALFX_CLR_ENABLE_NGEN} \
dd-trace-dotnet/${{ matrix.base-image }}-builder \
dotnet /build/bin/Debug/_build.dll Info Clean BuildTracerHome BuildLinuxIntegrationTests -Framework ${{ matrix.framework }}
- name: Build dependencies
run: docker-compose build --build-arg SERVERLESS_ARTIFACTS_PATH=.${relativeTracerHome} serverless-lambda-no-param-sync serverless-lambda-one-param-sync serverless-lambda-two-params-sync serverless-lambda-no-param-async serverless-lambda-one-param-async serverless-lambda-two-params-async serverless-lambda-no-param-void serverless-lambda-one-param-void serverless-lambda-two-params-void
- name: Start dependencies
run: docker-compose up -d StartDependencies
- name: Run integration tests in container
run: |
framework=${{ matrix.framework }} baseImage=${{ matrix.base-image }} docker-compose run --rm \
-e baseImage=${{ matrix.base-image }} \
-e framework=${{ matrix.framework }} \
-e Verify_DisableClipboard=true \
-e DiffEngine_Disabled=true \
IntegrationTests
- name: docker-compose stop services
run: docker-compose down
if: (${{ job.status }} != 'cancelled')
- uses: actions/[email protected]
with:
name: ${{ matrix.base-image }}-integration-tests-${{ matrix.framework }}-build_data
path: tracer/build_data
if: (${{ job.status }} != 'cancelled')
continue-on-error: true
windows-iis-integration-tests:
name: Windows - IIS integration tests
runs-on: windows-2022
strategy:
matrix:
platform:
- x64
framework: [ net461, netcoreapp3.1 ]
timeout-minutes: 60
steps:
- name: Support Windows long paths
if: ${{ runner.os == 'Windows' }}
run: git config --system core.longpaths true
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
dotnet-version: |
2.1.818
3.1.426
5.0.408
6.0.404
7.0.101
- name: install Microsoft.Net.Component.4.6.1.TargetingPack
run: |
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
$InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
$componentsToAdd = @(
"Microsoft.Net.Component.4.6.1.TargetingPack"
)
[string]$workloadArgs = $componentsToAdd | ForEach-Object {" --add " + $_}
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
if ($process.ExitCode -eq 0)
{
Write-Host "components have been successfully added"
}
else
{
Write-Host "components were not installed"
exit 1
}
- name: RunWindowsTracerIisIntegrationTests
run: ./tracer/build.cmd BuildTracerHome BuildAspNetIntegrationTests RunWindowsTracerIisIntegrationTests -Framework ${{ matrix.framework }}
- uses: actions/[email protected]
with:
name: windows-tracer-iis-integration-tests-${{ matrix.platform }}-build_data
path: tracer/build_data
if: (${{ job.status }} != 'cancelled')
continue-on-error: true
windows-msi-integration-tests:
name: Windows - MSI integration tests
runs-on: windows-2022
strategy:
matrix:
platform:
- x64
framework: [ net461, netcoreapp3.1 ]
timeout-minutes: 60
steps:
- name: Support Windows long paths
if: ${{ runner.os == 'Windows' }}
run: git config --system core.longpaths true
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
dotnet-version: |
2.1.818
3.1.426
5.0.408
6.0.404
7.0.101
- name: install Microsoft.Net.Component.4.6.1.TargetingPack
run: |
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
$InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
$componentsToAdd = @(
"Microsoft.Net.Component.4.6.1.TargetingPack"
)
[string]$workloadArgs = $componentsToAdd | ForEach-Object {" --add " + $_}
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
if ($process.ExitCode -eq 0)
{
Write-Host "components have been successfully added"
}
else
{
Write-Host "components were not installed"
exit 1
}
- run: ./tracer/build.cmd BuildTracerHome PackageTracerHome BuildAspNetIntegrationTests -Framework ${{ matrix.framework }}
- run: docker-compose up -d IntegrationTests.IIS
- name: RunWindowsMsiIntegrationTests
run: ./tracer/build.cmd RunWindowsMsiIntegrationTests -Framework ${{ matrix.framework }}
- name: docker-compose stop services
run: docker-compose down
if: (${{ job.status }} != 'cancelled')
- uses: actions/[email protected]
with:
name: windows-msi-integration-tests-${{ matrix.platform }}-build_data
path: tracer/build_data
if: (${{ job.status }} != 'cancelled')
continue-on-error: true