Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[repo] Add dedicated CI for Geneva Exporter #1365

Merged
merged 2 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ flags:
paths:
- src

unittests-Exporter.Geneva:
carryforward: true
paths:
- src/OpenTelemetry.Exporter.Geneva

unittests-Exporter.OneCollector:
carryforward: true
paths:
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/ci-Exporter.Geneva.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}]
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
paths-ignore:
- '**.md'
- '*/OpenTelemetry.Instrumentation.Process*/**'
- '*/OpenTelemetry.Exporter.Geneva*/**'
- '*/OpenTelemetry.Exporter.OneCollector*/**'

jobs:
Expand Down Expand Up @@ -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)
{
Expand Down
28 changes: 28 additions & 0 deletions build/Projects/OpenTelemetry.Exporter.Geneva.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project>

<PropertyGroup>
<RepoRoot>$([System.IO.Directory]::GetParent($(MSBuildThisFileDirectory)).Parent.Parent.FullName)</RepoRoot>
</PropertyGroup>

<ItemGroup>
<SolutionProjects Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Geneva\OpenTelemetry.Exporter.Geneva.csproj" />
<SolutionProjects Include="$(RepoRoot)\test\OpenTelemetry.Exporter.Geneva.Tests\OpenTelemetry.Exporter.Geneva.Tests.csproj" />
<SolutionProjects Include="$(RepoRoot)\test\OpenTelemetry.Exporter.Geneva.Benchmark\OpenTelemetry.Exporter.Geneva.Benchmark.csproj" />
<SolutionProjects Include="$(RepoRoot)\test\OpenTelemetry.Exporter.Geneva.Stress\OpenTelemetry.Exporter.Geneva.Stress.csproj" />

<PackProjects Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Geneva\OpenTelemetry.Exporter.Geneva.csproj" />
</ItemGroup>

<Target Name="Build">
<MSBuild Projects="@(SolutionProjects)" Targets="Build" ContinueOnError="ErrorAndStop" />
</Target>

<Target Name="Restore">
<MSBuild Projects="@(SolutionProjects)" Targets="Restore" ContinueOnError="ErrorAndStop" />
</Target>

<Target Name="Pack">
<MSBuild Projects="@(PackProjects)" Targets="Pack" ContinueOnError="ErrorAndStop" />
</Target>

</Project>
2 changes: 2 additions & 0 deletions opentelemetry-dotnet-contrib.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading