Skip to content

Commit

Permalink
Add dedicated ci for Instrumentation.Wcf project.
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch committed Sep 22, 2023
1 parent 5cb78d4 commit b3779a9
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 54 deletions.
5 changes: 5 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ flags:
paths:
- src/OpenTelemetry.Instrumentation.Process

unittests-Instrumentation.Wcf:
carryforward: true
paths:
- src/OpenTelemetry.Instrumentation.Wcf

17 changes: 17 additions & 0 deletions .github/workflows/ci-Instrumentation.Wcf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Build OpenTelemetry.Instrumentation.Wcf

on:
pull_request:
branches: [ 'main*', 'instrumentation*' ]
paths:
- '*/OpenTelemetry.Instrumentation.Wcf*/**'
- 'build/**'
- '!**.md'

jobs:
call-build-test:
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: OpenTelemetry.Instrumentation.Wcf
code-cov-name: Instrumentation.Wcf

9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ on:
branches: [ 'main*', 'instrumentation*', 'exporter*', 'extensions*' ]
paths-ignore:
- '**.md'
- '*/OpenTelemetry.Instrumentation.Process*/**'
- '*/OpenTelemetry.Exporter.Geneva*/**'
- '*/OpenTelemetry.Exporter.OneCollector*/**'
- '*/OpenTelemetry.Instrumentation.Process*/**'
- '*/OpenTelemetry.Instrumentation.Wcf*/**'

jobs:
build-test:
Expand Down Expand Up @@ -39,7 +40,11 @@ jobs:
run: |
$projects = Get-ChildItem `
-Path test/*.Tests/*.csproj `
-Exclude OpenTelemetry.Instrumentation.Process.Tests.csproj, OpenTelemetry.Exporter.Geneva.Tests.csproj, OpenTelemetry.Exporter.OneCollector.Tests.csproj
-Exclude `
OpenTelemetry.Exporter.Geneva.Tests.csproj,
OpenTelemetry.Exporter.OneCollector.Tests.csproj,
OpenTelemetry.Instrumentation.Process.Tests.csproj,
OpenTelemetry.Instrumentation.Wcf.Tests.csproj
ForEach ($project in $projects)
{
Expand Down
57 changes: 6 additions & 51 deletions .github/workflows/package-Instrumentation.Wcf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,58 +9,13 @@ on:
default: 'warning'
push:
tags:
- 'Instrumentation.Wcf-*'
- 'Instrumentation.Wcf-*' # trigger when we create a tag with prefix "Instrumentation.Wcf-"

jobs:
build-test-pack:
runs-on: ${{ matrix.os }}
call-build-test-pack:
permissions:
contents: write
env:
PROJECT: OpenTelemetry.Instrumentation.Wcf

strategy:
matrix:
os: [windows-latest]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetching all

- name: Setup dotnet
uses: actions/setup-dotnet@v3

- name: Install dependencies
run: dotnet restore src/${{env.PROJECT}}

- name: dotnet build ${{env.PROJECT}}
run: dotnet build src/${{env.PROJECT}} --configuration Release --no-restore -p:Deterministic=true

- name: dotnet test ${{env.PROJECT}}
run: dotnet test test/${{env.PROJECT}}.Tests

- name: dotnet pack ${{env.PROJECT}}
run: dotnet pack src/${{env.PROJECT}} --configuration Release --no-build

- name: Publish Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{env.PROJECT}}-packages
path: '**/${{env.PROJECT}}/bin/**/*.*nupkg'

- name: Publish Nuget
run: |
nuget push **/${{env.PROJECT}}/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/${{env.PROJECT}}/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/${{env.PROJECT}}/CHANGELOG.md) for details." --latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ./.github/workflows/Component.Package.yml
with:
project-name: OpenTelemetry.Instrumentation.Wcf
secrets: inherit
26 changes: 26 additions & 0 deletions build/Projects/OpenTelemetry.Instrumentation.Wcf.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<Project>

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

<ItemGroup>
<SolutionProjects Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.Wcf\OpenTelemetry.Instrumentation.Wcf.csproj" />
<SolutionProjects Include="$(RepoRoot)\test\OpenTelemetry.Instrumentation.Wcf.Tests\OpenTelemetry.Instrumentation.Wcf.Tests.csproj" />

<PackProjects Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.Wcf\OpenTelemetry.Instrumentation.Wcf.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>
4 changes: 3 additions & 1 deletion opentelemetry-dotnet-contrib.sln
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
.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
.github\workflows\ci-Instrumentation.Wcf.yml = .github\workflows\ci-Instrumentation.Wcf.yml
.github\workflows\ci-md.yml = .github\workflows\ci-md.yml
.github\workflows\ci.yml = .github\workflows\ci.yml
.github\workflows\codeql-analysis.yml = .github\workflows\codeql-analysis.yml
.github\workflows\Component.BuildTest.yml = .github\workflows\Component.BuildTest.yml
.github\workflows\Component.Package.yml = .github\workflows\Component.Package.yml
.github\workflows\dotnet-core-cov.yml = .github\workflows\dotnet-core-cov.yml
.github\workflows\Component.BuildTest.yml = .github\workflows\Component.BuildTest.yml
.github\workflows\dotnet-format-md.yml = .github\workflows\dotnet-format-md.yml
.github\workflows\dotnet-format.yml = .github\workflows\dotnet-format.yml
.github\workflows\integration-md.yml = .github\workflows\integration-md.yml
Expand Down Expand Up @@ -310,6 +311,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Projects", "Projects", "{04
build\Projects\OpenTelemetry.Exporter.Geneva.proj = build\Projects\OpenTelemetry.Exporter.Geneva.proj
build\Projects\OpenTelemetry.Exporter.OneCollector.proj = build\Projects\OpenTelemetry.Exporter.OneCollector.proj
build\Projects\OpenTelemetry.Instrumentation.Process.proj = build\Projects\OpenTelemetry.Instrumentation.Process.proj
build\Projects\OpenTelemetry.Instrumentation.Wcf.proj = build\Projects\OpenTelemetry.Instrumentation.Wcf.proj
EndProjectSection
EndProject
Global
Expand Down

0 comments on commit b3779a9

Please sign in to comment.