-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into EnableNullable
- Loading branch information
Showing
103 changed files
with
1,465 additions
and
801 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Build Component | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
project-name: | ||
required: true | ||
type: string | ||
code-cov-name: | ||
required: true | ||
type: string | ||
code-cov-prefix: | ||
default: 'unittests' | ||
required: false | ||
type: string | ||
os-list: | ||
default: '[ "windows-latest", "ubuntu-latest" ]' | ||
required: false | ||
type: string | ||
tfm-list: | ||
default: '[ "net462", "net6.0", "net7.0" ]' | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
build-test: | ||
|
||
strategy: | ||
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails | ||
matrix: | ||
os: ${{ fromJSON(inputs.os-list) }} | ||
version: ${{ fromJSON(inputs.tfm-list) }} | ||
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/${{ inputs.project-name }}.proj | ||
run: dotnet restore build/Projects/${{ inputs.project-name }}.proj | ||
|
||
- name: dotnet build build/Projects/${{ inputs.project-name }}.proj | ||
run: dotnet build build/Projects/${{ inputs.project-name }}.proj --configuration Release --no-restore | ||
|
||
- name: dotnet test test/${{ inputs.project-name }}.Tests | ||
run: dotnet test test/${{ inputs.project-name }}.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 | ||
|
||
- name: Upload code coverage ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }} | ||
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: ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }} | ||
name: Code Coverage for ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }} on [${{ matrix.os }}.${{ matrix.version }}] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Pack Component | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
project-name: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build-test-pack: | ||
permissions: | ||
contents: write | ||
|
||
strategy: | ||
matrix: | ||
os: [windows-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # fetching all | ||
|
||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v3 | ||
|
||
- name: dotnet restore build/Projects/${{ inputs.project-name }}.proj | ||
run: dotnet restore build/Projects/${{ inputs.project-name }}.proj | ||
|
||
- name: dotnet build build/Projects/${{ inputs.project-name }}.proj | ||
run: dotnet build build/Projects/${{ inputs.project-name }}.proj --configuration Release --no-restore -p:Deterministic=true | ||
|
||
- name: dotnet test test/${{ inputs.project-name }}.Tests | ||
run: dotnet test test/${{ inputs.project-name }}.Tests --configuration Release --no-restore --no-build | ||
|
||
- name: dotnet pack build/Projects/${{ inputs.project-name }}.proj | ||
run: dotnet pack build/Projects/${{ inputs.project-name }}.proj --configuration Release --no-build --no-restore | ||
|
||
- name: Publish Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ inputs.project-name }}-packages | ||
path: '**/${{ inputs.project-name }}/bin/**/*.*nupkg' | ||
|
||
- name: Publish Nuget | ||
run: | | ||
nuget push **/${{ inputs.project-name }}/bin/**/*.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_TOKEN }} -SymbolApiKey ${{ secrets.NUGET_TOKEN }} | ||
- name: Create GitHub Prerelease | ||
if: ${{ (contains(github.ref_name, '-alpha') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-rc')) }} | ||
run: gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --verify-tag --notes "See [CHANGELOG](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/${{ github.ref_name }}/src/${{ inputs.project-name }}/CHANGELOG.md) for details." --prerelease | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create GitHub Release | ||
if: ${{ !(contains(github.ref_name, '-alpha') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-rc')) }} | ||
run: gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --verify-tag --notes "See [CHANGELOG](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/${{ github.ref_name }}/src/${{ inputs.project-name }}/CHANGELOG.md) for details." --latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Build OpenTelemetry.Exporter.Geneva | ||
|
||
on: | ||
pull_request: | ||
branches: [ 'main*', 'exporter*' ] | ||
paths: | ||
- '*/OpenTelemetry.Exporter.Geneva*/**' | ||
- 'src/Shared/**' | ||
- 'build/**' | ||
- '!**.md' | ||
|
||
jobs: | ||
call-build-test: | ||
uses: ./.github/workflows/Component.BuildTest.yml | ||
with: | ||
project-name: OpenTelemetry.Exporter.Geneva | ||
code-cov-name: Exporter.Geneva |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Build OpenTelemetry.Exporter.OneCollector | ||
|
||
on: | ||
pull_request: | ||
branches: [ 'main*', 'exporter*' ] | ||
paths: | ||
- '*/OpenTelemetry.Exporter.OneCollector*/**' | ||
- 'src/Shared/**' | ||
- 'build/**' | ||
- '!**.md' | ||
|
||
jobs: | ||
call-build-test: | ||
uses: ./.github/workflows/Component.BuildTest.yml | ||
with: | ||
project-name: OpenTelemetry.Exporter.OneCollector | ||
code-cov-name: Exporter.OneCollector |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Build OpenTelemetry.Instrumentation.Owin | ||
|
||
on: | ||
pull_request: | ||
branches: [ 'main*', 'instrumentation*' ] | ||
paths: | ||
- '*/OpenTelemetry.Instrumentation.Owin*/**' | ||
- 'src/Shared/**' | ||
- 'build/**' | ||
- '!**.md' | ||
|
||
jobs: | ||
call-build-test: | ||
uses: ./.github/workflows/Component.BuildTest.yml | ||
with: | ||
project-name: OpenTelemetry.Instrumentation.Owin | ||
code-cov-name: Instrumentation.Owin | ||
os-list: '[ "windows-latest" ]' | ||
tfm-list: '[ "net462" ]' | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,18 @@ | ||
name: Instrumentation.Process | ||
name: Build OpenTelemetry.Instrumentation.Process | ||
|
||
on: | ||
pull_request: | ||
branches: [ 'main*' ] | ||
branches: [ 'main*', 'instrumentation*' ] | ||
paths: | ||
- 'src/OpenTelemetry.Instrumentation.Process/**' | ||
- 'test/OpenTelemetry.Instrumentation.Process.Tests/**' | ||
|
||
env: | ||
COMPONENT_NAME: OpenTelemetry.Instrumentation.Process | ||
- '*/OpenTelemetry.Instrumentation.Process*/**' | ||
- 'src/Shared/**' | ||
- 'build/**' | ||
- '!**.md' | ||
|
||
jobs: | ||
unit-test: | ||
strategy: | ||
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails | ||
matrix: | ||
os: [ ubuntu-latest, windows-latest ] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install .NET 7 SDK | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: '7.0.x' | ||
|
||
- name: Build | ||
run: dotnet build --configuration Release test/${{ env.COMPONENT_NAME }}.Tests/${{ env.COMPONENT_NAME }}.Tests.csproj | ||
call-build-test: | ||
uses: ./.github/workflows/Component.BuildTest.yml | ||
with: | ||
project-name: OpenTelemetry.Instrumentation.Process | ||
code-cov-name: Instrumentation.Process | ||
|
||
- name: Test | ||
run: dotnet test test/${{ env.COMPONENT_NAME }}.Tests/bin/Release/**/${{ env.COMPONENT_NAME }}.Tests.dll --logger:"console;verbosity=detailed" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Build OpenTelemetry.Instrumentation.Wcf | ||
|
||
on: | ||
pull_request: | ||
branches: [ 'main*', 'instrumentation*' ] | ||
paths: | ||
- '*/OpenTelemetry.Instrumentation.Wcf*/**' | ||
- 'src/Shared/**' | ||
- 'build/**' | ||
- '!**.md' | ||
|
||
jobs: | ||
call-build-test: | ||
uses: ./.github/workflows/Component.BuildTest.yml | ||
with: | ||
project-name: OpenTelemetry.Instrumentation.Wcf | ||
code-cov-name: Instrumentation.Wcf | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ 'main*', 'instrumentation*', 'exporter*', 'extensions*' ] | ||
paths-ignore: | ||
- '**.md' | ||
pull_request: | ||
branches: [ 'main*', 'instrumentation*', 'exporter*', 'extensions*' ] | ||
paths-ignore: | ||
- '**.md' | ||
- '*/OpenTelemetry.Exporter.Geneva*/**' | ||
- '*/OpenTelemetry.Exporter.OneCollector*/**' | ||
- '*/OpenTelemetry.Instrumentation.Owin*/**' | ||
- '*/OpenTelemetry.Instrumentation.Process*/**' | ||
- '*/OpenTelemetry.Instrumentation.Wcf*/**' | ||
|
||
jobs: | ||
build-test: | ||
|
@@ -29,11 +30,42 @@ jobs: | |
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v3 | ||
|
||
- name: Install dependencies | ||
- name: Restore | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet build --configuration Release --no-restore | ||
|
||
- name: Test ${{ matrix.version }} | ||
run: dotnet test **/bin/**/${{ matrix.version }}/*.Tests.dll --logger:"console;verbosity=detailed" | ||
shell: pwsh | ||
run: | | ||
$projects = Get-ChildItem ` | ||
-Path test/*.Tests/*.csproj ` | ||
-Exclude ` | ||
OpenTelemetry.Exporter.Geneva.Tests.csproj, | ||
OpenTelemetry.Exporter.OneCollector.Tests.csproj, | ||
OpenTelemetry.Instrumentation.Owin.Tests.csproj, | ||
OpenTelemetry.Instrumentation.Process.Tests.csproj, | ||
OpenTelemetry.Instrumentation.Wcf.Tests.csproj | ||
ForEach ($project in $projects) | ||
{ | ||
dotnet test $project.FullName --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 | ||
name: Code Coverage for solution on [${{ matrix.os }}.${{ matrix.version }}] |
Oops, something went wrong.