Skip to content

[Instrumentation.GrpcCore] @IliaBrahinets - component owner #3546

[Instrumentation.GrpcCore] @IliaBrahinets - component owner

[Instrumentation.GrpcCore] @IliaBrahinets - component owner #3546

Workflow file for this run

name: Build
on:
pull_request:
branches: [ 'main*', 'instrumentation*', 'exporter*', 'extensions*' ]
jobs:
lint-misspell-sanitycheck:
uses: ./.github/workflows/sanitycheck.yml
detect-changes:
runs-on: windows-latest
outputs:
changes: ${{ steps.changes.outputs.changes }}
steps:
- uses: AurorNZ/paths-filter@v4
id: changes
with:
filters: |
md: [ '**.md' ]
build: ['build/**', '.github/**/*.yml', '!.github/workflows/package-*', '**/*.targets', '**/*.props']
shared: ['src/Shared/**', 'test/Shared/**']
sharedtests: ['test/OpenTelemetry.Contrib.Shared.Tests/**']
code: ['**.cs', '**.csproj', '.editorconfig']
aot: ['src/OpenTelemetry.Extensions.Enrichment/**']
aottestapp: ['test/OpenTelemetry.AotCompatibility.TestApp/**']
aspnet: ['*/OpenTelemetry.Instrumentation.AspNet/**', '*/OpenTelemetry.Instrumentation.OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/**', 'examples/AspNet/**', '!**/*.md']
aspnetcore: ['*/OpenTelemetry.Instrumentation.AspNetCore*/**', '!**/*.md']
aws: ['*/OpenTelemetry.*.AWS*/**', '!**/*.md']
azure: ['*/OpenTelemetry.ResourceDetectors.Azure*/**', '!**/*.md']
eventcounters: ['*/OpenTelemetry.Instrumentation.EventCounters*/**', 'examples/event-counters/**', '!**/*.md']
extensions: ['*/OpenTelemetry.Extensions/**', '*/OpenTelemetry.Extensions.Tests/**', '!**/*.md']
geneva: ['*/OpenTelemetry.Exporter.Geneva*/**', '!**/*.md']
gcp: ['*/OpenTelemetry.Resources.Gcp*/**', '!**/*.md']
grpcnetclient: ['*/OpenTelemetry.Instrumentation.GrpcNetClient*/**', '!**/*.md']
host: ['*/OpenTelemetry.Resources.Host*/**', '!**/*.md']
http: ['*/OpenTelemetry.Instrumentation.Http*/**', '!**/*.md']
onecollector: ['*/OpenTelemetry.Instrumentation.OneCollector*/**', '!**/*.md']
owin: ['*/OpenTelemetry.Instrumentation.Owin*/**', 'examples/owin/**', '!**/*.md']
persistentstorage: ['*/OpenTelemetry.PersistentStorage*/**', '!**/*.md']
process: ['*/OpenTelemetry.Instrumentation.Process*/**', 'examples/process-instrumentation/**', '!**/*.md']
processdetector: ['*/OpenTelemetry.Resources.Process/**', '*/OpenTelemetry.Resources.Process.Tests/**', '!**/*.md']
processruntime: ['*/OpenTelemetry.Resources.ProcessRuntime/**', '*/OpenTelemetry.Resources.ProcessRuntime.Tests/**', '!**/*.md']
redis: ['*/OpenTelemetry.Instrumentation.StackExchangeRedis*/**', 'examples/redis/**', '!**/*.md']
resourcedetectors: ['*/OpenTelemetry.ResourceDetectors.*/**', '!**/*.md']
runtime: ['*/OpenTelemetry.Instrumentation.Runtime*/**', 'examples/runtime-instrumentation/**', '!**/*.md']
semanticconventions: ['*/OpenTelemetry.SemanticConventions*/**', '!**/*.md']
sqlclient: ['*/OpenTelemetry.Instrumentation.SqlClient*/**', '!**/*.md']
wcf: ['*/OpenTelemetry.Instrumentation.Wcf*/**', 'examples/wcf/**', '!**/*.md']
solution: [
'src/**',
'test/**',
'examples/**',
'!test/OpenTelemetry.AotCompatibility.TestApp/**',
'!*/OpenTelemetry.Instrumentation.AspNet.*/**',
'!*/OpenTelemetry.Instrumentation.AspNetCore*/**',
'!examples/AspNet/**',
'!*/OpenTelemetry.ResourceDetectors.Azure*/**',
'!*/OpenTelemetry.Resources.Host*/**',
'!*/OpenTelemetry.Resources.Gcp*/**',
'!*/OpenTelemetry.Resources.Process/**',
'!*/OpenTelemetry.Resources.Process.Tests/**',
'!*/OpenTelemetry.Resources.ProcessRuntime/**',
'!*/OpenTelemetry.Resources.ProcessRuntime.Tests/**',
'!*/OpenTelemetry.Instrumentation.EventCounters*/**',
'!examples/event-counters/**',
'!*/OpenTelemetry.Extensions/**',
'!*/OpenTelemetry.Extensions.Tests/**',
'!*/OpenTelemetry.Exporter.Geneva*/**',
'!*/OpenTelemetry.Exporter.OneCollector*/**',
'!*/OpenTelemetry.Instrumentation.Owin*/**',
'!examples/owin/**',
'!*/OpenTelemetry.PersistentStorage*/**',
'!*/OpenTelemetry.Instrumentation.GrpcNetClient*/**',
'!*/OpenTelemetry.Instrumentation.Http*/**',
'!*/OpenTelemetry.Instrumentation.Process*/**',
'!examples/process-instrumentation/**',
'!*/OpenTelemetry.Instrumentation.SqlClient*/**',
'!*/OpenTelemetry.Instrumentation.StackExchangeRedis*/**',
'!examples/redis/**',
'!*/OpenTelemetry.Instrumentation.Runtime*/**',
'!examples/runtime-instrumentation/**',
'!*/OpenTelemetry.SemanticConventions*/**',
'!*/OpenTelemetry.Instrumentation.Wcf*/**',
'!examples/wcf/**',
'!*/OpenTelemetry.Contrib.Shared.Tests/**',
'!**/*.md'
]
lint-md:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'md')
|| contains(needs.detect-changes.outputs.changes, 'build')
uses: ./.github/workflows/markdownlint.yml
lint-dotnet-format:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'code')
|| contains(needs.detect-changes.outputs.changes, 'build')
uses: ./.github/workflows/dotnet-format.yml
build-test-aspnet:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'aspnet')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: OpenTelemetry.Instrumentation.AspNet
code-cov-name: Instrumentation.AspNet
os-list: '[ "windows-latest" ]'
tfm-list: '[ "net462" ]'
build-test-aspnetcore:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'aspnetcore')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: OpenTelemetry.Instrumentation.AspNetCore
code-cov-name: Instrumentation.AspNetCore
tfm-list: '[ "net6.0", "net7.0", "net8.0" ]'
build-test-azure:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'azure')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: Component[OpenTelemetry.ResourceDetectors.Azure]
code-cov-name: ResourceDetectors.Azure
build-test-eventcounters:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'eventcounters')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: OpenTelemetry.Instrumentation.EventCounters
code-cov-name: Instrumentation.EventCounters
tfm-list: '[ "net6.0", "net7.0", "net8.0" ]'
build-test-extensions:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'extensions')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: Component[OpenTelemetry.Extensions]
code-cov-name: Extensions
build-test-geneva:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'geneva')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: Component[OpenTelemetry.Exporter.Geneva]
code-cov-name: Exporter.Geneva
build-test-gcp:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'gcp')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: Component[OpenTelemetry.Resources.Gcp]
code-cov-name: Resources.Gcp
build-test-grpcnetclient:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'grpcnetclient')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: Component[OpenTelemetry.Instrumentation.GrpcNetClient]
code-cov-name: Instrumentation.GrpcNetClient
build-test-host:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'host')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: Component[OpenTelemetry.Resources.Host]
code-cov-name: Resources.Host
build-test-http:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'http')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: Component[OpenTelemetry.Instrumentation.Http]
code-cov-name: Instrumentation.Http
build-test-onecollector:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'onecollector')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: Component[OpenTelemetry.Exporter.OneCollector]
code-cov-name: Exporter.OneCollector
build-test-owin:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'owin')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: OpenTelemetry.Instrumentation.Owin
code-cov-name: Instrumentation.Owin
os-list: '[ "windows-latest" ]'
tfm-list: '[ "net462" ]'
build-test-persistentstorage:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'persistentstorage')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: OpenTelemetry.PersistentStorage
code-cov-name: PersistentStorage
build-test-process:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'process')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: OpenTelemetry.Instrumentation.Process
code-cov-name: Instrumentation.Process
build-test-processdetector:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'processdetector')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: Component[OpenTelemetry.Resources.Process]
code-cov-name: Resources.Process
build-test-processruntime:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'processruntime')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: Component[OpenTelemetry.Resources.ProcessRuntime]
code-cov-name: Resources.ProcessRuntime
build-test-redis:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'redis')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: OpenTelemetry.Instrumentation.StackExchangeRedis
code-cov-name: Instrumentation.StackExchangeRedis
build-test-redis-integration:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'redis')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/integration.yml
build-test-runtime:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'runtime')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: OpenTelemetry.Instrumentation.Runtime
code-cov-name: Instrumentation.Runtime
build-test-semanticconventions:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'semanticconventions')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: OpenTelemetry.SemanticConventions
code-cov-name: SemanticConventions
build-test-sqlclient:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'sqlclient')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: Component[OpenTelemetry.Instrumentation.SqlClient]
code-cov-name: Instrumentation.SqlClient
build-test-wcf:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'wcf')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: OpenTelemetry.Instrumentation.Wcf
code-cov-name: Instrumentation.Wcf
build-test-sharedtests:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'sharedtests')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: OpenTelemetry.Contrib.Shared.Tests
code-cov-name: Contrib.Shared.Tests
build-test-solution:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'solution')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: [ windows-latest, ubuntu-latest ]
version: [ net462, net6.0, net7.0, net8.0 ]
exclude:
- os: ubuntu-latest
version: net462
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
- name: Restore, Build, & Test ${{ matrix.version }}
shell: pwsh
run: |
$projects = Get-ChildItem `
-Path test/*.Tests/*.csproj `
-Exclude `
OpenTelemetry.Contrib.Shared.Tests.csproj,
OpenTelemetry.Exporter.Geneva.Tests.csproj,
OpenTelemetry.Exporter.OneCollector.Tests.csproj,
OpenTelemetry.Extensions.Tests.csproj,
OpenTelemetry.Instrumentation.AspNet.Tests.csproj,
OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests.csproj,
OpenTelemetry.Instrumentation.AspNetCore.Tests.csproj,
OpenTelemetry.Instrumentation.EventCounters.Tests.csproj,
OpenTelemetry.Instrumentation.GrpcNetClient.Tests.csproj,
OpenTelemetry.Instrumentation.Http.Tests.csproj,
OpenTelemetry.Instrumentation.Owin.Tests.csproj,
OpenTelemetry.Instrumentation.Process.Tests.csproj,
OpenTelemetry.Instrumentation.Runtime.Tests.csproj,
OpenTelemetry.Instrumentation.SqlClient.Tests.csproj,
OpenTelemetry.Instrumentation.StackExchangeRedis.Tests.csproj,
OpenTelemetry.Instrumentation.Wcf.Tests.csproj,
OpenTelemetry.PersistentStorage.FileSystem.Tests.csproj,
OpenTelemetry.ResourceDetectors.Azure.Tests.csproj,
OpenTelemetry.Resources.Gcp.Tests.csproj,
OpenTelemetry.Resources.Host.Tests.csproj,
OpenTelemetry.Resources.Process.Tests.csproj,
OpenTelemetry.Resources.ProcessRuntime.Tests.csproj
$failedProjects = @()
ForEach ($project in $projects)
{
dotnet test $project.FullName --collect:"Code Coverage" --results-directory:"TestResults" --framework ${{ matrix.version }} --configuration Release --logger:"console;verbosity=detailed" -- RunConfiguration.DisableAppDomain=true
if ($LASTEXITCODE -ne 0)
{
$failedProjects = $failedProjects + $project
}
}
if ($failedProjects.Count -gt 0)
{
throw "dotnet test failed on '$failedProjects' project(s)"
}
- name: Install coverage tool
run: dotnet tool install -g dotnet-coverage
- name: Merging test results
run: dotnet-coverage merge -r -f cobertura -o ./TestResults/Cobertura.xml ./TestResults/*.coverage
- uses: codecov/codecov-action@v4
continue-on-error: true # Note: Don't fail for upload failures
env:
OS: ${{ matrix.os }}
TFM: ${{ matrix.version }}
token: ${{ secrets.CODECOV_TOKEN }}
with:
file: TestResults/Cobertura.xml
env_vars: OS,TFM
flags: unittests-Solution
name: Code Coverage for solution on [${{ matrix.os }}.${{ matrix.version }}]
codecov_yml_path: .github/codecov.yml
verify-aot-compat:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'eventcounters')
|| contains(needs.detect-changes.outputs.changes, 'runtime')
|| contains(needs.detect-changes.outputs.changes, 'aspnetcore')
|| contains(needs.detect-changes.outputs.changes, 'aws')
|| contains(needs.detect-changes.outputs.changes, 'azure')
|| contains(needs.detect-changes.outputs.changes, 'extensions')
|| contains(needs.detect-changes.outputs.changes, 'gcp')
|| contains(needs.detect-changes.outputs.changes, 'grpcnetclient')
|| contains(needs.detect-changes.outputs.changes, 'host')
|| contains(needs.detect-changes.outputs.changes, 'http')
|| contains(needs.detect-changes.outputs.changes, 'processdetector')
|| contains(needs.detect-changes.outputs.changes, 'processruntime')
|| contains(needs.detect-changes.outputs.changes, 'resourcedetectors')
|| contains(needs.detect-changes.outputs.changes, 'aot')
|| contains(needs.detect-changes.outputs.changes, 'aottestapp')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'geneva')
|| contains(needs.detect-changes.outputs.changes, 'onecollector')
|| contains(needs.detect-changes.outputs.changes, 'redis')
|| contains(needs.detect-changes.outputs.changes, 'sqlclient')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/verifyaotcompat.yml
build-test:
needs: [
lint-misspell-sanitycheck,
detect-changes,
lint-md,
lint-dotnet-format,
build-test-aspnet,
build-test-aspnetcore,
build-test-azure,
build-test-eventcounters,
build-test-extensions,
build-test-geneva,
build-test-gcp,
build-test-grpcnetclient,
build-test-host,
build-test-http,
build-test-onecollector,
build-test-owin,
build-test-persistentstorage,
build-test-process,
build-test-processdetector,
build-test-processruntime,
build-test-redis,
build-test-redis-integration,
build-test-runtime,
build-test-semanticconventions,
build-test-sqlclient,
build-test-wcf,
build-test-solution,
build-test-sharedtests,
verify-aot-compat
]
if: always() && !cancelled() && !contains(needs.*.result, 'failure')
runs-on: windows-latest
steps:
- run: echo 'build complete ✓'