ci #2979
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
schedule: | |
- cron: '0 0 * * 1,3,5' # Every Monday, Wednesday, and Friday at midnight UTC | |
env: | |
buildConfiguration: Release | |
dotnetSdkVersion: 7.0.406 | |
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.419 | |
7.0.406 | |
8.0.200 | |
- 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 | |
6.0.419 | |
7.0.406 | |
8.0.200 | |
- 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 \ | |
/bin/sh -c 'git config --global --add safe.directory /project && ./tracer/build.sh 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 | |
6.0.419 | |
7.0.406 | |
8.0.200 | |
- 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 | |
6.0.419 | |
7.0.406 | |
8.0.200 | |
- 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 \ | |
/bin/sh -c 'git config --global --add safe.directory /project && ./tracer/build.sh 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 | |
6.0.419 | |
7.0.406 | |
8.0.200 | |
- 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 | |
6.0.419 | |
7.0.406 | |
8.0.200 | |
- 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 \ | |
/bin/sh -c 'git config --global --add safe.directory /project && ./tracer/build.sh 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, 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 | |
6.0.419 | |
7.0.406 | |
8.0.200 | |
# 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 | |
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, 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 | |
6.0.419 | |
7.0.406 | |
8.0.200 | |
- name: Remove large node images | |
run: docker rmi node:20 node:18 node:16 | |
- name: Remove a few unused dirs | |
run: sudo rm -rf \ | |
/usr/local/lib/android /opt/ghc \ | |
/usr/share/swift /usr/local/.ghcup \ | |
/usr/lib/jvm || true | |
- name: Disk usage | |
run: df -h | |
- 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 \ | |
/bin/sh -c 'git config --global --add safe.directory /project && ./tracer/build.sh Info Clean BuildTracerHome BuildLinuxIntegrationTests -Framework ${{ matrix.framework }}' | |
- name: Build dependencies | |
run: docker-compose build --build-arg SERVERLESS_ARTIFACTS_PATH=.${relativeTracerHome} StartDependencies | |
- 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 | |
6.0.419 | |
7.0.406 | |
8.0.200 | |
- 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 | |
6.0.419 | |
7.0.406 | |
8.0.200 | |
- 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 |