Skip to content

[Instrumentation.AWSLambda] Fix AoT warnings #2778

[Instrumentation.AWSLambda] Fix AoT warnings

[Instrumentation.AWSLambda] Fix AoT warnings #2778

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@v3
id: changes
with:
filters: |
md: [ '**.md' ]
build: ['build/**', '.github/**/*.yml', '!.github/workflows/package-*']
shared: ['src/Shared/**']
code: ['**.cs', '.editorconfig']
aot: ['src/OpenTelemetry.Extensions.Enrichment/**']
aottestapp: ['test/OpenTelemetry.AotCompatibility.TestApp/**']
aspnet: ['*/OpenTelemetry.Instrumentation.AspNet*/**', 'examples/AspNet/**', '!**/*.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']
host: ['*/OpenTelemetry.ResourceDetectors.Host*/**', '!**/*.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.ResourceDetectors.Process/**', '*/OpenTelemetry.ResourceDetectors.Process.Tests/**', '!**/*.md']
processruntime: ['*/OpenTelemetry.ResourceDetectors.ProcessRuntime/**', '*/OpenTelemetry.ResourceDetectors.ProcessRuntime.Tests/**', '!**/*.md']
redis: ['*/OpenTelemetry.Instrumentation.StackExchangeRedis*/**', 'examples/redis/**', '!**/*.md']
resourcedetectors: ['*/OpenTelemetry.ResourceDetectors.*/**', '!**/*.md']
runtime: ['*/OpenTelemetry.Instrumentation.Runtime*/**', 'examples/runtime-instrumentation/**', '!**/*.md']
wcf: ['*/OpenTelemetry.Instrumentation.Wcf*/**', 'examples/wcf/**', '!**/*.md']
solution: [
'src/**',
'test/**',
'examples/**',
'!test/OpenTelemetry.AotCompatibility.TestApp/**',
'!*/OpenTelemetry.Instrumentation.AspNet*/**',
'!examples/AspNet/**',
'!*/OpenTelemetry.ResourceDetectors.Azure*/**',
'!*/OpenTelemetry.ResourceDetectors.Host*/**',
'!*/OpenTelemetry.ResourceDetectors.Process/**',
'!*/OpenTelemetry.ResourceDetectors.Process.Tests/**',
'!*/OpenTelemetry.ResourceDetectors.ProcessRuntime/**',
'!*/OpenTelemetry.ResourceDetectors.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.Process*/**',
'!examples/process-instrumentation/**',
'!*/OpenTelemetry.Instrumentation.StackExchangeRedis*/**',
'!examples/redis/**',
'!*/OpenTelemetry.Instrumentation.Runtime*/**',
'!examples/runtime-instrumentation/**',
'!*/OpenTelemetry.Instrumentation.Wcf*/**',
'!examples/wcf/**',
'!**/*.md'
]
lint-md:
needs: detect-changes
if: contains(needs.detect-changes.outputs.changes, 'md')
uses: ./.github/workflows/markdownlint.yml
lint-dotnet-format:
needs: detect-changes
if: contains(needs.detect-changes.outputs.changes, 'code')
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-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: 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: 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: OpenTelemetry.Exporter.Geneva
code-cov-name: Exporter.Geneva
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: OpenTelemetry.ResourceDetectors.Host
code-cov-name: ResourceDetectors.Host
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: 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: OpenTelemetry.ResourceDetectors.Process
code-cov-name: ResourceDetectors.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: OpenTelemetry.ResourceDetectors.ProcessRuntime
code-cov-name: ResourceDetectors.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-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-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.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.EventCounters.Tests.csproj,
OpenTelemetry.Instrumentation.Owin.Tests.csproj,
OpenTelemetry.Instrumentation.Process.Tests.csproj,
OpenTelemetry.Instrumentation.Runtime.Tests.csproj,
OpenTelemetry.Instrumentation.StackExchangeRedis.Tests.csproj,
OpenTelemetry.Instrumentation.Wcf.Tests.csproj,
OpenTelemetry.PersistentStorage.FileSystem.Tests.csproj,
OpenTelemetry.ResourceDetectors.Azure.Tests.csproj,
OpenTelemetry.ResourceDetectors.Host.Tests.csproj,
OpenTelemetry.ResourceDetectors.Process.Tests.csproj,
OpenTelemetry.ResourceDetectors.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@v3.1.4
continue-on-error: true # Note: Don't fail for upload failures
env:
OS: ${{ matrix.os }}
TFM: ${{ matrix.version }}
with:
file: TestResults/Cobertura.xml
env_vars: OS,TFM
flags: unittests-Solution
name: Code Coverage for solution on [${{ matrix.os }}.${{ matrix.version }}]
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, 'aws')
|| contains(needs.detect-changes.outputs.changes, 'azure')
|| contains(needs.detect-changes.outputs.changes, 'extensions')
|| contains(needs.detect-changes.outputs.changes, 'host')
|| 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, 'redis')
|| 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-azure,
build-test-eventcounters,
build-test-extensions,
build-test-geneva,
build-test-host,
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-wcf,
build-test-solution,
verify-aot-compat
]
if: always() && !cancelled() && !contains(needs.*.result, 'failure')
runs-on: windows-latest
steps:
- run: echo 'build complete ✓'