diff --git a/.github/codecov.yml b/.github/codecov.yml index bf6b155120..e28e1f2fce 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -35,6 +35,11 @@ flags: paths: - src + unittests-Exporter.Geneva: + carryforward: true + paths: + - src/OpenTelemetry.Exporter.Geneva + unittests-Exporter.OneCollector: carryforward: true paths: diff --git a/.github/workflows/ci-Exporter.Geneva.yml b/.github/workflows/ci-Exporter.Geneva.yml new file mode 100644 index 0000000000..7e99774c4c --- /dev/null +++ b/.github/workflows/ci-Exporter.Geneva.yml @@ -0,0 +1,57 @@ +name: Build OpenTelemetry.Exporter.Geneva + +on: + pull_request: + branches: [ 'main*', 'exporter*' ] + paths: + - '*/OpenTelemetry.Exporter.Geneva*/**' + - 'build/**' + - '!**.md' + +env: + PROJECT: OpenTelemetry.Exporter.Geneva + +jobs: + build-test: + + 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 ] + exclude: + - os: ubuntu-latest + version: net462 + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + + - name: dotnet restore build/Projects/${{env.PROJECT}}.proj + run: dotnet restore build/Projects/${{env.PROJECT}}.proj + + - name: dotnet build build/Projects/${{env.PROJECT}}.proj + run: dotnet build build/Projects/${{env.PROJECT}}.proj --configuration Release --no-restore + + - name: dotnet test test/${{env.PROJECT}}.Tests + run: dotnet test test/${{env.PROJECT}}.Tests --collect:"Code Coverage" --results-directory:TestResults --framework ${{ matrix.version }} --configuration Release --no-restore --no-build --logger:"console;verbosity=detailed" -- RunConfiguration.DisableAppDomain=true + + - 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-Exporter.Geneva + name: Code Coverage for Exporter.Geneva on [${{ matrix.os }}.${{ matrix.version }}] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a67fa19e3c..f0985545b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,7 @@ on: paths-ignore: - '**.md' - '*/OpenTelemetry.Instrumentation.Process*/**' + - '*/OpenTelemetry.Exporter.Geneva*/**' - '*/OpenTelemetry.Exporter.OneCollector*/**' jobs: @@ -38,7 +39,7 @@ jobs: run: | $projects = Get-ChildItem ` -Path test/*.Tests/*.csproj ` - -Exclude OpenTelemetry.Instrumentation.Process.Tests.csproj, OpenTelemetry.Exporter.OneCollector.Tests.csproj + -Exclude OpenTelemetry.Instrumentation.Process.Tests.csproj, OpenTelemetry.Exporter.Geneva.Tests.csproj, OpenTelemetry.Exporter.OneCollector.Tests.csproj ForEach ($project in $projects) { diff --git a/build/Projects/OpenTelemetry.Exporter.Geneva.proj b/build/Projects/OpenTelemetry.Exporter.Geneva.proj new file mode 100644 index 0000000000..dc1e79aafa --- /dev/null +++ b/build/Projects/OpenTelemetry.Exporter.Geneva.proj @@ -0,0 +1,28 @@ + + + + $([System.IO.Directory]::GetParent($(MSBuildThisFileDirectory)).Parent.Parent.FullName) + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/opentelemetry-dotnet-contrib.sln b/opentelemetry-dotnet-contrib.sln index 18622206c3..da36821074 100644 --- a/opentelemetry-dotnet-contrib.sln +++ b/opentelemetry-dotnet-contrib.sln @@ -29,6 +29,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{ ProjectSection(SolutionItems) = preProject .github\workflows\assign-reviewers.yml = .github\workflows\assign-reviewers.yml .github\workflows\ci-aot.yml = .github\workflows\ci-aot.yml + .github\workflows\ci-Exporter.Geneva.yml = .github\workflows\ci-Exporter.Geneva.yml .github\workflows\ci-Exporter.OneCollector-Integration.yml = .github\workflows\ci-Exporter.OneCollector-Integration.yml .github\workflows\ci-Exporter.OneCollector.yml = .github\workflows\ci-Exporter.OneCollector.yml .github\workflows\ci-Instrumentation.Process.yml = .github\workflows\ci-Instrumentation.Process.yml @@ -304,6 +305,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{9B EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Projects", "Projects", "{048509D6-FB49-4B84-832A-90E55520B97B}" ProjectSection(SolutionItems) = preProject + build\Projects\OpenTelemetry.Exporter.Geneva.proj = build\Projects\OpenTelemetry.Exporter.Geneva.proj build\Projects\OpenTelemetry.Exporter.OneCollector.proj = build\Projects\OpenTelemetry.Exporter.OneCollector.proj EndProjectSection EndProject