-
Notifications
You must be signed in to change notification settings - Fork 304
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] Dedicated workflows for Instrumentation.Process & Exporter.OneCollector #1355
Merged
CodeBlanch
merged 7 commits into
open-telemetry:main
from
CodeBlanch:repo-ci-improvements
Sep 20, 2023
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1579147
Dedicated workflows for Instrumention.Process & Exporter.OneCollector…
CodeBlanch dfc47a3
Merge branch 'main' into repo-ci-improvements
utpilla 880f33f
Remove push triggers and run code coverage in main ci workflow.
CodeBlanch 9ce495a
Exclude Instrumentation.Process & Exporter.OneCollector from main CI …
CodeBlanch cef304b
Merge branch 'repo-ci-improvements' of https://github.com/CodeBlanch/…
CodeBlanch cb7321e
Update main CI workflow to not fail for code coverage upload issues.
CodeBlanch e7c0150
Merge branch 'main' into repo-ci-improvements
utpilla File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,57 @@ | ||
name: Build OpenTelemetry.Exporter.OneCollector | ||
|
||
on: | ||
pull_request: | ||
branches: [ 'main*', 'exporter*' ] | ||
paths: | ||
- '*/OpenTelemetry.Exporter.OneCollector*/**' | ||
- 'build/**' | ||
- '!**.md' | ||
|
||
env: | ||
PROJECT: OpenTelemetry.Exporter.OneCollector | ||
|
||
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.OneCollector | ||
name: Code Coverage for Exporter.OneCollector 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 |
---|---|---|
@@ -1,33 +1,57 @@ | ||
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/**' | ||
- '*/OpenTelemetry.Instrumentation.Process*/**' | ||
- 'build/**' | ||
- '!**.md' | ||
|
||
env: | ||
COMPONENT_NAME: OpenTelemetry.Instrumentation.Process | ||
PROJECT: OpenTelemetry.Instrumentation.Process | ||
|
||
jobs: | ||
unit-test: | ||
build-test: | ||
|
||
strategy: | ||
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails | ||
matrix: | ||
os: [ ubuntu-latest, windows-latest ] | ||
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: Install .NET 7 SDK | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: '7.0.x' | ||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v3 | ||
|
||
- name: dotnet restore test/${{ env.PROJECT }}.Tests | ||
run: dotnet restore test/${{ env.PROJECT }}.Tests | ||
|
||
- name: dotnet build test/${{ env.PROJECT }}.Tests | ||
run: dotnet build test/${{ env.PROJECT }}.Tests --configuration Release --no-restore | ||
|
||
- name: Build | ||
run: dotnet build --configuration Release test/${{ env.COMPONENT_NAME }}.Tests/${{ env.COMPONENT_NAME }}.Tests.csproj | ||
- 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: Test | ||
run: dotnet test test/${{ env.COMPONENT_NAME }}.Tests/bin/Release/**/${{ env.COMPONENT_NAME }}.Tests.dll --logger:"console;verbosity=detailed" | ||
- 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-Instrumentation.Process | ||
name: Code Coverage for Instrumentation.Process 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
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,12 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ 'main*', 'instrumentation*', 'exporter*', 'extensions*' ] | ||
paths-ignore: | ||
- '**.md' | ||
pull_request: | ||
branches: [ 'main*', 'instrumentation*', 'exporter*', 'extensions*' ] | ||
paths-ignore: | ||
- '**.md' | ||
- '*/OpenTelemetry.Instrumentation.Process*/**' | ||
- '*/OpenTelemetry.Exporter.OneCollector*/**' | ||
|
||
jobs: | ||
build-test: | ||
|
@@ -29,11 +27,37 @@ 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.Instrumentation.Process.Tests.csproj, OpenTelemetry.Exporter.OneCollector.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 }}] |
This file was deleted.
Oops, something went wrong.
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
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
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
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow up PR - probably we can do the same with xunit, dotnet-xunit and xunit-visualstudio-runner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not opposed to that. But I didn't here because I thought I saw one project using MSTest (not xunit). Personally I am OK with component owners using a different framework if they want, no reason in my mind that they MUST use
xunit
. But we could simplify it down by using a property like<XUnitEnabled>true</XUnitEnabled>
and then use that to add in whatever references we need?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would go with opt-out for XUnitEnabled for all tests packages as major (all?) of our packages are based on this.
BTW I cannot find the MSTest reference in this repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just looked, I couldn't find it either. Maybe I imagined it 😄 Anyway opened this: #1363